shithub: werc

Download patch

ref: 7c69574c04c031d40389854231120ceaab39668d
parent: 2df0c21bc7a1e5454b20844e476f41cceddb3241
author: uriel <uriel@engel.se.cat-v.org>
date: Mon Jan 26 01:12:45 EST 2009

Be smarter about when to enable comments, and make it configurable.

--- a/apps/bridge/app.rc
+++ b/apps/bridge/app.rc
@@ -1,5 +1,6 @@
+comment_file_types=(md html)
 fn bridge_init {
-    if(! ~ $#enable_comments 0 && test -f $local_path.md) {
+    if(! ~ $#enable_comments 0 && ! ~ `{ls $local_path.$comment_file_types >[2]/dev/null|wc -l} 0) {
         ll_add handlers_body_foot template apps/bridge/foot.tpl
         if(get_post_args comment_text) {
             d=`{date -n} # FIXME Obvious race