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

[livejournal] r18240: LJSUP-7594. Not save 0 number of subs.

Committer: gprochaev
LJSUP-7594. Not save 0 number of subs.

U   trunk/cgi-bin/LJ/User.pm
Modified: trunk/cgi-bin/LJ/User.pm
===================================================================
--- trunk/cgi-bin/LJ/User.pm	2011-02-09 03:28:26 UTC (rev 18239)
+++ trunk/cgi-bin/LJ/User.pm	2011-02-09 03:33:14 UTC (rev 18240)
@@ -3564,7 +3564,9 @@
     ## Logging for delete all subscriptions
     my $remote = LJ::get_remote();
     my $admin = $remote || LJ::load_user('system');
-    LJ::statushistory_add ( $u, $admin, 'remove_subs', scalar $u->subscriptions );
+    my $subs_number = scalar $u->subscriptions;
+    LJ::statushistory_add ( $u, $admin, 'remove_subs', $subs_number )
+        if $subs_number;
 
     return LJ::Subscription->delete_all_subs($u);
 }
@@ -3579,7 +3581,9 @@
     my $admin = $remote || LJ::load_user('system');
     my $set = LJ::Subscription::GroupSet->fetch_for_user($u);
     my @inactive_groups = grep { !$_->active } $set->groups;
-    LJ::statushistory_add ( $u, $admin, 'remove_subs', scalar @inactive_groups );
+    my $subs_number = scalar @inactive_groups;
+    LJ::statushistory_add ( $u, $admin, 'remove_subs', $subs_number )
+        if $subs_number;
 
     return LJ::Subscription->delete_all_inactive_subs($u, $dryrun);
 }

Tags: 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