$items = [];
- foreach ($parents AS $parent) {
- $condition = ["`item`.`parent-uri` = ? AND `item`.`uid` IN (0, ?) ",
- $parent['uri'], $uid];
- if ($block_authors) {
- $condition[0] .= "AND NOT `author`.`hidden`";
- }
-
- $thread_items = Item::selectForUser(local_user(), array_merge(Item::DISPLAY_FIELDLIST, ['contact-uid', 'gravity']), $condition, $params);
+ $follow = Item::activityToIndex(Activity::FOLLOW);
- $comments = conversation_fetch_comments($thread_items, $parent['pinned'] ?? false);
-
- if (count($comments) != 0) {
- $items = array_merge($items, $comments);
- }
+ foreach ($parents AS $parent) {
+ $condition = ["`item`.`parent-uri` = ? AND `item`.`uid` IN (0, ?) AND (`activity` != ? OR `activity` IS NULL)",
+ $parent['uri'], $uid, $follow];
+ $items = conversation_fetch_items($parent, $items, $condition, $block_authors, $params);
}
foreach ($items as $index => $item) {
return $items;
}
+/**
+ * Fetch conversation items
+ *
+ * @param array $parent
+ * @param array $items
+ * @param array $condition
+ * @param boolean $block_authors
+ * @param array $params
+ * @return array
+ */
+function conversation_fetch_items(array $parent, array $items, array $condition, bool $block_authors, array $params) {
+ if ($block_authors) {
+ $condition[0] .= "AND NOT `author`.`hidden`";
+ }
+
+ $thread_items = Item::selectForUser(local_user(), array_merge(Item::DISPLAY_FIELDLIST, ['contact-uid', 'gravity']), $condition, $params);
+
+ $comments = conversation_fetch_comments($thread_items, $parent['pinned'] ?? false);
+
+ if (count($comments) != 0) {
+ $items = array_merge($items, $comments);
+ }
+ return $items;
+}
+
function item_photo_menu($item) {
$sub_link = '';
$poke_link = '';
use Friendica\Model\Group;
use Friendica\Model\Item;
use Friendica\Model\Notify\Type;
+use Friendica\Protocol\Activity;
use Friendica\Util\DateTimeFormat;
use Friendica\Util\Temporal;
use Friendica\Util\Proxy as ProxyUtils;
$notifs = ping_get_notifications(local_user());
- $condition = ["`unseen` AND `uid` = ? AND `contact-id` != ?", local_user(), local_user()];
+ $condition = ["`unseen` AND `uid` = ? AND `contact-id` != ? AND (`activity` != ? OR `activity` IS NULL)",
+ local_user(), local_user(), Item::activityToIndex(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'];
+ 'network', 'created', 'object', 'parent-author-name', 'parent-author-link', 'parent-guid', 'wall', 'activity'];
$params = ['order' => ['received' => true]];
$items = Item::selectForUser(local_user(), $fields, $condition, $params);
'event-id', 'event-created', 'event-edited', 'event-start', 'event-finish',
'event-summary', 'event-desc', 'event-location', 'event-type',
'event-nofinish', 'event-adjust', 'event-ignore', 'event-id',
- 'delivery_queue_count', 'delivery_queue_done', 'delivery_queue_failed'
+ 'delivery_queue_count', 'delivery_queue_done', 'delivery_queue_failed', 'activity'
];
// Field list that is used to deliver items via the protocols
$allow_gid = $parent['allow_gid'];
$deny_cid = $parent['deny_cid'];
$deny_gid = $parent['deny_gid'];
- $item['wall'] = $parent['wall'];
+
+ // Don't federate received participation messages
+ if ($item['verb'] != Activity::FOLLOW) {
+ $item['wall'] = $parent['wall'];
+ } else {
+ $item['wall'] = false;
+ }
/*
* If the parent is private, force privacy for the entire conversation