From bc7f8b15a8236ef22aed84b7bd28514fd881b355 Mon Sep 17 00:00:00 2001 From: Mario Date: Mon, 11 Aug 2025 23:13:26 +0000 Subject: [PATCH] dismiss our own votes from select query. they are not flagged with item_hidden because otherwise they would not be delivered to the poll owner. received votes are (and should be) flagged with item_hidden so that they are not being relayed. --- include/items.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/items.php b/include/items.php index 6a1334108..95bbc2006 100644 --- a/include/items.php +++ b/include/items.php @@ -272,7 +272,6 @@ function item_forwardable($item) { str_contains($item['postopts'], 'nodeliver') || // actor not fetchable (isset($item['author']['xchan_network']) && in_array($item['author']['xchan_network'], ['rss', 'anon', 'token'])) - ) { return false; } @@ -5387,6 +5386,7 @@ function item_by_item_id(int $id, int $parent, int $type = ITEM_TYPE_POST): arra item.id = %d AND item.uid = %d AND item.verb IN ('Create', 'Update', 'EmojiReact') + AND item.obj_type NOT IN ('Answer') $item_normal_sql", intval($id), intval(local_channel()) @@ -5472,6 +5472,7 @@ function items_by_parent_ids(array $parents, null|array $thr_parents = null, str FROM item WHERE item.parent IN ($ids) AND item.verb IN ('Create', 'Update', 'EmojiReact') + AND item.obj_type NOT IN ('Answer') AND item.item_thread_top = 0 $thr_parent_sql $permission_sql @@ -5550,6 +5551,7 @@ function item_reaction_sql(string $ids, string $permission_sql = '', string $joi $observer_sql FROM item WHERE item.verb IN ($verbs_str) + AND item.obj_type NOT IN ('Answer') AND item.item_thread_top = 0 AND item.parent IN ($ids) $item_normal_sql @@ -5625,6 +5627,7 @@ function items_by_thr_parent(string $mid, int $parent, int|null $offset = null): item.thr_parent = '%s' AND item.uid = %d AND item.verb IN ('Create', 'Update', 'EmojiReact') + AND item.obj_type NOT IN ('Answer') AND item.item_thread_top = 0 $item_normal_sql $order_sql", @@ -5652,6 +5655,7 @@ function items_by_thr_parent(string $mid, int $parent, int|null $offset = null): item.thr_parent = '%s' AND item.uid = %d AND item.verb IN ('Create', 'Update', 'EmojiReact') + AND item.obj_type NOT IN ('Answer') AND item.item_thread_top = 0 $permission_sql $item_normal_sql