From: Brion Vibber Date: Tue, 16 Nov 2010 01:36:48 +0000 (-0800) Subject: Merge branch 'master' of gitorious.org:statusnet/mainline into 0.9.x X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e4eb3b3dfd6b9b5cbd1b34d7fc4738b6fd19ee99;hp=-c;p=quix0rs-gnu-social.git Merge branch 'master' of gitorious.org:statusnet/mainline into 0.9.x --- e4eb3b3dfd6b9b5cbd1b34d7fc4738b6fd19ee99 diff --combined classes/Profile.php index d580e12355,b11cffc776..3ea95ab014 --- a/classes/Profile.php +++ b/classes/Profile.php @@@ -141,32 -141,11 +141,32 @@@ class Profile extends Memcached_DataObj return true; } + /** + * Gets either the full name (if filled) or the nickname. + * + * @return string + */ function getBestName() { return ($this->fullname) ? $this->fullname : $this->nickname; } + /** + * Gets the full name (if filled) with nickname as a parenthetical, or the nickname alone + * if no fullname is provided. + * + * @return string + */ + function getFancyName() + { + if ($this->fullname) { + // TRANS: Full name of a profile or group followed by nickname in parens + return sprintf(_m('FANCYNAME','%1$s (%2$s)'), $this->fullname, $this->nickname); + } else { + return $this->nickname; + } + } + /** * Get the most recent notice posted by this user, if any. * @@@ -494,6 -473,29 +494,29 @@@ 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();