aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMario <mario@mariovavti.com>2025-06-01 18:48:16 +0000
committerMario <mario@mariovavti.com>2025-06-01 18:48:16 +0000
commitf8afa77369d2e4830149825d2c3c4d3bcd676e33 (patch)
treedd51a0b388c1e4701abcf7edca826f837802324e
parent940fd26db747a56df59b14e3f0c1ca6ffd26e26a (diff)
downloadvolse-hubzilla-f8afa77369d2e4830149825d2c3c4d3bcd676e33.tar.gz
volse-hubzilla-f8afa77369d2e4830149825d2c3c4d3bcd676e33.tar.bz2
volse-hubzilla-f8afa77369d2e4830149825d2c3c4d3bcd676e33.zip
add internal follow and ignore verbs to the list of filtered verbs and add commented out code to display/count only one reaction per author. It appears there can be multiple. We should probably look into how this can happen and if we should prevent it earlier.
-rw-r--r--include/items.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/include/items.php b/include/items.php
index b53883158..c126c501f 100644
--- a/include/items.php
+++ b/include/items.php
@@ -5390,7 +5390,7 @@ function item_by_item_id(int $id, int $parent): array
WHERE
item.id = %d
AND item.uid = %d
- AND item.verb NOT IN ('Like', 'Dislike', 'Announce', 'Accept', 'Reject', 'TentativeAccept')
+ AND item.verb NOT IN ('Like', 'Dislike', 'Announce', 'Accept', 'Reject', 'TentativeAccept', 'Add', 'Remove', 'Follow', 'Ignore')
$item_normal_sql",
intval($id),
intval(local_channel())
@@ -5474,7 +5474,7 @@ function items_by_parent_ids(array $parents, null|array $thr_parents = null, str
ROW_NUMBER() OVER (PARTITION BY item.parent ORDER BY item.created DESC) AS rn
FROM item
WHERE item.parent IN ($ids)
- AND item.verb NOT IN ('Like', 'Dislike', 'Announce', 'Accept', 'Reject', 'TentativeAccept', 'Add', 'Remove')
+ AND item.verb NOT IN ('Like', 'Dislike', 'Announce', 'Accept', 'Reject', 'TentativeAccept', 'Add', 'Remove', 'Follow', 'Ignore')
AND item.item_thread_top = 0
$thr_parent_sql
$permission_sql
@@ -5547,6 +5547,7 @@ function item_reaction_sql(string $ids, string $permission_sql = '', string $joi
reaction_{$k} AS (
SELECT
item.thr_parent,
+ -- COUNT(DISTINCT item.author_xchan) AS {$k}_count, (should we prevent multiple reactions by the same author?)
COUNT(*) AS {$k}_count,
$observer_sql
FROM item
@@ -5625,7 +5626,7 @@ function items_by_thr_parent(string $mid, int $parent, int|null $offset = null):
WHERE
item.thr_parent = '%s'
AND item.uid = %d
- AND item.verb NOT IN ('Like', 'Dislike', 'Announce', 'Accept', 'Reject', 'TentativeAccept', 'Add', 'Remove')
+ AND item.verb NOT IN ('Like', 'Dislike', 'Announce', 'Accept', 'Reject', 'TentativeAccept', 'Add', 'Remove', 'Follow', 'Ignore')
AND item.item_thread_top = 0
$item_normal_sql
$order_sql",
@@ -5652,7 +5653,7 @@ function items_by_thr_parent(string $mid, int $parent, int|null $offset = null):
WHERE
item.thr_parent = '%s'
AND item.uid = %d
- AND item.verb NOT IN ('Like', 'Dislike', 'Announce', 'Accept', 'Reject', 'TentativeAccept', 'Add', 'Remove')
+ AND item.verb NOT IN ('Like', 'Dislike', 'Announce', 'Accept', 'Reject', 'TentativeAccept', 'Add', 'Remove', 'Follow', 'Ignore')
AND item.item_thread_top = 0
$permission_sql
$item_normal_sql
@@ -5701,6 +5702,7 @@ function item_activity_xchans(string $mid, int $parent, string $verb): array
AND item.verb = '%s'
AND item.item_thread_top = 0
$item_normal
+ -- GROUP BY item.author_xchan (should we prevent multiple reactions by the same author?)
ORDER BY item.created",
intval(local_channel()),
intval($parent),
@@ -5719,6 +5721,7 @@ function item_activity_xchans(string $mid, int $parent, string $verb): array
AND item.item_thread_top = 0
$sql_extra
$item_normal
+ -- GROUP BY item.author_xchan (should we prevent multiple reactions by the same author?)
ORDER BY item.created",
intval($owner_uid),
dbesc($mid),