]> git.mxchange.org Git - friendica.git/commitdiff
Add block reason editing in Model\Contact
authorHypolite Petovan <hypolite@mrpetovan.com>
Wed, 15 May 2019 23:28:00 +0000 (19:28 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Wed, 15 May 2019 23:28:00 +0000 (19:28 -0400)
src/Model/Contact.php

index 00a303a8b912cbc11febc51e47ebaba9d8064567..ce3aeac5608f357891ec14fb865c4f62541b13bd 100644 (file)
@@ -1670,13 +1670,13 @@ class Contact extends BaseObject
        /**
         * @brief Blocks a contact
         *
-        * @param int $uid
+        * @param int $cid
         * @return bool
         * @throws \Exception
         */
-       public static function block($uid)
+       public static function block($cid, $reason = null)
        {
-               $return = DBA::update('contact', ['blocked' => true], ['id' => $uid]);
+               $return = DBA::update('contact', ['blocked' => true, 'block_reason' => $reason], ['id' => $cid]);
 
                return $return;
        }
@@ -1684,13 +1684,13 @@ class Contact extends BaseObject
        /**
         * @brief Unblocks a contact
         *
-        * @param int $uid
+        * @param int $cid
         * @return bool
         * @throws \Exception
         */
-       public static function unblock($uid)
+       public static function unblock($cid)
        {
-               $return = DBA::update('contact', ['blocked' => false], ['id' => $uid]);
+               $return = DBA::update('contact', ['blocked' => false, 'block_reason' => null], ['id' => $cid]);
 
                return $return;
        }