]> git.mxchange.org Git - friendica.git/blobdiff - src/Worker/Notifier.php
Merge pull request #11341 from tobiasd/20220315-getcontactstoupdate
[friendica.git] / src / Worker / Notifier.php
index abd5613dd0bc9937e91028b85f9e7da2c3affcf2..80628d7dba08d08fe5e55a3dabc84886e2a27038 100644 (file)
@@ -445,7 +445,7 @@ class Notifier
                        $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);
 
@@ -673,7 +673,7 @@ class Notifier
                }
 
                while($contact = DBA::fetch($contacts_stmt)) {
-                       Protocol::terminateFriendship($owner, $contact, true);
+                       Contact::terminateFriendship($contact);
                }
                DBA::close($contacts_stmt);
 
@@ -730,9 +730,9 @@ class Notifier
                $uid = $target_item['contact-uid'] ?: $target_item['uid'];
 
                // Update the locally stored follower list when we deliver to a forum
-               foreach (Tag::getByURIId($target_item['uri-id'], [Tag::EXCLUSIVE_MENTION]) as $tag) {
+               foreach (Tag::getByURIId($target_item['uri-id'], [Tag::MENTION, Tag::EXCLUSIVE_MENTION]) as $tag) {
                        $target_contact = Contact::getByURL(Strings::normaliseLink($tag['url']), null, [], $uid);
-                       if (($target_contact['contact-type'] == Contact::TYPE_COMMUNITY) && $target_contact['manually-approve']) {
+                       if ($target_contact && $target_contact['contact-type'] == Contact::TYPE_COMMUNITY && $target_contact['manually-approve']) {
                                Group::updateMembersForForum($target_contact['id']);
                        }
                }