]> git.mxchange.org Git - friendica.git/commitdiff
Add block/unblock methods to Contact class
authorHypolite Petovan <mrpetovan@gmail.com>
Fri, 1 Dec 2017 05:41:26 +0000 (00:41 -0500)
committerHypolite Petovan <mrpetovan@gmail.com>
Fri, 1 Dec 2017 05:41:26 +0000 (00:41 -0500)
src/Object/Contact.php

index 919113672e18c6f60ac4109e01ca3a1960ea4e73..1aee2c2b57fcc18092e82a69124ad0b71cb16a75 100644 (file)
@@ -821,4 +821,30 @@ class Contact extends BaseObject
 
                return $account_type;
        }
+
+       /**
+        * @brief Blocks a contact
+        *
+        * @param int $uid
+        * @return bool
+        */
+       public static function block($uid)
+       {
+               $return = dba::update('contact', ['blocked' => true], ['id' => $uid]);
+
+               return $return;
+       }
+
+       /**
+        * @brief Unblocks a contact
+        *
+        * @param int $uid
+        * @return bool
+        */
+       public static function unblock($uid)
+       {
+               $return = dba::update('contact', ['blocked' => false], ['id' => $uid]);
+
+               return $return;
+       }
 }