wisest owl (wisest_owl) wrote in changelog,
wisest owl
wisest_owl
changelog

[livejournal] r17468: LJSUP-7004. Need to change the text in s...

Committer: gprochaev
LJSUP-7004. Need to change the text in sms

U   trunk/bin/upgrading/en.dat
U   trunk/cgi-bin/LJ/Event/CommentReply.pm
U   trunk/cgi-bin/LJ/Event/JournalNewComment.pm
Modified: trunk/bin/upgrading/en.dat
===================================================================
--- trunk/bin/upgrading/en.dat	2010-09-29 10:14:02 UTC (rev 17467)
+++ trunk/bin/upgrading/en.dat	2010-09-30 02:37:28 UTC (rev 17468)
@@ -4305,6 +4305,22 @@
 
 sms.journalnewcomment.replied_a_post=[[user]] replied to a post
 
+sms.communityentryreply.edit_reply_your_comment=[[user]] edited a reply to your comment
+
+sms.communityentryreply.edit_reply_a_comment=[[user]] edited a reply to a comment
+
+sms.communityentryreply.replied_your_comment=[[user]] replied to your comment
+
+sms.communityentryreply.replied_a_comment=[[user]] replied to a comment
+
+sms.communityentryreply.edit_reply_your_post=[[user]] edited a reply to your post in community [[community]]
+
+sms.communityentryreply.edit_reply_a_post=[[user]] edited a reply to a post in community [[community]]
+
+sms.communityentryreply.replied_your_post=[[user]] replied to your post in community [[community]]
+
+sms.communityentryreply.replied_a_post=[[user]] replied to a post in community [[community]]
+
 Sorry|notes=typically used to announce that the requested action can't be done.
 Sorry=Sorry
 

Modified: trunk/cgi-bin/LJ/Event/CommentReply.pm
===================================================================
--- trunk/cgi-bin/LJ/Event/CommentReply.pm	2010-09-29 10:14:02 UTC (rev 17467)
+++ trunk/cgi-bin/LJ/Event/CommentReply.pm	2010-09-30 02:37:28 UTC (rev 17468)
@@ -14,4 +14,40 @@
 
 sub is_tracking { 0 }
 
+sub as_sms {
+    my ($self, $u) = @_;
+
+    my $user = $self->comment->poster ? $self->comment->poster->display_username : '(Anonymous user)';
+    my $edited = $self->comment->is_edited;
+
+    my $msg;
+
+    my $lang = $self->comment->poster ? $self->comment->poster->prop('browselang') : $LJ::DEFAULT_LANG;
+    if ($self->comment->parent) {
+        if ($edited) {
+            $msg = LJ::u_equals($self->comment->parent->poster, $u)
+                    ? LJ::Lang::get_text($lang, 'sms.commentreply.edit_reply_your_comment', undef, { user => $user } )
+                    : LJ::Lang::get_text($lang, 'sms.commentreply.edit_reply_a_comment', undef, { user => $user } );
+        } else {
+            $msg = LJ::u_equals($self->comment->parent->poster, $u)
+                    ? LJ::Lang::get_text($lang, 'sms.commentreply.replied_your_comment', undef, { user => $user } )
+                    : LJ::Lang::get_text($lang, 'sms.commentreply.replied_a_comment', undef, { user => $user } );
+        }
+    } else {
+        if ($edited) {
+            $msg = LJ::u_equals($self->comment->entry->poster, $u)
+                    ? LJ::Lang::get_text($lang, 'sms.commentreply.edit_reply_your_post', undef, { user => $user } )
+                    : LJ::Lang::get_text($lang, 'sms.commentreply.edit_reply_a_post', undef, { user => $user } );
+        } else {
+            $msg = LJ::u_equals($self->comment->entry->poster, $u)
+                    ? LJ::Lang::get_text($lang, 'sms.commentreply.replied_your_post', undef, { user => $user } )
+                    : LJ::Lang::get_text($lang, 'sms.commentreply.replied_a_post', undef, { user => $user } );
+        }
+    }
+
+    my $tinyurl = LJ::API::BitLy->shorten($self->comment->url);
+    return undef if $tinyurl =~ /^500/;
+    return $msg . " " . $tinyurl; 
+}
+
 1;

Modified: trunk/cgi-bin/LJ/Event/JournalNewComment.pm
===================================================================
--- trunk/cgi-bin/LJ/Event/JournalNewComment.pm	2010-09-29 10:14:02 UTC (rev 17467)
+++ trunk/cgi-bin/LJ/Event/JournalNewComment.pm	2010-09-30 02:37:28 UTC (rev 17468)
@@ -226,25 +226,49 @@
     my $msg;
 
     my $lang = $self->comment->poster ? $self->comment->poster->prop('browselang') : $LJ::DEFAULT_LANG;
