]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/Profile.php
Shared cache key option for Geonames plugin, lets multi-instance sites share their...
[quix0rs-gnu-social.git] / classes / Profile.php
index 0322c935886028a09858653be49bd528fef71f8d..eded1ff71fcc84a2a4ec9c59dd16b9b73eafe703 100644 (file)
@@ -147,14 +147,16 @@ class Profile extends Memcached_DataObject
         return ($this->fullname) ? $this->fullname : $this->nickname;
     }
 
-    # Get latest notice on or before date; default now
-    function getCurrentNotice($dt=null)
+    /**
+     * Get the most recent notice posted by this user, if any.
+     *
+     * @return mixed Notice or null
+     */
+    function getCurrentNotice()
     {
         $notice = new Notice();
         $notice->profile_id = $this->id;
-        if ($dt) {
-            $notice->whereAdd('created < "' . $dt . '"');
-        }
+        // @fixme change this to sort on notice.id only when indexes are updated
         $notice->orderBy('created DESC, notice.id DESC');
         $notice->limit(1);
         if ($notice->find(true)) {
@@ -730,6 +732,9 @@ class Profile extends Memcached_DataObject
     function hasRight($right)
     {
         $result = false;
+        if ($this->hasRole(Profile_role::DELETED)) {
+            return false;
+        }
         if (Event::handle('UserRightsCheck', array($this, $right, &$result))) {
             switch ($right)
             {