changelog_bot (changelog_bot) wrote in changelog,
changelog_bot
changelog_bot
changelog

[ljcom] r9619: LJSUP-6481 Algorithm of showing thread e...

Committer: dnikolaev
LJSUP-6481 Algorithm of showing thread expander updated.

U   trunk/cgi-bin/LJ/Hooks/SUP.pm
Modified: trunk/cgi-bin/LJ/Hooks/SUP.pm
===================================================================
--- trunk/cgi-bin/LJ/Hooks/SUP.pm	2010-10-14 05:02:55 UTC (rev 9618)
+++ trunk/cgi-bin/LJ/Hooks/SUP.pm	2010-10-14 05:24:06 UTC (rev 9619)
@@ -690,24 +690,26 @@
     
     if ($args && $args->{is_s1}) {
         return undef if $LJ::DISABLED{thread_expander};
+
         my $who = (LJ::SUP->is_remote_sup() ? 'sup' : 'nonsup');
 
-        my $func;
+        my $use_new = 0;
         if (ref($LJ::DISABLED{thread_expander_new}) eq 'HASH') {
-            $func = $LJ::DISABLED{thread_expander_new}->{$who} ?
-                    $thread_expander_old :
-                    $thread_expander_new;
+            $use_new = $LJ::DISABLED{thread_expander_new}->{$who} ? 0 : 1;
         } else {
-            $func = $LJ::DISABLED{thread_expander_new} ?
-                    $thread_expander_old :
-                    $thread_expander_new;
+            $use_new = $LJ::DISABLED{thread_expander_new} ? 0 : 1;
         }
-        
-        my $u = LJ::load_userid(LJ::Request->notes("journalid"));
-        return $func if $u && $u->get_cap('thread_expander');
-        my $remote = LJ::get_remote();
-        return $func if $remote && $remote->get_cap('thread_expander');
-        return undef;
+
+        if ($use_new) {
+            return $thread_expander_new;
+        } else {
+            my $u = LJ::load_userid(LJ::Request->notes("journalid"));
+            unless ($u && $u->get_cap('thread_expander')) {
+                my $remote = LJ::get_remote();
+                return undef unless ($remote && $remote->get_cap('thread_expander'));
+            }
+            return $thread_expander_old;
+        }
     }
     else {
         return 0 if $LJ::DISABLED{thread_expander};

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