From af839a05892f9446e86327ba04787b3a697c379c Mon Sep 17 00:00:00 2001 From: Mario Date: Fri, 1 Mar 2024 15:47:40 +0000 Subject: AS2 Follow/Ignore --- Zotlabs/Daemon/Notifier.php | 2 +- Zotlabs/Module/Activity.php | 4 ++-- Zotlabs/Module/Conversation.php | 2 +- Zotlabs/Module/Item.php | 4 ++-- Zotlabs/Module/Sse_bs.php | 10 +++++----- Zotlabs/Module/Subthread.php | 8 ++++---- Zotlabs/Widget/Messages.php | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) (limited to 'Zotlabs') diff --git a/Zotlabs/Daemon/Notifier.php b/Zotlabs/Daemon/Notifier.php index 948aba80c..4e7ca3911 100644 --- a/Zotlabs/Daemon/Notifier.php +++ b/Zotlabs/Daemon/Notifier.php @@ -276,7 +276,7 @@ class Notifier { } // follow/unfollow is for internal use only - if (in_array($target_item['verb'], [ACTIVITY_FOLLOW, ACTIVITY_UNFOLLOW])) { + if (in_array($target_item['verb'], ['Follow', 'Ignore', ACTIVITY_FOLLOW, ACTIVITY_UNFOLLOW])) { logger('not fowarding follow/unfollow note activity'); return; } diff --git a/Zotlabs/Module/Activity.php b/Zotlabs/Module/Activity.php index b2f0ce498..133312e28 100644 --- a/Zotlabs/Module/Activity.php +++ b/Zotlabs/Module/Activity.php @@ -25,7 +25,7 @@ class Activity extends Controller { $portable_id = EMPTY_STR; - $item_normal_extra = sprintf(" and not verb in ('%s', '%s') ", + $item_normal_extra = sprintf(" and not verb in ('Follow', 'Ignore', '%s', '%s') ", dbesc(ACTIVITY_FOLLOW), dbesc(ACTIVITY_UNFOLLOW) ); @@ -186,7 +186,7 @@ class Activity extends Controller { } } - $item_normal_extra = sprintf(" and not verb in ('%s', '%s') ", + $item_normal_extra = sprintf(" and not verb in ('Follow', 'Ignore', '%s', '%s') ", dbesc(ACTIVITY_FOLLOW), dbesc(ACTIVITY_UNFOLLOW) ); diff --git a/Zotlabs/Module/Conversation.php b/Zotlabs/Module/Conversation.php index 86ce66caa..aa8349f55 100644 --- a/Zotlabs/Module/Conversation.php +++ b/Zotlabs/Module/Conversation.php @@ -25,7 +25,7 @@ class Conversation extends Controller { $portable_id = EMPTY_STR; - $item_normal_extra = sprintf(" and not verb in ('%s', '%s') ", + $item_normal_extra = sprintf(" and not verb in ('Follow', 'Ignore', '%s', '%s') ", dbesc(ACTIVITY_FOLLOW), dbesc(ACTIVITY_UNFOLLOW) ); diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php index 7d71edc99..9c967cb88 100644 --- a/Zotlabs/Module/Item.php +++ b/Zotlabs/Module/Item.php @@ -52,7 +52,7 @@ class Item extends Controller { $portable_id = EMPTY_STR; - $item_normal_extra = sprintf(" and not verb in ('%s', '%s') ", + $item_normal_extra = sprintf(" and not verb in ('Follow', 'Ignore', '%s', '%s') ", dbesc(ACTIVITY_FOLLOW), dbesc(ACTIVITY_UNFOLLOW) ); @@ -168,7 +168,7 @@ class Item extends Controller { $portable_id = EMPTY_STR; - $item_normal_extra = sprintf(" and not verb in ('%s', '%s') ", + $item_normal_extra = sprintf(" and not verb in ('Follow', 'Ignore', '%s', '%s') ", dbesc(ACTIVITY_FOLLOW), dbesc(ACTIVITY_UNFOLLOW) ); diff --git a/Zotlabs/Module/Sse_bs.php b/Zotlabs/Module/Sse_bs.php index a621f3608..71fc16aae 100644 --- a/Zotlabs/Module/Sse_bs.php +++ b/Zotlabs/Module/Sse_bs.php @@ -194,7 +194,7 @@ class Sse_bs extends Controller { $item_normal = item_normal(); // Filter internal follow activities and strerams add/remove activities - $item_normal .= " AND verb NOT IN ('Add', 'Remove', '" . dbesc(ACTIVITY_FOLLOW) . "') "; + $item_normal .= " AND verb NOT IN ('Add', 'Remove', 'Follow', 'Ignore', '" . dbesc(ACTIVITY_FOLLOW) . "') "; if ($notifications) { $items = q("SELECT * FROM item @@ -277,7 +277,7 @@ class Sse_bs extends Controller { $item_normal = item_normal(); // Filter internal follow activities and strerams add/remove activities - $item_normal .= " AND verb NOT IN ('Add', 'Remove', '" . dbesc(ACTIVITY_FOLLOW) . "') "; + $item_normal .= " AND verb NOT IN ('Add', 'Remove', 'Follow', 'Ignore', '" . dbesc(ACTIVITY_FOLLOW) . "') "; if ($notifications) { $items = q("SELECT * FROM item @@ -360,7 +360,7 @@ class Sse_bs extends Controller { $item_normal = item_normal(); // Filter internal follow activities and strerams add/remove activities - $item_normal .= " AND verb NOT IN ('Add', 'Remove', '" . dbesc(ACTIVITY_FOLLOW) . "') "; + $item_normal .= " AND verb NOT IN ('Add', 'Remove', 'Follow', 'Ignore', '" . dbesc(ACTIVITY_FOLLOW) . "') "; if ($notifications) { $items = q("SELECT * FROM item @@ -467,7 +467,7 @@ class Sse_bs extends Controller { $item_normal = item_normal(); // Filter internal follow activities and strerams add/remove activities - $item_normal .= " AND verb NOT IN ('Add', 'Remove', '" . dbesc(ACTIVITY_FOLLOW) . "') "; + $item_normal .= " AND verb NOT IN ('Add', 'Remove', 'Follow', 'Ignore', '" . dbesc(ACTIVITY_FOLLOW) . "') "; if ($notifications) { $items = q("SELECT * FROM item @@ -663,7 +663,7 @@ class Sse_bs extends Controller { $item_normal = item_normal(); // Filter internal follow activities and strerams add/remove activities - $item_normal .= " AND verb NOT IN ('Add', 'Remove', '" . dbesc(ACTIVITY_FOLLOW) . "') "; + $item_normal .= " AND verb NOT IN ('Add', 'Remove', 'Follow', 'Ignore', '" . dbesc(ACTIVITY_FOLLOW) . "') "; $r = q("SELECT * FROM item WHERE (verb = 'Create' OR verb = '%s') diff --git a/Zotlabs/Module/Subthread.php b/Zotlabs/Module/Subthread.php index 5ddcaffc6..b927ee480 100644 --- a/Zotlabs/Module/Subthread.php +++ b/Zotlabs/Module/Subthread.php @@ -24,9 +24,9 @@ class Subthread extends \Zotlabs\Web\Controller { $item_id = ((argc() > 2) ? notags(trim(argv(2))) : 0); if(argv(1) === 'sub') - $activity = ACTIVITY_FOLLOW; + $activity = 'Follow'; elseif(argv(1) === 'unsub') - $activity = ACTIVITY_UNFOLLOW; + $activity = 'Ignore'; $i = q("select * from item where id = %d and uid = %d", @@ -121,9 +121,9 @@ class Subthread extends \Zotlabs\Web\Controller { if(! intval($item['item_thread_top'])) $post_type = 'comment'; - if($activity === ACTIVITY_FOLLOW) + if($activity === 'Follow') $bodyverb = t('%1$s is following %2$s\'s %3$s'); - if($activity === ACTIVITY_UNFOLLOW) + if($activity === 'Ignore') $bodyverb = t('%1$s stopped following %2$s\'s %3$s'); $arr = array(); diff --git a/Zotlabs/Widget/Messages.php b/Zotlabs/Widget/Messages.php index 0ddbebbcc..8654d8e8f 100644 --- a/Zotlabs/Widget/Messages.php +++ b/Zotlabs/Widget/Messages.php @@ -62,7 +62,7 @@ class Messages { $channel = App::get_channel(); $item_normal = item_normal(); // Filter internal follow activities and strerams add/remove activities - $item_normal .= " and item.verb not in ('Add', 'Remove', '" . ACTIVITY_FOLLOW . "') "; + $item_normal .= " and item.verb not in ('Add', 'Remove', 'Follow', 'Ignore', '" . ACTIVITY_FOLLOW . "') "; $item_normal_i = str_replace('item.', 'i.', $item_normal); $item_normal_c = str_replace('item.', 'c.', $item_normal); $entries = []; -- cgit v1.2.3