diff options
author | Sarven Capadisli <csarven@status.net> | 2010-02-19 14:22:25 +0100 |
---|---|---|
committer | Sarven Capadisli <csarven@status.net> | 2010-02-19 14:22:25 +0100 |
commit | 2c09702b2df4a6ede7fef4b7f1d7c1bcc77a4649 (patch) | |
tree | 29652d3e0839404eb864f575bf44ab75ae3a4fdc /classes/User.php | |
parent | 8d59f7cc9d7f9f12d46530db2d9efe0b7aaac1a5 (diff) | |
parent | 52e8aa798a23b2832a748189b42c3bc77d65c9c7 (diff) |
Merge branch 'testing' of git@gitorious.org:statusnet/mainline into testing
Diffstat (limited to 'classes/User.php')
-rw-r--r-- | classes/User.php | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/classes/User.php b/classes/User.php index 72c3f39e9..10b1f4865 100644 --- a/classes/User.php +++ b/classes/User.php @@ -80,11 +80,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. @@ -167,17 +163,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); } /** |