holyandrew (holyandrew) wrote in changelog,
holyandrew
holyandrew
changelog

[livejournal] r22628: LJSUP-12608: Profile Redesign (DISABLED ...

Committer: akanashin
LJSUP-12608: Profile Redesign (DISABLED IN #95)
U   trunk/cgi-bin/LJ/User.pm
U   trunk/cgi-bin/ljprotocol.pl
Modified: trunk/cgi-bin/LJ/User.pm
===================================================================
--- trunk/cgi-bin/LJ/User.pm	2012-08-13 11:13:43 UTC (rev 22627)
+++ trunk/cgi-bin/LJ/User.pm	2012-08-13 12:07:07 UTC (rev 22628)
@@ -9106,6 +9106,16 @@
                                               ) unless $LJ::DISABLED{'friendchange-schwartz'};
 
             $sclient->insert_jobs(@jobs) if @jobs;
+
+            # For Profile
+            LJ::MemCache::incr($friender->user.'_count_friends');
+
+            LJ::MemCache::incr($friender->user.'_count_pfriends') if $friendee->is_person    || $friendee->is_shared || $friendee->is_identity;
+            LJ::MemCache::incr($friender->user.'_count_cfriends') if $friendee->is_community || $friendee->is_news;
+            LJ::MemCache::incr($friender->user.'_count_yfriends') if $friendee->is_syndicated;
+
+            LJ::MemCache::incr($friendee->user.'_count_friendof') if $friendee->{journaltype} eq 'P' || $friendee->{journaltype} eq 'I';
+            LJ::MemCache::incr($friendee->user.'_count_member')   if $friendee->{journaltype} eq 'C' || $friendee->{journaltype} eq 'S';
         }
     }
 
@@ -9159,6 +9169,16 @@
                                               ) unless $LJ::DISABLED{'friendchange-schwartz'};
  
             $sclient->insert_jobs(@jobs);
+
+            # For Profile
+            LJ::MemCache::decr($u->user.'_count_friends');
+
+            LJ::MemCache::decr($u->user.'_count_pfriends') if $friendee->is_person    || $friendee->is_shared || $friendee->is_identity;
+            LJ::MemCache::decr($u->user.'_count_cfriends') if $friendee->is_community || $friendee->is_news;
+            LJ::MemCache::decr($u->user.'_count_yfriends') if $friendee->is_syndicated;
+    
+            LJ::MemCache::decr($friendee->user.'_count_friendof') if $friendee->{journaltype} eq 'P' || $friendee->{journaltype} eq 'I';
+            LJ::MemCache::decr($friendee->user.'_count_member')   if $friendee->{journaltype} eq 'C' || $friendee->{journaltype} eq 'S';
         }
     }
 

Modified: trunk/cgi-bin/ljprotocol.pl
===================================================================
--- trunk/cgi-bin/ljprotocol.pl	2012-08-13 11:13:43 UTC (rev 22627)
+++ trunk/cgi-bin/ljprotocol.pl	2012-08-13 12:07:07 UTC (rev 22628)
@@ -4519,11 +4519,26 @@
             LJ::memcache_kill($friendid, 'friendofs2');
 
             if ($sclient && !$currently_is_friend && !$currently_is_banned) {
+
+                # For Profile
+                my $friender = LJ::load_userid($userid);
+                my $friendee = LJ::load_userid($friendid);
+
+                LJ::MemCache::incr($friender->user.'_count_friends');
+
+                LJ::MemCache::incr($friender->user.'_count_pfriends') if $friendee->is_person    || $friendee->is_shared || $friendee->is_identity;
+                LJ::MemCache::incr($friender->user.'_count_cfriends') if $friendee->is_community || $friendee->is_news;
+                LJ::MemCache::incr($friender->user.'_count_yfriends') if $friendee->is_syndicated;
+
+                LJ::MemCache::incr($friendee->user.'_count_friendof') if $friendee->{journaltype} eq 'P' || $friendee->{journaltype} eq 'I';
+                LJ::MemCache::incr($friendee->user.'_count_member')   if $friendee->{journaltype} eq 'C' || $friendee->{journaltype} eq 'S';
+ 
+
                 ## delay event to accumulate users activity
                 require LJ::Event::BefriendedDelayed;
                 LJ::Event::BefriendedDelayed->send(
-                                                    LJ::load_userid($friendid), ## to user
-                                                    LJ::load_userid($userid)    ## from user
+                                                    $friendee,  ## to user
+                                                    $friender   ## from user
                                                     );
                 my @jobs;
                 push @jobs, TheSchwartz::Job->new(

Tags: akanashin, holyandrew, livejournal, pl, 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