From 0b36b09823396834379b622c225d023b90366323 Mon Sep 17 00:00:00 2001 From: rabuzarus <> Date: Sun, 11 Oct 2015 13:07:19 +0200 Subject: [PATCH] don't send attendance activities to diaspora (unsupported) --- include/delivery.php | 13 +++++++++---- include/notifier.php | 13 +++++++++---- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/include/delivery.php b/include/delivery.php index a913e13170..3b554370f5 100644 --- a/include/delivery.php +++ b/include/delivery.php @@ -520,11 +520,16 @@ function delivery_run(&$argv, &$argc){ if((! $contact['pubkey']) && (! $public_message)) break; - if($target_item['verb'] === ACTIVITY_DISLIKE) { - // unsupported - break; + $unsupported_activities = array(ACTIVITY_LIKE, ACTIVITY_DISLIKE, ACTIVITY_ATTEND, ACTIVITY_ATTENDNO, ACTIVITY_ATTENDMAYBE); + + //don't transmit activities which are not supported by diaspora + foreach($unsupported_activities as $act) { + if(activity_match($target_item['verb'],$act)) { + break 2; + } } - elseif(($target_item['deleted']) && ($target_item['uri'] === $target_item['parent-uri'])) { + + if(($target_item['deleted']) && ($target_item['uri'] === $target_item['parent-uri'])) { // top-level retraction logger('delivery: diaspora retract: ' . $loc); diff --git a/include/notifier.php b/include/notifier.php index d4d254f1c9..4d97649c95 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -908,11 +908,16 @@ function notifier_run(&$argv, &$argc){ if(! $contact['pubkey']) break; - if($target_item['verb'] === ACTIVITY_DISLIKE) { - // unsupported - break; + $unsupported_activities = array(ACTIVITY_LIKE, ACTIVITY_DISLIKE, ACTIVITY_ATTEND, ACTIVITY_ATTENDNO, ACTIVITY_ATTENDMAYBE); + + //don't transmit activities which are not supported by diaspora + foreach($unsupported_activities as $act) { + if(activity_match($target_item['verb'],$act)) { + break 2; + } } - elseif(($target_item['deleted']) && (($target_item['uri'] === $target_item['parent-uri']) || $followup)) { + + if(($target_item['deleted']) && (($target_item['uri'] === $target_item['parent-uri']) || $followup)) { // send both top-level retractions and relayable retractions for owner to relay diaspora_send_retraction($target_item,$owner,$contact); break; -- 2.39.5