case ItemModel::PR_DISTRIBUTE:
$row['direction'] = ['direction' => 6, 'title' => $this->l10n->t('Distributed')];
break;
-
+ case ItemModel::PR_PUSHED:
+ $row['direction'] = ['direction' => 1, 'title' => $this->l10n->t('Pushed to us')];
+ break;
}
$row['thr-parent-row'] = $thr_parent;
const PR_DIRECT = 77;
const PR_ACTIVITY = 78;
const PR_DISTRIBUTE = 79;
+ const PR_PUSHED = 80;
+ const PR_LOCAL = 81;
// system.accept_only_sharer setting values
const COMPLETION_NONE = 1;
$item['post-reason'] = self::PR_FOLLOWER;
}
+ if ($item['origin'] && empty($item['post-reason'])) {
+ $item['post-reason'] = self::PR_LOCAL;
+ }
+
// Ensure that there is an avatar cache
Contact::checkAvatarCache($item['author-id']);
Contact::checkAvatarCache($item['owner-id']);
if (!empty($activity['raw'])) {
$item['source'] = $activity['raw'];
$item['protocol'] = Conversation::PARCEL_ACTIVITYPUB;
+ }
- if (isset($activity['push'])) {
- $item['direction'] = $activity['push'] ? Conversation::PUSH : Conversation::PULL;
- }
+ if (isset($activity['push'])) {
+ $item['direction'] = $activity['push'] ? Conversation::PUSH : Conversation::PULL;
}
if (!empty($activity['from-relay'])) {
$item['post-reason'] = Item::PR_RELAY;
} elseif (!empty($activity['thread-completion'])) {
$item['post-reason'] = Item::PR_FETCHED;
+ } elseif (in_array($item['post-reason'], [Item::PR_GLOBAL, Item::PR_NONE]) && !empty($activity['push'])) {
+ $item['post-reason'] = Item::PR_PUSHED;
}
if ($item['isForum'] ?? false) {
}
if (!empty($reply)) {
- $parents = Post::select(['uid'], ['uri' => $reply]);
+ $parents = Post::select(['uid'], DBA::mergeConditions(['uri' => $reply], ["`uid` != ?", 0]));
while ($parent = Post::fetch($parents)) {
$receivers[$parent['uid']] = ['uid' => $parent['uid'], 'type' => self::TARGET_ANSWER];
}