]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge branch 'master' of gitorious.org:statusnet/mainline into 0.9.x
authorBrion Vibber <brion@pobox.com>
Tue, 16 Nov 2010 01:36:48 +0000 (17:36 -0800)
committerBrion Vibber <brion@pobox.com>
Tue, 16 Nov 2010 01:36:48 +0000 (17:36 -0800)
1  2 
classes/Profile.php

diff --combined classes/Profile.php
index d580e12355a2e09fe3586b2f7a97210c9848ea3f,b11cffc776cc496d24d5396f454d2e40aea416f5..3ea95ab014e7aa0fb66284cb9aa0ce4bb40cf62d
@@@ -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.
       *
          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();