Андрей (andy) wrote in changelog,
Андрей
andy
changelog

[livejournal] r20522: LJSV-1907 (Users with paid and perm acco...

Committer: ailyin
LJSV-1907 (Users with paid and perm accounts don't recieve full text of private messages from inbox via email)
U   trunk/bin/upgrading/en.dat
U   trunk/cgi-bin/LJ/Event/UserMessageRecvd.pm
Modified: trunk/bin/upgrading/en.dat
===================================================================
--- trunk/bin/upgrading/en.dat	2011-11-10 04:32:56 UTC (rev 20521)
+++ trunk/bin/upgrading/en.dat	2011-11-10 07:33:16 UTC (rev 20522)
@@ -1771,6 +1771,19 @@
 esn.edit_groups|staleness=1
 esn.edit_groups=[[openlink]]Edit Friends groups[[closelink]]
 
+esn.email.pm|staleness=1
+esn.email.pm<<
+Hi [[user]],
+
+[[sender]] sent you a message on [[sitenameshort]]: [[subject]].
+The message was:
+[[body]]
+
+Go to [[inbox]] to view your new messages.
+
+Or you can:
+.
+
 esn.email.pm.subject|staleness=1
 esn.email.pm.subject=[[sender]] sent you a message
 
@@ -2303,6 +2316,9 @@
 esn.reply_at_webpage|staleness=1
 esn.reply_at_webpage=[[openlink]]Reply[[closelink]] at the webpage
 
+esn.reply_message|staleness=1
+esn.reply_message=[[openlink]]Reply to message[[closelink]]
+
 esn.screened|staleness=1
 esn.screened=This comment was screened.
 

Modified: trunk/cgi-bin/LJ/Event/UserMessageRecvd.pm
===================================================================
--- trunk/cgi-bin/LJ/Event/UserMessageRecvd.pm	2011-11-10 04:32:56 UTC (rev 20521)
+++ trunk/cgi-bin/LJ/Event/UserMessageRecvd.pm	2011-11-10 07:33:16 UTC (rev 20522)
@@ -42,19 +42,29 @@
     my $vars = {
         user            => $is_html ? ($u->ljuser_display) : ($u->user),
         subject         => $msg->subject,
-        body            => $msg->body,
         sender          => $is_html ? ($other_u->ljuser_display) : ($other_u->user),
         postername      => $other_u->user,
         sitenameshort   => $LJ::SITENAMESHORT,
         inbox           => $inbox,
+        siteroot        => $LJ::SITEROOT,
     };
 
-    my $body = LJ::Lang::get_text($lang, 'esn.email.pm_without_body', undef, $vars) .
+    my $reply_lnk = "$LJ::SITEROOT/inbox/compose.bml?mode=reply&msgid=$msgid";
+
+    my $ml_var = 'esn.email.pm_without_body';
+    if ( $u->get_cap('full_pm_esn') ) {
+        # paid users receive full texts of messages
+        $ml_var = 'esn.email.pm';
+        $vars->{'body'} = $msg->body;
+    }
+
+    my $body = LJ::Lang::get_text($lang, $ml_var, undef, $vars) .
         $self->format_options($is_html, $lang, $vars,
         {
-            'esn.view_profile'    => [ 1, $other_u->profile_url ],
-            'esn.read_journal'    => [ 2, $other_u->journal_base ],
-            'esn.add_friend'      => [ $u->is_friend($other_u) ? 0 : 3,
+            'esn.reply_message'   => [ 1, $reply_lnk ],
+            'esn.view_profile'    => [ 2, $other_u->profile_url ],
+            'esn.read_journal'    => [ 3, $other_u->journal_base ],
+            'esn.add_friend'      => [ $u->is_friend($other_u) ? 0 : 4,
                                             "$LJ::SITEROOT/friends/add.bml?user=$sender" ],
         }
     );

Tags: ailyin, andy, dat, livejournal, pm
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