From 20b93306ad277b79126f5ebf23a09ee379e55c3f Mon Sep 17 00:00:00 2001 From: Michael Date: Sun, 31 May 2020 14:38:00 +0000 Subject: [PATCH] Handling situations where "vid" is empty --- include/conversation.php | 2 +- mod/ping.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/conversation.php b/include/conversation.php index 6fdfd30b4..e623c9320 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -771,7 +771,7 @@ function conversation_add_children(array $parents, $block_authors, $order, $uid) $items = []; foreach ($parents AS $parent) { - $condition = ["`item`.`parent-uri` = ? AND `item`.`uid` IN (0, ?) AND `vid` != ?", + $condition = ["`item`.`parent-uri` = ? AND `item`.`uid` IN (0, ?) AND (`vid` != ? OR `vid` IS NULL)", $parent['uri'], $uid, Verb::getID(Activity::FOLLOW)]; $items = conversation_fetch_items($parent, $items, $condition, $block_authors, $params); } diff --git a/mod/ping.php b/mod/ping.php index 73e759107..6b3b015ac 100644 --- a/mod/ping.php +++ b/mod/ping.php @@ -136,7 +136,7 @@ function ping_init(App $a) $notifs = ping_get_notifications(local_user()); - $condition = ["`unseen` AND `uid` = ? AND `contact-id` != ? AND `vid` != ?", + $condition = ["`unseen` AND `uid` = ? AND `contact-id` != ? AND (`vid` != ? OR `vid` IS NULL)", local_user(), local_user(), Verb::getID(Activity::FOLLOW)]; $fields = ['id', 'parent', 'verb', 'author-name', 'unseen', 'author-link', 'author-avatar', 'contact-avatar', 'network', 'created', 'object', 'parent-author-name', 'parent-author-link', 'parent-guid', 'wall', 'activity'];