Типа я (zilogic) wrote in changelog,
Типа я
zilogic
changelog

[livejournal] r19407: LJSV-1659: Need events for suspend/unsus...

Committer: amyshkin
LJSV-1659: Need events for suspend/unsuspend
U   trunk/cgi-bin/LJ/Console/Command/Suspend.pm
U   trunk/cgi-bin/LJ/Console/Command/Unsuspend.pm
Modified: trunk/cgi-bin/LJ/Console/Command/Suspend.pm
===================================================================
--- trunk/cgi-bin/LJ/Console/Command/Suspend.pm	2011-06-30 09:06:29 UTC (rev 19406)
+++ trunk/cgi-bin/LJ/Console/Command/Suspend.pm	2011-06-30 09:17:13 UTC (rev 19407)
@@ -35,15 +35,15 @@
         return $self->error("Invalid entry.")
             unless $entry->valid;
 
-        # LJSV-723: 
-        # It is currently not possible to suspend a user whose journal is deleted & purged, 
-        # or an entry left by a user whose journal is deleted & purged. 
-        # However, entries made to communities and comments left in other journals by a deleted & purged journal still appear, 
-        # and it is sometimes necessary to disable access to these. 
+        # LJSV-723:
+        # It is currently not possible to suspend a user whose journal is deleted & purged,
+        # or an entry left by a user whose journal is deleted & purged.
+        # However, entries made to communities and comments left in other journals by a deleted & purged journal still appear,
+        # and it is sometimes necessary to disable access to these.
         # Suspend functionality should be changed to allow Abuse to disable access to these journals & content.
-        # 
+        #
         # So do not check $poster status.
-        # 
+        #
         return $self->error("Journal is purged; cannot suspend entry.")
             if $journal->is_expunged;
 
@@ -58,6 +58,8 @@
         LJ::statushistory_add($poster, $remote, "suspend", $reason)
             unless $journal->equals($poster);
 
+        LJ::run_hooks('editpost', $entry,);
+
         return $self->print("Entry " . $entry->url . " suspended.");
     }
 
@@ -103,7 +105,7 @@
         }
 
         my $err;
-        $self->error($err) 
+        $self->error($err)
             unless $u->set_suspended($remote, $reason, \$err);
 
         my $job = TheSchwartz::Job->new_from_array("LJ::Worker::MarkSuspendedEntries::mark", { userid => $u->userid });

Modified: trunk/cgi-bin/LJ/Console/Command/Unsuspend.pm
===================================================================
--- trunk/cgi-bin/LJ/Console/Command/Unsuspend.pm	2011-06-30 09:06:29 UTC (rev 19406)
+++ trunk/cgi-bin/LJ/Console/Command/Unsuspend.pm	2011-06-30 09:17:13 UTC (rev 19407)
@@ -62,6 +62,8 @@
         LJ::statushistory_add($poster, $remote, "unsuspend", $reason)
             unless $journal->equals($poster);
 
+        LJ::run_hooks('editpost', $entry);
+
         return $self->print("Entry " . $entry->url . " unsuspended.");
     }
 

Tags: livejournal, pm, zilogic
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