aboutsummaryrefslogtreecommitdiffstats
path: root/include/poller.php
diff options
context:
space:
mode:
authorFriendika <info@friendika.com>2011-09-22 04:11:39 -0700
committerFriendika <info@friendika.com>2011-09-22 04:11:39 -0700
commitd6b446d63ffe589429394b5937b67ec666bbe219 (patch)
tree3dfe4e641324b68de0bc93729717aa7afe428562 /include/poller.php
parenta6edf2f71cdb8640ad9f9bee3f237684bd8530db (diff)
downloadvolse-hubzilla-d6b446d63ffe589429394b5937b67ec666bbe219.tar.gz
volse-hubzilla-d6b446d63ffe589429394b5937b67ec666bbe219.tar.bz2
volse-hubzilla-d6b446d63ffe589429394b5937b67ec666bbe219.zip
starting the big delivery shakeup
Diffstat (limited to 'include/poller.php')
-rw-r--r--include/poller.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/include/poller.php b/include/poller.php
index dbae1deec..fd2a0af8f 100644
--- a/include/poller.php
+++ b/include/poller.php
@@ -138,6 +138,8 @@ function poller_run($argv, $argc){
if((datetime_convert('UTC','UTC', 'now') > datetime_convert('UTC','UTC', $t . " + 1 day")) || $force)
$hub_update = true;
}
+ else
+ $hub_update = false;
/**
* Based on $contact['priority'], should we poll this site now? Or later?
@@ -473,21 +475,25 @@ function poller_run($argv, $argc){
consume_feed($xml,$importer,$contact,$hub,1);
+ $hubmode = 'subscribe';
+ if($contact['network'] === NETWORK_DFRN || $contact['blocked'] || $contact['readonly'])
+ $hubmode = 'unsubscribe';
- if((strlen($hub)) && ($hub_update) && (($contact['rel'] == CONTACT_IS_FRIEND) || (($contact['network'] === NETWORK_OSTATUS) && (! $contact['readonly'])))) {
- logger('poller: subscribing to hub(s) : ' . $hub . ' contact name : ' . $contact['name'] . ' local user : ' . $importer['name']);
+ if((strlen($hub)) && ($hub_update) && ($contact['rel'] != CONTACT_IS_FOLLOWER)) {
+ logger('poller: hub ' . $hubmode . ' : ' . $hub . ' contact name : ' . $contact['name'] . ' local user : ' . $importer['name']);
$hubs = explode(',', $hub);
if(count($hubs)) {
foreach($hubs as $h) {
$h = trim($h);
if(! strlen($h))
continue;
- subscribe_to_hub($h,$importer,$contact);
+ subscribe_to_hub($h,$importer,$contact,$hubmode);
}
}
}
}
+
$updated = datetime_convert();
$r = q("UPDATE `contact` SET `last-update` = '%s', `success_update` = '%s' WHERE `id` = %d LIMIT 1",