changelog_bot (changelog_bot) wrote in changelog,
changelog_bot
changelog_bot
changelog

[livejournal] r17651: LJSV-1279 Thread expander can't manage l...

Committer: dnikolaev
LJSV-1279 Thread expander can't manage long threads

U   trunk/cgi-bin/LJ/Talk.pm
U   trunk/htdocs/tools/endpoints/get_thread.bml
Modified: trunk/cgi-bin/LJ/Talk.pm
===================================================================
--- trunk/cgi-bin/LJ/Talk.pm	2010-11-09 08:25:37 UTC (rev 17650)
+++ trunk/cgi-bin/LJ/Talk.pm	2010-11-09 09:04:57 UTC (rev 17651)
@@ -2277,21 +2277,25 @@
         };
 
         my $html = {};
+        my $state;
 
         if ($post->{'state'} eq "D") ## LJSUP-6433
         {
+            $state = 'deleted';
             $html->{header} = $comment_header->();
             $html->{text}   = BML::ml('.deletedpost');
             $html->{footer} = $comment_footer->();
         }
         elsif ($post->{'state'} eq "S" && !$post->{'_loaded'} && !$post->{'_show'})
         {
+            $state = 'screened';
             $html->{header} = $comment_header->();
             $html->{text}   = BML::ml('.screenedpost');
             $html->{footer} = $comment_footer->();
         }
         elsif ($pu && $pu->is_suspended && !$viewsome)
         {
+            $state = 'suspended';
             $html->{header} = $comment_header->();
             $html->{footer} = $comment_footer->();
 
@@ -2322,6 +2326,7 @@
 
             if ($post->{'_loaded'})
             {
+                $state = 'expanded';
                 my $comment = LJ::Comment->new($u, dtalkid => $dtid);
 
                 my $edittime;
@@ -2556,6 +2561,8 @@
                 $html->{text} = $text;
             }
             else {
+                $state = 'collapsed';
+
                 # link to message
                 $LJci->{has_link} = 1;
                     
@@ -2585,6 +2592,7 @@
             thread => $dtid,
             depth  => $depth,
             html   => $html,
+            state  => $state,
         };
 
         if (!$input->{get_root_only} && $post->{'children'}) {

Modified: trunk/htdocs/tools/endpoints/get_thread.bml
===================================================================
--- trunk/htdocs/tools/endpoints/get_thread.bml	2010-11-09 08:25:37 UTC (rev 17650)
+++ trunk/htdocs/tools/endpoints/get_thread.bml	2010-11-09 09:04:57 UTC (rev 17651)
@@ -177,7 +177,14 @@
     BML::finish();
     BML::noparse();
 
-    return LJ::JSON->to_json( [ map { { thread => $_->{thread}, html => $_->{html}->{text} } } @$comments ] );
+    return LJ::JSON->to_json( [
+        map { {
+            thread => $_->{thread},
+            html   => $_->{html}->{text},
+            depth  => $_->{depth},
+            state  => $_->{state},
+        } } @$comments
+    ] );
 }
 
 _code?>

Tags: bml, changelog_bot, 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