From 0a1697d13a345fd9f2a404a2d0a0d069dfb236d3 Mon Sep 17 00:00:00 2001 From: Fabrixxm Date: Thu, 27 Jun 2013 09:51:13 -0400 Subject: [PATCH] add pubsubhubbub support to feed contacts --- include/onepoll.php | 8 ++++++-- mod/pubsub.php | 5 +++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/include/onepoll.php b/include/onepoll.php index bd20cfdb53..da5645f7f7 100644 --- a/include/onepoll.php +++ b/include/onepoll.php @@ -2,6 +2,10 @@ require_once("boot.php"); +function logger($txt, $lvl=""){ + echo $txt."\n"; +} + function RemoveReply($subject) { while (in_array(strtolower(substr($subject, 0, 3)), array("re:", "aw:"))) $subject = trim(substr($subject, 4)); @@ -541,10 +545,10 @@ function onepoll_run(&$argv, &$argc){ if($contact['network'] === NETWORK_DFRN || $contact['blocked'] || $contact['readonly']) $hubmode = 'unsubscribe'; - if($contact['network'] === NETWORK_OSTATUS && (! $contact['hub-verify'])) + if(($contact['network'] === NETWORK_OSTATUS || $contact['network'] == NETWORK_FEED) && (! $contact['hub-verify'])) $hub_update = true; - if((strlen($hub)) && ($hub_update) && ($contact['rel'] != CONTACT_IS_FOLLOWER)) { + if((strlen($hub)) && ($hub_update) && (($contact['rel'] != CONTACT_IS_FOLLOWER) || $contact['network'] == NETWORK_FEED) ) { logger('poller: hub ' . $hubmode . ' : ' . $hub . ' contact name : ' . $contact['name'] . ' local user : ' . $importer['name']); $hubs = explode(',', $hub); if(count($hubs)) { diff --git a/mod/pubsub.php b/mod/pubsub.php index 0e29628b80..7aa95e49c0 100644 --- a/mod/pubsub.php +++ b/mod/pubsub.php @@ -121,11 +121,12 @@ function pubsub_post(&$a) { $importer = $r[0]; $r = q("SELECT * FROM `contact` WHERE `subhub` = 1 AND `id` = %d AND `uid` = %d - AND ( `rel` = %d OR `rel` = %d ) AND `blocked` = 0 AND `readonly` = 0 LIMIT 1", + AND ( `rel` = %d OR `rel` = %d OR network = '%s' ) AND `blocked` = 0 AND `readonly` = 0 LIMIT 1", intval($contact_id), intval($importer['uid']), intval(CONTACT_IS_SHARING), - intval(CONTACT_IS_FRIEND) + intval(CONTACT_IS_FRIEND), + dbesc(NETWORK_FEED) ); if(! count($r)) { -- 2.39.5