]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/Foreign_link.php
Merge branch '0.8.x' of git://gitorious.org/laconica/dev into 0.8.x
[quix0rs-gnu-social.git] / classes / Foreign_link.php
index c89124d19c59ce84839e09a3ea6f1b2d0b724030..6065609512ce76e8461a3952b910e18cb94c50e1 100644 (file)
@@ -17,6 +17,8 @@ class Foreign_link extends Memcached_DataObject
     public $noticesync;                      // tinyint(1)   not_null default_1
     public $friendsync;                      // tinyint(1)   not_null default_2
     public $profilesync;                     // tinyint(1)   not_null default_1
+    public $last_noticesync;                 // datetime()
+    public $last_friendsync;                 // datetime()
     public $created;                         // datetime()   not_null
     public $modified;                        // timestamp()   not_null default_CURRENT_TIMESTAMP
 
@@ -57,6 +59,35 @@ class Foreign_link extends Memcached_DataObject
         return null;
     }
 
+    function set_flags($noticesend, $noticerecv, $replysync, $friendsync)
+    {
+        if ($noticesend) {
+            $this->noticesync |= FOREIGN_NOTICE_SEND;
+        } else {
+            $this->noticesync &= ~FOREIGN_NOTICE_SEND;
+        }
+        
+        if ($noticerecv) {
+            $this->noticesync |= FOREIGN_NOTICE_RECV;
+        } else {
+            $this->noticesync &= ~FOREIGN_NOTICE_RECV;
+        }
+
+        if ($replysync) {
+            $this->noticesync |= FOREIGN_NOTICE_SEND_REPLY;
+        } else {
+            $this->noticesync &= ~FOREIGN_NOTICE_SEND_REPLY;
+        }
+
+        if ($friendsync) {
+            $this->friendsync |= FOREIGN_FRIEND_RECV;
+        } else {
+            $this->friendsync &= ~FOREIGN_FRIEND_RECV;
+        }
+
+        $this->profilesync = 0;
+    }
+
     # Convenience methods
     function getForeignUser()
     {