]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/User.php
Merge branch '0.9.x' into 1.0.x
[quix0rs-gnu-social.git] / classes / User.php
index 022044aac117ba366d374937ff164964a2bd9de5..1c967b527b100b577d3cd6ea22e962a22295bc16 100644 (file)
@@ -48,11 +48,6 @@ class User extends Memcached_DataObject
     public $language;                        // varchar(50)
     public $timezone;                        // varchar(50)
     public $emailpost;                       // tinyint(1)   default_1
-    public $jabber;                          // varchar(255)  unique_key
-    public $jabbernotify;                    // tinyint(1)
-    public $jabberreplies;                   // tinyint(1)
-    public $jabbermicroid;                   // tinyint(1)   default_1
-    public $updatefrompresence;              // tinyint(1)
     public $sms;                             // varchar(64)  unique_key
     public $carrier;                         // int(4)
     public $smsnotify;                       // tinyint(1)
@@ -92,7 +87,7 @@ class User extends Memcached_DataObject
     function updateKeys(&$orig)
     {
         $parts = array();
-        foreach (array('nickname', 'email', 'jabber', 'incomingemail', 'sms', 'carrier', 'smsemail', 'language', 'timezone') as $k) {
+        foreach (array('nickname', 'email', 'incomingemail', 'sms', 'carrier', 'smsemail', 'language', 'timezone') as $k) {
             if (strcmp($this->$k, $orig->$k) != 0) {
                 $parts[] = $k . ' = ' . $this->_quote($this->$k);
             }
@@ -250,10 +245,6 @@ class User extends Memcached_DataObject
 
         $user->nickname = $nickname;
 
-        if (!empty($password)) { // may not have a password for OpenID users
-            $user->password = common_munge_password($password, $id);
-        }
-
         // Users who respond to invite email have proven their ownership of that address
 
         if (!empty($code)) {
@@ -286,6 +277,9 @@ class User extends Memcached_DataObject
 
             $user->id = $id;
             $user->uri = common_user_uri($user);
+            if (!empty($password)) { // may not have a password for OpenID users
+                $user->password = common_munge_password($password, $id);
+            }
 
             $result = $user->insert();
 
@@ -503,28 +497,22 @@ class User extends Memcached_DataObject
 
     function noticesWithFriends($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=null)
     {
-        $ids = Inbox::stream($this->id, $offset, $limit, $since_id, $before_id, $since, false);
-        return Notice::getStreamByIds($ids);
+        return Inbox::streamNotices($this->id, $offset, $limit, $since_id, $before_id, $since, false);
     }
 
     function noticeInbox($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=null)
     {
-        $ids = Inbox::stream($this->id, $offset, $limit, $since_id, $before_id, $since, true);
-        return Notice::getStreamByIds($ids);
+        return Inbox::streamNotices($this->id, $offset, $limit, $since_id, $before_id, $since, true);
     }
 
     function friendsTimeline($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=null)
     {
-        $ids = Inbox::stream($this->id, $offset, $limit, $since_id, $before_id, $since, false);
-
-        return Notice::getStreamByIds($ids);
+        return Inbox::streamNotices($this->id, $offset, $limit, $since_id, $before_id, $since, false);
     }
 
     function ownFriendsTimeline($offset=0, $limit=NOTICES_PER_PAGE, $since_id=0, $before_id=0, $since=null)
     {
-        $ids = Inbox::stream($this->id, $offset, $limit, $since_id, $before_id, $since, true);
-
-        return Notice::getStreamByIds($ids);
+        return Inbox::streamNotices($this->id, $offset, $limit, $since_id, $before_id, $since, true);
     }
 
     function blowFavesCache()
@@ -945,9 +933,9 @@ class User extends Memcached_DataObject
 
             $pr->orderBy('created');
 
-            $pr->limit(0, 1);
+            $pr->limit(1);
 
-            if ($pr->fetch($true)) {
+            if ($pr->find(true)) {
                 $owner = User::staticGet('id', $pr->profile_id);
             } else {
                 $owner = null;