From 9a1a666f2430a02279f26ebbb29814b3e8dd105b Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Wed, 4 Sep 2013 00:01:00 +0200 Subject: [PATCH] Some changes to let pumpio react similar to facebook. --- include/bbcode.php | 3 ++- include/delivery.php | 5 ++++- include/notifier.php | 5 ++++- include/onepoll.php | 8 ++++++-- include/poller.php | 5 +++-- 5 files changed, 19 insertions(+), 7 deletions(-) diff --git a/include/bbcode.php b/include/bbcode.php index a536b53649..ca09cffec5 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -36,7 +36,8 @@ function stripcode_br_cb($s) { function tryoembed($match){ $url = ((count($match)==2)?$match[1]:$match[2]); -// logger("tryoembed: $url"); + + //logger("tryoembed: $url"); $o = oembed_fetch_url($url); diff --git a/include/delivery.php b/include/delivery.php index d89cded9eb..5e37ad2e0c 100644 --- a/include/delivery.php +++ b/include/delivery.php @@ -542,7 +542,7 @@ function delivery_run(&$argv, &$argc){ diaspora_send_relay($target_item,$owner,$contact,$public_message); break; - } + } elseif(($top_level) && (! $walltowall)) { // currently no workable solution for sending walltowall logger('delivery: diaspora status: ' . $loc); @@ -558,6 +558,9 @@ function delivery_run(&$argv, &$argc){ case NETWORK_FACEBOOK : if(get_config('system','dfrn_only')) break; + case NETWORK_PUMPIO : + if(get_config('system','dfrn_only')) + break; default: break; } diff --git a/include/notifier.php b/include/notifier.php index a3286355dd..74597c30d2 100644 --- a/include/notifier.php +++ b/include/notifier.php @@ -881,12 +881,15 @@ function notifier_run(&$argv, &$argc){ case NETWORK_FACEBOOK: if(get_config('system','dfrn_only')) break; + case NETWORK_PUMPIO: + if(get_config('system','dfrn_only')) + break; default: break; } } } - + // send additional slaps to mentioned remote tags (@foo@example.com) if($slap && count($url_recipients) && ($followup || $top_level) && $public_message && (! $expire)) { diff --git a/include/onepoll.php b/include/onepoll.php index f38f6b4c61..e7cae773ca 100644 --- a/include/onepoll.php +++ b/include/onepoll.php @@ -76,7 +76,7 @@ function onepoll_run(&$argv, &$argc){ $contacts = q("SELECT `contact`.* FROM `contact` WHERE ( `rel` = %d OR `rel` = %d ) AND `poll` != '' - AND NOT `network` IN ( '%s', '%s' ) + AND NOT `network` IN ( '%s', '%s', '%s' ) AND `contact`.`id` = %d AND `self` = 0 AND `contact`.`blocked` = 0 AND `contact`.`readonly` = 0 AND `contact`.`archive` = 0 LIMIT 1", @@ -84,6 +84,7 @@ function onepoll_run(&$argv, &$argc){ intval(CONTACT_IS_FRIEND), dbesc(NETWORK_DIASPORA), dbesc(NETWORK_FACEBOOK), + dbesc(NETWORK_PUMPIO), intval($contact_id) ); @@ -526,6 +527,9 @@ function onepoll_run(&$argv, &$argc){ elseif($contact['network'] === NETWORK_FACEBOOK) { // This is picked up by the Facebook plugin on a cron hook. // Ignored here. + } elseif($contact['network'] === NETWORK_PUMPIO) { + // This is picked up by the pump.io plugin on a cron hook. + // Ignored here. } if($xml) { @@ -544,7 +548,7 @@ function onepoll_run(&$argv, &$argc){ // do it twice. Ensures that children of parents which may be later in the stream aren't tossed - + consume_feed($xml,$importer,$contact,$hub,1,2); $hubmode = 'subscribe'; diff --git a/include/poller.php b/include/poller.php index e927430ea9..9ba9c782b7 100644 --- a/include/poller.php +++ b/include/poller.php @@ -173,7 +173,7 @@ function poller_run(&$argv, &$argc){ $contacts = q("SELECT `contact`.`id` FROM `contact` LEFT JOIN `user` ON `user`.`uid` = `contact`.`uid` WHERE ( `rel` = %d OR `rel` = %d ) AND `poll` != '' - AND NOT `network` IN ( '%s', '%s' ) + AND NOT `network` IN ( '%s', '%s', '%s' ) $sql_extra AND `self` = 0 AND `contact`.`blocked` = 0 AND `contact`.`readonly` = 0 AND `contact`.`archive` = 0 @@ -181,7 +181,8 @@ function poller_run(&$argv, &$argc){ intval(CONTACT_IS_SHARING), intval(CONTACT_IS_FRIEND), dbesc(NETWORK_DIASPORA), - dbesc(NETWORK_FACEBOOK) + dbesc(NETWORK_FACEBOOK), + dbesc(NETWORK_PUMPIO) ); if(! count($contacts)) {