From d28d2ff440efba47ad65cf28eab4be96e0ea05b2 Mon Sep 17 00:00:00 2001 From: Friendika Date: Fri, 1 Jul 2011 18:18:01 -0700 Subject: better (more consistent) handling of ostatus contacts --- include/poller.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'include/poller.php') diff --git a/include/poller.php b/include/poller.php index 5565130e9..569eb59d1 100644 --- a/include/poller.php +++ b/include/poller.php @@ -310,13 +310,22 @@ function poller_run($argv, $argc){ // Upgrading DB fields from an older Friendika version // Will only do this once per notify-enabled OStatus contact + // or if relationship changes - if(($contact['notify']) && (! $contact['writable'])) { - q("UPDATE `contact` SET `writable` = 1 WHERE `id` = %d LIMIT 1", + $stat_writeable = ((($contact['notify']) && ($contact['rel'] == REL_VIP || $contact['rel'] == REL_BUD)) ? 1 : 0); + + if($stat_writeable != $contact['writable']) { + q("UPDATE `contact` SET `writable` = %d WHERE `id` = %d LIMIT 1", + intval($stat_writeable), intval($contact['id']) ); } + // Are we allowed to import from this person? + + if($contact['rel'] == REL_VIP || $contact['blocked'] || $contact['readonly']) + continue; + $xml = fetch_url($contact['poll']); } elseif($contact['network'] === NETWORK_MAIL) { -- cgit v1.2.3