]> git.mxchange.org Git - friendica.git/commitdiff
Notifications for non contacts
authorMichael <heluecht@pirati.ca>
Sun, 30 Jan 2022 13:46:11 +0000 (13:46 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 30 Jan 2022 13:46:11 +0000 (13:46 +0000)
mod/item.php

index d47a78053fddda346767e7de90b0f3bb0cdceae2..7cf2e53d495f869ff4fae133759b58fe7f4268dd 100644 (file)
@@ -398,13 +398,13 @@ function item_post(App $a) {
 
                // Search for forum mentions
                foreach (Tag::getFromBody($body, Tag::TAG_CHARACTER[Tag::MENTION] . Tag::TAG_CHARACTER[Tag::EXCLUSIVE_MENTION]) as $tag) {
-                       $contact = Contact::getByURL($tag[2], false, [], $profile_uid);
+                       $contact = Contact::getByURLForUser($tag[2], $profile_uid);
                        if (!empty($inform)) {
                                $inform .= ',';
                        }
                        $inform .= 'cid:' . $contact['id'];
 
-                       if (!$toplevel_item_id || ($contact['contact-type'] != Contact::TYPE_COMMUNITY)) {
+                       if (!$toplevel_item_id || empty($contact['cid']) || ($contact['contact-type'] != Contact::TYPE_COMMUNITY)) {
                                continue;
                        }