X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/b6e6a2154d8be7da67dd6adc371100129fd1f752..849f65a3437391562b88fef9c450d0931676342f:/IkiWiki/UserInfo.pm?ds=inline diff --git a/IkiWiki/UserInfo.pm b/IkiWiki/UserInfo.pm index 99b3c9f0a..cfc27609d 100644 --- a/IkiWiki/UserInfo.pm +++ b/IkiWiki/UserInfo.pm @@ -11,7 +11,7 @@ sub userinfo_retrieve () { #{{{ my $userinfo=eval{ Storable::lock_retrieve("$config{wikistatedir}/userdb") }; return $userinfo; } #}}} - + sub userinfo_store ($) { #{{{ my $userinfo=shift; @@ -94,12 +94,8 @@ sub set_banned_users (@) { #{{{ sub commit_notify_list ($@) { #{{{ my $committer=shift; - - my @pages; - foreach my $file (@_) { - push @pages, grep { $pagesources{$_} eq $file } keys %pagesources; - } - + my @pages = map pagename($_), @_; + my @ret; my $userinfo=userinfo_retrieve(); foreach my $user (keys %{$userinfo}) { @@ -108,7 +104,10 @@ sub commit_notify_list ($@) { #{{{ length $userinfo->{$user}->{subscriptions} && exists $userinfo->{$user}->{email} && length $userinfo->{$user}->{email} && - grep { pagespec_match($_, $userinfo->{$user}->{subscriptions}, "") } @pages) { + grep { pagespec_match($_, + $userinfo->{$user}->{subscriptions}, + user => $committer) } + map pagename($_), @_) { push @ret, $userinfo->{$user}->{email}; } } @@ -157,7 +156,6 @@ sub send_commit_mails ($$$@) { #{{{ # Daemonize, in case the mail sending takes a while. defined(my $pid = fork) or error("Can't fork: $!"); return if $pid; - eval q{use POSIX 'setsid'}; setsid() or error("Can't start a new session: $!"); chdir '/'; open STDIN, '/dev/null';