mirror of
https://github.com/friendica/friendica
synced 2025-04-24 11:10:18 +00:00
Add block and unblock hooks
This commit is contained in:
parent
bd42f5757f
commit
66fec8944f
4 changed files with 74 additions and 2 deletions
|
@ -23,6 +23,7 @@ namespace Friendica\Model\Contact;
|
|||
|
||||
use Exception;
|
||||
use Friendica\Core\Logger;
|
||||
use Friendica\Core\Protocol;
|
||||
use Friendica\Core\System;
|
||||
use Friendica\Database\Database;
|
||||
use Friendica\Database\DBA;
|
||||
|
@ -145,6 +146,13 @@ class User
|
|||
return;
|
||||
}
|
||||
|
||||
$contact = Contact::getById($cdata['public']);
|
||||
if ($blocked) {
|
||||
Protocol::block($contact);
|
||||
} else {
|
||||
Protocol::unblock($contact);
|
||||
}
|
||||
|
||||
if ($cdata['user'] != 0) {
|
||||
DBA::update('contact', ['blocked' => $blocked], ['id' => $cdata['user'], 'pending' => false]);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue