mirror of
https://github.com/friendica/friendica
synced 2024-11-19 12:23:40 +00:00
Add contact removal from all groups when blocked
This commit is contained in:
parent
7e499647e3
commit
b939faf4ef
1 changed files with 10 additions and 0 deletions
|
@ -232,6 +232,11 @@ class Contact extends BaseObject
|
||||||
}
|
}
|
||||||
|
|
||||||
DBA::update('user-contact', ['blocked' => $blocked], ['cid' => $cdata['public'], 'uid' => $uid], true);
|
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;
|
return $redirect;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function removeFromGroups($contact_id)
|
||||||
|
{
|
||||||
|
return DBA::delete('group_member', ['contact-id' => $contact_id]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue