AS2 Follow/Ignore

This commit is contained in:
Mario
2024-03-01 15:47:40 +00:00
parent 4bbeb224f6
commit af839a0589
9 changed files with 22 additions and 23 deletions

View File

@@ -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;
}

View File

@@ -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)
);

View File

@@ -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)
);

View File

@@ -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)
);

View File

@@ -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')

View File

@@ -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();

View File

@@ -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 = [];