]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
use Subscription::cancel() to cancel all subscriptions on block
authorEvan Prodromou <evan@status.net>
Wed, 31 Mar 2010 19:20:16 +0000 (15:20 -0400)
committerEvan Prodromou <evan@status.net>
Wed, 31 Mar 2010 19:20:16 +0000 (15:20 -0400)
classes/User.php

index 659ec9467b68b7a7cf880db07696d3e00e28acc4..2c256301c2f2d94a1cc36f4b079e9dd71b4352fc 100644 (file)
@@ -525,8 +525,8 @@ class User extends Memcached_DataObject
             common_log(LOG_WARNING,
                 sprintf(
                     "Profile ID %d (%s) tried to block his or herself.",
-                    $profile->id,
-                    $profile->nickname
+                    $this->id,
+                    $this->nickname
                 )
             );
             return false;
@@ -548,13 +548,7 @@ class User extends Memcached_DataObject
             return false;
         }
 
-        // Cancel their subscription, if it exists
-
-        $otherUser = User::staticGet('id', $other->id);
-
-        if (!empty($otherUser)) {
-            subs_unsubscribe_to($otherUser, $this->getProfile());
-        }
+        Subscription::cancel($other, $this->getProfile());
 
         $block->query('COMMIT');