- This was breaking the synchronisation between the contact and user-contact tables
public static function removeFollower(array $contact)
{
if (in_array($contact['rel'] ?? [], [self::FRIEND, self::SHARING])) {
- DBA::update('contact', ['rel' => self::SHARING], ['id' => $contact['id']]);
+ self::update(['rel' => self::SHARING], ['id' => $contact['id']]);
} elseif (!empty($contact['id'])) {
self::remove($contact['id']);
} else {
// It is deactivated by now, due to side effects. See issue https://github.com/friendica/friendica/pull/4033
// It is not removed by now. Possibly the code is needed?
//if (!$is_comment && $contact["rel"] == Contact::FOLLOWER && in_array($importer["page-flags"], array(User::PAGE_FLAGS_FREELOVE))) {
- // DBA::update(
- // 'contact',
+ // Contact::update(
// array('rel' => Contact::FRIEND, 'writable' => true),
// array('id' => $contact["id"], 'uid' => $contact["uid"])
// );
private static function receiveRequestMakeFriend(array $importer, array $contact)
{
if ($contact["rel"] == Contact::SHARING) {
- DBA::update(
- 'contact',
+ Contact::update(
['rel' => Contact::FRIEND, 'writable' => true],
['id' => $contact["id"], 'uid' => $importer["uid"]]
);
$condition = ['network' => Protocol::DFRN, 'uid' => $owner['uid'], 'blocked' => false,
'pending' => false, 'archive' => false, 'rel' => [Contact::FOLLOWER, Contact::FRIEND]];
- $contacts = DBA::toArray(DBA::select('contact', ['id', 'url', 'addr', 'name', 'network', 'protocol'], $condition));
+ $contacts = DBA::selectToArray('contact', ['id', 'url', 'addr', 'name', 'network', 'protocol'], $condition);
$conversants = array_merge($contacts, $participants);