Henry Lyne (henrylyne) wrote in changelog,
Henry Lyne
henrylyne
changelog

[livejournal] r14757: LJSV-287 Return an error if someone trie...

Committer: henrylyne
LJSV-287 Return an error if someone tries to send a message to a deleted or expunged journal

U   trunk/bin/upgrading/en.dat
U   trunk/cgi-bin/LJ/Message.pm
Modified: trunk/bin/upgrading/en.dat
===================================================================
--- trunk/bin/upgrading/en.dat	2009-01-06 19:30:59 UTC (rev 14756)
+++ trunk/bin/upgrading/en.dat	2009-01-06 20:30:55 UTC (rev 14757)
@@ -1664,6 +1664,10 @@
 
 error.message.canreceive=This message cannot be sent to [[ljuser]] because the recipient has enabled the privacy options for their messages.
 
+error.message.deleted=This message cannot be sent to [[ljuser]] because the journal has been marked for deletion.
+
+error.message.expunged=This message cannot be sent to [[ljuser]] because the journal has been deleted.
+
 error.message.individual=Message can only be sent to individual users, not [[ljuser]].
 
 error.message.yourself=Stop trying to message yourself, we're not that kind of service.

Modified: trunk/cgi-bin/LJ/Message.pm
===================================================================
--- trunk/cgi-bin/LJ/Message.pm	2009-01-06 19:30:59 UTC (rev 14756)
+++ trunk/cgi-bin/LJ/Message.pm	2009-01-06 20:30:55 UTC (rev 14757)
@@ -379,6 +379,15 @@
         return 0;
     }
 
+    # Can not send to deleted or expunged journals
+    if ($ru->is_deleted || $ru->is_expunged) {
+        push @$errors,
+             $ru->is_deleted
+                ? BML::ml('error.message.deleted', { 'ljuser' => $ru->ljuser_display })
+                : BML::ml('error.message.expunged', { 'ljuser' => $ru->ljuser_display });
+        return 0;
+    }
+
     # Will target user accept messages from sender
     unless ($ru->can_receive_message($ou)) {
         push @$errors, BML::ml('error.message.canreceive', { 'ljuser' => $ru->ljuser_display });

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