From: Hypolite Petovan Date: Fri, 1 Dec 2017 05:41:26 +0000 (-0500) Subject: Add block/unblock methods to Contact class X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=5fd4086fdcc7725dc2eddaf631b4819e84dfb61b;p=friendica.git Add block/unblock methods to Contact class --- diff --git a/src/Object/Contact.php b/src/Object/Contact.php index 919113672e..1aee2c2b57 100644 --- a/src/Object/Contact.php +++ b/src/Object/Contact.php @@ -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; + } }