]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/Foreign_link.php
trac750 configurable sync flags for Facebook app (noticesync, replysync)
[quix0rs-gnu-social.git] / classes / Foreign_link.php
index c89124d19c59ce84839e09a3ea6f1b2d0b724030..afc0e2180455644130c757e351303f23c6538e5e 100644 (file)
@@ -57,6 +57,29 @@ class Foreign_link extends Memcached_DataObject
         return null;
     }
 
+    function set_flags($noticesync, $replysync, $friendsync)
+    {
+        if ($noticesync) {
+            $this->noticesync |= FOREIGN_NOTICE_SEND;
+        } else {
+            $this->noticesync &= ~FOREIGN_NOTICE_SEND;
+        }
+
+        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()
     {