]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/User.php
Merge branch '0.9.x' into 1.0.x
[quix0rs-gnu-social.git] / classes / User.php
index 1c967b527b100b577d3cd6ea22e962a22295bc16..0f84ed8133ba580a1ea0f19b794cb2f6cdab1247 100644 (file)
@@ -75,11 +75,7 @@ class User extends Memcached_DataObject
 
     function isSubscribed($other)
     {
-        assert(!is_null($other));
-        // XXX: cache results of this query
-        $sub = Subscription::pkeyGet(array('subscriber' => $this->id,
-                                           'subscribed' => $other->id));
-        return (is_null($sub)) ? false : true;
+        return Subscription::exists($this->getProfile(), $other);
     }
 
     // 'update' won't write key columns, so we have to do it ourselves.
@@ -162,17 +158,8 @@ class User extends Memcached_DataObject
 
     function hasBlocked($other)
     {
-
-        $block = Profile_block::get($this->id, $other->id);
-
-        if (is_null($block)) {
-            $result = false;
-        } else {
-            $result = true;
-            $block->free();
-        }
-
-        return $result;
+        $profile = $this->getProfile();
+        return $profile->hasBlocked($other);
     }
 
     /**