Add block and unblock hooks

This commit is contained in:
Hypolite Petovan 2021-10-02 16:00:06 -04:00
parent bd42f5757f
commit 66fec8944f
4 changed files with 74 additions and 2 deletions

View file

@ -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]);
}