-    if ($self->comment->parent) {
-        if ($edited) {
-            $msg = LJ::u_equals($self->comment->parent->poster, $u)
-                    ? LJ::Lang::get_text($lang, 'sms.journalnewcomment.edit_reply_your_comment', undef, { user => $user } )
-                    : LJ::Lang::get_text($lang, 'sms.journalnewcomment.edit_reply_a_comment', undef, { user => $user } );
+    if ($self->event_journal->journaltype eq 'C') {
+        if ($self->comment->parent) {
+            if ($edited) {
+                $msg = LJ::u_equals($self->comment->parent->poster, $u)
+                        ? LJ::Lang::get_text($lang, 'sms.communityentryreply.edit_reply_your_comment', undef, { user => $user, community => $self->event_journal->user } )
+                        : LJ::Lang::get_text($lang, 'sms.communityentryreply.edit_reply_a_comment', undef, { user => $user, community => $self->event_journal->user } );
+            } else {
+                $msg = LJ::u_equals($self->comment->parent->poster, $u)
+                        ? LJ::Lang::get_text($lang, 'sms.communityentryreply.replied_your_comment', undef, { user => $user, community => $self->event_journal->user } )
+                        : LJ::Lang::get_text($lang, 'sms.communityentryreply.replied_a_comment', undef, { user => $user, community => $self->event_journal->user } );
+            }
         } else {
-            $msg = LJ::u_equals($self->comment->parent->poster, $u)
-                    ? LJ::Lang::get_text($lang, 'sms.journalnewcomment.replied_your_comment', undef, { user => $user } )
-                    : LJ::Lang::get_text($lang, 'sms.journalnewcomment.replied_a_comment', undef, { user => $user } );
+            if ($edited) {
+                $msg = LJ::u_equals($self->comment->entry->poster, $u)
+                        ? LJ::Lang::get_text($lang, 'sms.communityentryreply.edit_reply_your_post', undef, { user => $user, community => $self->event_journal->user } )
+                        : LJ::Lang::get_text($lang, 'sms.communityentryreply.edit_reply_a_post', undef, { user => $user, community => $self->event_journal->user } );
+            } else {
+                $msg = LJ::u_equals($self->comment->entry->poster, $u)
+                        ? LJ::Lang::get_text($lang, 'sms.communityentryreply.replied_your_post', undef, { user => $user, community => $self->event_journal->user } )
+                        : LJ::Lang::get_text($lang, 'sms.communityentryreply.replied_a_post', undef, { user => $user, community => $self->event_journal->user } );
+            }
         }
     } else {
-        if ($edited) {
-            $msg = LJ::u_equals($self->comment->entry->poster, $u)
-                    ? LJ::Lang::get_text($lang, 'sms.journalnewcomment.edit_reply_your_post', undef, { user => $user } )
-                    : LJ::Lang::get_text($lang, 'sms.journalnewcomment.edit_reply_a_post', undef, { user => $user } );
+        if ($self->comment->parent) {
+            if ($edited) {
+                $msg = LJ::u_equals($self->comment->parent->poster, $u)
+                        ? LJ::Lang::get_text($lang, 'sms.journalnewcomment.edit_reply_your_comment', undef, { user => $user } )
+                        : LJ::Lang::get_text($lang, 'sms.journalnewcomment.edit_reply_a_comment', undef, { user => $user } );
+            } else {
+                $msg = LJ::u_equals($self->comment->parent->poster, $u)
+                        ? LJ::Lang::get_text($lang, 'sms.journalnewcomment.replied_your_comment', undef, { user => $user } )
+                        : LJ::Lang::get_text($lang, 'sms.journalnewcomment.replied_a_comment', undef, { user => $user } );
+            }
         } else {
-            $msg = LJ::u_equals($self->comment->entry->poster, $u)
-                    ? LJ::Lang::get_text($lang, 'sms.journalnewcomment.replied_your_post', undef, { user => $user } )
-                    : LJ::Lang::get_text($lang, 'sms.journalnewcomment.replied_a_post', undef, { user => $user } );
+            if ($edited) {
+                $msg = LJ::u_equals($self->comment->entry->poster, $u)
+                        ? LJ::Lang::get_text($lang, 'sms.journalnewcomment.edit_reply_your_post', undef, { user => $user } )
+                        : LJ::Lang::get_text($lang, 'sms.journalnewcomment.edit_reply_a_post', undef, { user => $user } );
+            } else {
+                $msg = LJ::u_equals($self->comment->entry->poster, $u)
+                        ? LJ::Lang::get_text($lang, 'sms.journalnewcomment.replied_your_post', undef, { user => $user } )
+                        : LJ::Lang::get_text($lang, 'sms.journalnewcomment.replied_a_post', undef, { user => $user } );
+            }
         }
     }
 

Tags: dat, livejournal, pm, wisest-owl
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