changelog_bot (changelog_bot) wrote in changelog,
changelog_bot
changelog_bot
changelog

[livejournal] r23267: LJSV-2441: Share notification from commu...

Committer: tnurutdinov
LJSV-2441: Share notification from community moderation queue for maintainers and owners
U   trunk/cgi-bin/ljprotocol.pl
Modified: trunk/cgi-bin/ljprotocol.pl
===================================================================
--- trunk/cgi-bin/ljprotocol.pl	2012-11-07 14:43:45 UTC (rev 23266)
+++ trunk/cgi-bin/ljprotocol.pl	2012-11-08 11:39:43 UTC (rev 23267)
@@ -2641,11 +2641,15 @@
                 return fail($err, 501);
             }
 
-            # alert moderator(s)
-            my $mods = LJ::load_rel_user($dbh, $ownerid, 'M') || [];
-            if (@$mods) {
+            # alert moderator(s), maintainers, owner
+            my $mods        = LJ::load_rel_user($dbh, $ownerid, 'M') || [];
+            my $mains       = LJ::load_rel_user($dbh, $ownerid, 'A') || [];
+            my $super       = LJ::load_rel_user($dbh, $ownerid, 'S') || [];
+            my %mail_list   = (map { $_ => 1 } (@$super, @$mods, @$mains));
+
+            if (%mail_list) {
                 # load up all these mods and figure out if they want email or not
-                my $modlist = LJ::load_userids(@$mods);
+                my $modlist = LJ::load_userids(keys %mail_list);
 
                 my @emails;
                 my $ct;
@@ -3225,11 +3229,15 @@
                     $suspicious_text .= "   - $suspicious_list->{$_}->{type} - $suspicious_list->{$_}->{url}\n";
                 }
 
-                # alert moderator(s)
-                my $mods = LJ::load_rel_user($dbh, $ownerid, 'M') || [];
-                if (@$mods) {
+                # alert moderator(s), maintainers, owner
+                my $mods        = LJ::load_rel_user($dbh, $ownerid, 'M') || [];
+                my $mains       = LJ::load_rel_user($dbh, $ownerid, 'A') || [];
+                my $super       = LJ::load_rel_user($dbh, $ownerid, 'S') || [];
+                my %mail_list   = (map { $_ => 1 } (@$super, @$mods, @$mains));
+
+                if (%mail_list) {
                     # load up all these mods and figure out if they want email or not
-                    my $modlist = LJ::load_userids(@$mods);
+                    my $modlist = LJ::load_userids(keys %mail_list);
 
                     my @emails;
                     my $ct;

Tags: livejournal, pl, tnurutdinov
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments