From 2d9163ce3016065bb0ea7e8fa3a8111e52e44881 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 5 Jan 2018 19:47:55 +0000 Subject: [PATCH] Posts from contacts weren't displayed correctly --- include/conversation.php | 2 +- src/Model/Contact.php | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/include/conversation.php b/include/conversation.php index 020eca1841..472896ffec 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -628,7 +628,7 @@ function conversation(App $a, $items, $mode, $update, $preview = false) { $writable = false; } - if ($mode === 'network-new' || $mode === 'search' || $community_readonly) { + if (in_array($mode, ['network-new', 'search', 'contact-posts']) || $community_readonly) { /* * "New Item View" on network page or search page results diff --git a/src/Model/Contact.php b/src/Model/Contact.php index 067a2fda7f..3e8b1f5d65 100644 --- a/src/Model/Contact.php +++ b/src/Model/Contact.php @@ -875,11 +875,13 @@ class Contact extends BaseObject $contact = ($r[0]["contact-type"] == ACCOUNT_TYPE_COMMUNITY ? 'owner-id' : 'author-id'); $r = q(item_query() . " AND `item`.`" . $contact . "` = %d AND " . $sql . - " ORDER BY `item`.`created` DESC LIMIT %d, %d", intval($author_id), intval(local_user()), intval($a->pager['start']), intval($a->pager['itemspage']) + " AND `item`.`verb` = '%s' ORDER BY `item`.`created` DESC LIMIT %d, %d", + intval($author_id), intval(local_user()), dbesc(ACTIVITY_POST), + intval($a->pager['start']), intval($a->pager['itemspage']) ); - $o = conversation($a, $r, 'community', false); + $o = conversation($a, $r, 'contact-posts', false); $o .= alt_pager($a, count($r));