better (more consistent) handling of ostatus contacts

This commit is contained in:
Friendika 2011-07-01 18:18:01 -07:00
parent c23657ab6e
commit d28d2ff440
2 changed files with 12 additions and 3 deletions

View File

@ -4,7 +4,7 @@ set_time_limit(0);
ini_set('pcre.backtrack_limit', 250000);
define ( 'FRIENDIKA_VERSION', '2.2.1027' );
define ( 'FRIENDIKA_VERSION', '2.2.1028' );
define ( 'DFRN_PROTOCOL_VERSION', '2.21' );
define ( 'DB_UPDATE_VERSION', 1071 );

View File

@ -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) {