diff options
Diffstat (limited to 'classes')
-rw-r--r-- | classes/Profile.php | 23 | ||||
-rw-r--r-- | classes/User.php | 7 |
2 files changed, 27 insertions, 3 deletions
diff --git a/classes/Profile.php b/classes/Profile.php index d580e1235..3ea95ab01 100644 --- a/classes/Profile.php +++ b/classes/Profile.php @@ -494,6 +494,29 @@ class Profile extends Memcached_DataObject return $cnt; } + /** + * Is this profile subscribed to another profile? + * + * @param Profile $other + * @return boolean + */ + function isSubscribed($other) + { + return Subscription::exists($this, $other); + } + + /** + * Are these two profiles subscribed to each other? + * + * @param Profile $other + * @return boolean + */ + function mutuallySubscribed($other) + { + return $this->isSubscribed($other) && + $other->isSubscribed($this); + } + function hasFave($notice) { $cache = common_memcache(); diff --git a/classes/User.php b/classes/User.php index 7345dc7f9..964bc3e7f 100644 --- a/classes/User.php +++ b/classes/User.php @@ -84,7 +84,8 @@ class User extends Memcached_DataObject function isSubscribed($other) { - return Subscription::exists($this->getProfile(), $other); + $profile = $this->getProfile(); + return $profile->isSubscribed($other); } // 'update' won't write key columns, so we have to do it ourselves. @@ -418,8 +419,8 @@ class User extends Memcached_DataObject function mutuallySubscribed($other) { - return $this->isSubscribed($other) && - $other->isSubscribed($this); + $profile = $this->getProfile(); + return $profile->mutuallySubscribed($other); } function mutuallySubscribedUsers() |