From 40dce6085dcb709ae1119710c4d333e3b9e5ebfb Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 10 Aug 2020 21:02:59 +0000 Subject: [PATCH] Add notification check --- src/Model/Item.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Model/Item.php b/src/Model/Item.php index 1c61dfcdd..ee07bd09d 100644 --- a/src/Model/Item.php +++ b/src/Model/Item.php @@ -2010,8 +2010,12 @@ class Item $contact = Contact::selectFirst(['id'], ['nurl' => $pcontact['nurl'], 'uid' => $item['uid']]); if (!empty($contact['id'])) { - Item::update(['owner-id' => $item['author-id'], 'contact-id' => $contact['id']], - ['uri-id' => $item['parent-uri-id'], 'uid' => $item['uid']]); + $condition = ['uri-id' => $item['parent-uri-id'], 'uid' => $item['uid']]; + Item::update(['owner-id' => $item['author-id'], 'contact-id' => $contact['id']], $condition); + $forum_item = Item::selectFirst(['id'], $condition); + if (!empty($forum_item['id'])) { + UserItem::setNotification($forum_item['id']); + } LOgger::info('Convert message into a forum message', ['uri-id' => $item['uri-id'], 'parent-uri-id' => $item['parent-uri-id'], 'uid' => $item['uid'], 'owner-id' => $item['author-id'], 'contact-id' => $contact['id']]); } }