comments: Make comment() pagespec also match comments that are being posted.
authorJoey Hess <joey@kitenet.net>
Fri, 12 Nov 2010 04:36:03 +0000 (00:36 -0400)
committerJoey Hess <joey@kitenet.net>
Fri, 12 Nov 2010 04:36:03 +0000 (00:36 -0400)
IkiWiki/Plugin/comments.pm
debian/changelog

index 57f5b13045bdafa8c98d02288bc423fddee4ff0d..a39dab36cdb81e6c06049d9c0bc312a6e58b1dd2 100644 (file)
@@ -947,14 +947,16 @@ sub match_comment ($$;@) {
        my $page = shift;
        my $glob = shift;
 
-       # To see if it's a comment, check the source file type.
-       # Deal with comments that were just deleted.
-       my $source=exists $IkiWiki::pagesources{$page} ?
-               $IkiWiki::pagesources{$page} :
-               $IkiWiki::delpagesources{$page};
-       my $type=defined $source ? IkiWiki::pagetype($source) : undef;
-       if (! defined $type || $type ne "_comment") {
-               return IkiWiki::FailReason->new("$page is not a comment");
+       if (! $postcomment) {
+               # To see if it's a comment, check the source file type.
+               # Deal with comments that were just deleted.
+               my $source=exists $IkiWiki::pagesources{$page} ?
+                       $IkiWiki::pagesources{$page} :
+                       $IkiWiki::delpagesources{$page};
+               my $type=defined $source ? IkiWiki::pagetype($source) : undef;
+               if (! defined $type || $type ne "_comment") {
+                       return IkiWiki::FailReason->new("$page is not a comment");
+               }
        }
 
        return match_glob($page, "$glob/*", internal => 1, @_);
index 91a678805913bf80fb28169d0c2ed1d95a56dcb9..2c4c9274afbf391af7833bf1a3ef196506287ee8 100644 (file)
@@ -13,6 +13,8 @@ ikiwiki (3.20101024) UNRELEASED; urgency=low
     comments, but leave your blog posts unscrubbed, etc.
   * comments: Make postcomment() pagespec work when previewing a comment,
     including during moderation.
+  * comments: Make comment() pagespec also match comments that are being
+    posted.
 
  -- Joey Hess <joeyh@debian.org>  Mon, 25 Oct 2010 22:30:29 -0400