From: Michael <heluecht@pirati.ca>
Date: Fri, 1 May 2020 12:41:17 +0000 (+0000)
Subject: Notification moved to usage of the "tag" table
X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2b1fef469a683ce24651564794e839c96040ecde;p=friendica.git

Notification moved to usage of the "tag" table
---

diff --git a/src/Model/UserItem.php b/src/Model/UserItem.php
index 74c5ac4486..5e9096f41a 100644
--- a/src/Model/UserItem.php
+++ b/src/Model/UserItem.php
@@ -51,7 +51,7 @@ class UserItem
 	 */
 	public static function setNotification(int $iid)
 	{
-		$fields = ['id', 'uid', 'body', 'parent', 'gravity', 'tag', 'contact-id', 'thr-parent', 'parent-uri', 'author-id'];
+		$fields = ['id', 'uri-id', 'uid', 'body', 'parent', 'gravity', 'tag', 'contact-id', 'thr-parent', 'parent-uri', 'author-id'];
 		$item = Item::selectFirst($fields, ['id' => $iid, 'origin' => false]);
 		if (!DBA::isResult($item)) {
 			return;
@@ -208,7 +208,7 @@ class UserItem
 		}
 
 		// Or the contact is a mentioned forum
-		$tags = DBA::select('term', ['url'], ['otype' => Term::OBJECT_TYPE_POST, 'oid' => $item['id'], 'type' => Tag::MENTION, 'uid' => $uid]);
+		$tags = DBA::select('tag-view', ['url'], ['uri-id' => $item['uri-id'], 'type' => [Tag::MENTION, Tag::EXCLUSIVE_MENTION]]);
 		while ($tag = DBA::fetch($tags)) {
 			$condition = ['nurl' => Strings::normaliseLink($tag['url']), 'uid' => $uid, 'notify_new_posts' => true, 'contact-type' => Contact::TYPE_COMMUNITY];
 			if (DBA::exists('contact', $condition)) {