From 719dbf091a3483bd7d30b8ad0782ff4d14c876bf Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 23 Jul 2024 14:17:06 +0000 Subject: some cleanup --- include/items.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/include/items.php b/include/items.php index 38f8bdca5..a667bc1bc 100644 --- a/include/items.php +++ b/include/items.php @@ -2962,20 +2962,21 @@ function tgroup_check($uid, $item) { dbesc($item['mid']), intval($uid) ); - if($r) + + if ($r) { return true; + } - $u = q("select * from channel left join xchan on channel_hash = xchan_hash where channel_id = %d limit 1", - intval($uid) - ); + $u = channelx_by_n($uid); - if(! $u) + if (!$u) { return false; + } $max_forums = Config::Get('system','max_tagged_forums',2); $matched_forums = 0; - $link = normalise_link($u[0]['xchan_url']); + $link = normalise_link($u['xchan_url']); $terms = []; @@ -2992,7 +2993,7 @@ function tgroup_check($uid, $item) { } $mention = true; - logger('tgroup_check: mention found for ' . $u[0]['channel_name']); + logger('tgroup_check: mention found for ' . $u['channel_name']); // At this point we've determined that the person receiving this post was mentioned in it. // Now let's check if this mention was inside a reshare so we don't spam a forum -- cgit v1.2.3