Alexander Nazarov (nfokz) wrote in changelog,
Alexander Nazarov
nfokz
changelog

[livejournal] r21870: LJSUP-11985: Change LJ::ljuser() impleme...

Committer: anazarov
LJSUP-11985: Change LJ::ljuser() implementation
U   trunk/cgi-bin/LJ/User.pm
Modified: trunk/cgi-bin/LJ/User.pm
===================================================================
--- trunk/cgi-bin/LJ/User.pm	2012-05-03 07:39:37 UTC (rev 21869)
+++ trunk/cgi-bin/LJ/User.pm	2012-05-03 08:33:05 UTC (rev 21870)
@@ -8001,6 +8001,7 @@
     my ($u, $username, $journal_url, $striked);
     my ($journal_name, $journal, $userhead);
     my ($attrs, $color, $user_alias, %user);
+    my $identity;
     my $profile_url;
 
     if ( isu($user) ) {
@@ -8033,7 +8034,8 @@
 
             # Identity
             if ( $u->is_identity ) {
-                my $params = $u->identity->ljuser_display_params($u, $opts);
+                $identity  = $u->identity;
+                my $params = $identity->ljuser_display_params($u, $opts);
                 $profile_url  = $params->{'profile_url'};
                 $journal_url  = $params->{'journal_url'}  || $journal_url;
                 $journal_name = $params->{'journal_name'} || $journal_name;
@@ -8068,6 +8070,7 @@
         journal_url    => $journal_url,
         profile_url    => $profile_url,
         userhead_url   => $userhead,
+        is_identity    => $identity? 1 : 0,
     }};
 
     $user{'bold'}         = 1                      if $opts->{'bold'} or not exists $opts->{'bold'};
@@ -8114,7 +8117,7 @@
 } # ljuser2
 
 if ( not $LJ::DISABLED{'ljuser_templates'} ) {
-    if ( $ENV{'MOD_PERL'} ) {
+    unless ( $ENV{'MOD_PERL'} ) {
         # Sometimes we need style inlined
         # In emails, for example
         *ljuser = sub { ljuser2($_[0], { %{ $_[1] || {} }, inline_css => 1 }) };

Tags: anazarov, livejournal, nfokz, 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