comments: Change internal-use-only directive from [[!comment]] to [[!_comment]]
[ikiwiki.git] / IkiWiki / Plugin / comments.pm
index 4fa82f4678da6fb1e211d2c0a9ff9374eaa73377..9ea4a3f69878c3fcb8d9a1b5df43104a23dcdcf5 100644 (file)
@@ -17,7 +17,7 @@ use constant CANCEL => "Cancel";
 sub import { #{{{
        hook(type => "checkconfig", id => 'comments',  call => \&checkconfig);
        hook(type => "getsetup", id => 'comments',  call => \&getsetup);
-       hook(type => "preprocess", id => 'comment', call => \&preprocess);
+       hook(type => "preprocess", id => '_comment', call => \&preprocess);
        hook(type => "sessioncgi", id => 'comment', call => \&sessioncgi);
        hook(type => "htmlize", id => "_comment", call => \&htmlize);
        hook(type => "pagetemplate", id => "comments", call => \&pagetemplate);
@@ -89,12 +89,10 @@ sub preprocess { # {{{
                ($commentauthorurl, $commentauthor) =
                        linkuser($params{username});
        }
-       elsif (defined $params{ip}) {
-               $commentip = $params{ip};
-               $commentauthor = sprintf(
-                       gettext("Anonymous (IP: %s)"), $params{ip});
-       }
        else {
+               if (defined $params{ip}) {
+                       $commentip = $params{ip};
+               }
                $commentauthor = gettext("Anonymous");
        }
 
@@ -405,7 +403,7 @@ sub sessioncgi ($$) { #{{{
        my $anchor = "${comments_pagename}${i}";
 
        $editcontent =~ s/"/\\"/g;
-       my $content = "[[!comment format=$type\n";
+       my $content = "[[!_comment format=$type\n";
 
        # FIXME: handling of double quotes probably wrong?
        if (defined $session->param('name')) {
@@ -560,6 +558,8 @@ sub pagetemplate (@) { #{{{
                                reverse => 'yes',
                                page => $page,
                                destpage => $params{destpage},
+                               feedfile => 'comments',
+                               emptyfeeds => 'no',
                        );
                        $comments = IkiWiki::preprocess_inline(@args);
                }