Notification moved to usage of the "tag" table
This commit is contained in:
parent
029a379060
commit
2b1fef469a
1 changed files with 2 additions and 2 deletions
|
@ -51,7 +51,7 @@ class UserItem
|
||||||
*/
|
*/
|
||||||
public static function setNotification(int $iid)
|
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]);
|
$item = Item::selectFirst($fields, ['id' => $iid, 'origin' => false]);
|
||||||
if (!DBA::isResult($item)) {
|
if (!DBA::isResult($item)) {
|
||||||
return;
|
return;
|
||||||
|
@ -208,7 +208,7 @@ class UserItem
|
||||||
}
|
}
|
||||||
|
|
||||||
// Or the contact is a mentioned forum
|
// 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)) {
|
while ($tag = DBA::fetch($tags)) {
|
||||||
$condition = ['nurl' => Strings::normaliseLink($tag['url']), 'uid' => $uid, 'notify_new_posts' => true, 'contact-type' => Contact::TYPE_COMMUNITY];
|
$condition = ['nurl' => Strings::normaliseLink($tag['url']), 'uid' => $uid, 'notify_new_posts' => true, 'contact-type' => Contact::TYPE_COMMUNITY];
|
||||||
if (DBA::exists('contact', $condition)) {
|
if (DBA::exists('contact', $condition)) {
|
||||||
|
|
Loading…
Reference in a new issue