some User -> Profile cleanup to help in adapting the profile page action to show stuff for remote users. Subscriptions, groups, roles, etc are all on profiles now so go ahead and use em.

This commit is contained in:
Brion Vibber
2010-11-15 15:32:57 -08:00
parent 227d4b6889
commit 0d0e51292d
4 changed files with 38 additions and 16 deletions

View File

@@ -473,6 +473,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();