]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/commitdiff
- fix typo
authorjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Tue, 25 Apr 2006 20:24:44 +0000 (20:24 +0000)
committerjoey <joey@0fa5a96a-9a0e-0410-b3b2-a0fd24251071>
Tue, 25 Apr 2006 20:24:44 +0000 (20:24 +0000)
- avoid sending commit mails to the user who made the commit

IkiWiki/CGI.pm
IkiWiki/Rcs/SVN.pm
IkiWiki/UserInfo.pm

index 067886c70d49c1eed93865b8f867584a73a06605..e5cee9cb95fb0acd5a9ded69287b3f652ab6732f 100644 (file)
@@ -118,7 +118,7 @@ sub cgi_signin ($$) { #{{{
                                validate => sub {
                                        my $name=shift;
                                        length $name &&
-                                       $name=~/$wiki_file_regexp/ &&
+                                       $name=~/$config{wiki_file_regexp}/ &&
                                        ! userinfo_get($name, "regdate");
                                },
                        );
index a2e2ff69c475444c6fc93a8357992822267b09c6..358f46948e526211276d2a54e1624b9d701b26aa 100644 (file)
@@ -169,6 +169,14 @@ sub rcs_notify () { #{{{
                error("REV is not set, not running from svn post-commit hook, cannot send notifications");
        }
        my $rev=int(possibly_foolish_untaint($ENV{REV}));
+       
+       my $user=`svnlook author $config{svnrepo} -r $rev`;
+       chomp $user;
+       my $message=`svnlook log $config{svnrepo} -r $rev`;
+       if ($message=~/$svn_webcommit/) {
+               $user="$1";
+               $message=$2;
+       }
 
        my @changed_pages;
        foreach my $change (`svnlook changed $config{svnrepo} -r $rev`) {
@@ -179,7 +187,7 @@ sub rcs_notify () { #{{{
        }
                
        require IkiWiki::UserInfo;
-       my @email_recipients=page_subscribers(@changed_pages);
+       my @email_recipients=commit_notify_list($user, @changed_pages);
        if (@email_recipients) {
                # TODO: if a commit spans multiple pages, this will send
                # subscribers a diff that might contain pages they did not
@@ -187,14 +195,6 @@ sub rcs_notify () { #{{{
                # reassemble into one mail with just the pages subscribed to.
                my $diff=`svnlook diff $config{svnrepo} -r $rev --no-diff-deleted`;
 
-               my $user=`svnlook author $config{svnrepo} -r $rev`;
-               chomp $user;
-               my $message=`svnlook log $config{svnrepo} -r $rev`;
-               if ($message=~/$svn_webcommit/) {
-                       $user="$1";
-                       $message=$2;
-               }
-               
                my $subject="$config{wikiname} update of ";
                if (@changed_pages > 2) {
                        $subject.="$changed_pages[0] $changed_pages[1] etc";
index b322b607e4c77e80e78a03c8434543401faa3f6f..bbcddb6162cfde668a8665ad498a78fcc4f9e5c7 100644 (file)
@@ -66,15 +66,19 @@ sub is_admin ($) { #{{{
        return grep { $_ eq $user_name } @{$config{adminuser}};
 } #}}}
 
-sub page_subscribers (@) { #{{{
+sub commit_notify_list ($@) { #{{{
+       my $committer=shift;
+       my @pages=@_;
+       
        my @ret;
        my $userinfo=userinfo_retrieve();
        foreach my $user (keys %{$userinfo}) {
+               next if $user eq $committer;
                if (exists $userinfo->{$user}->{subscriptions} &&
                    length $userinfo->{$user}->{subscriptions} &&
                    exists $userinfo->{$user}->{email} &&
                    length $userinfo->{$user}->{email} &&
-                   grep { globlist_match($_, $userinfo->{$user}->{subscriptions}) } @_) {
+                   grep { globlist_match($_, $userinfo->{$user}->{subscriptions}) } @pages) {
                        push @ret, $userinfo->{$user}->{email};
                }
        }