]> git.mxchange.org Git - friendica.git/blobdiff - src/Model/Contact.php
Merge pull request #6726 from MrPetovan/task/6676-fix-implicit-mentions
[friendica.git] / src / Model / Contact.php
index 5f63d89d0f974243d6f2ea7de78212c8ce14e54e..6e83b76e6fe3024cb139fa7ccb9c6d4123a9f62b 100644 (file)
@@ -232,6 +232,11 @@ class Contact extends BaseObject
                }
 
                DBA::update('user-contact', ['blocked' => $blocked], ['cid' => $cdata['public'], 'uid' => $uid], true);
+
+               if ($blocked) {
+                       // Blocked contact can't be in any group
+                       self::removeFromGroups($cid);
+               }
        }
 
        /**
@@ -2220,4 +2225,9 @@ class Contact extends BaseObject
 
                return $redirect;
        }
+
+       public static function removeFromGroups($contact_id)
+       {
+               return DBA::delete('group_member', ['contact-id' => $contact_id]);
+       }
 }