]> git.mxchange.org Git - friendica.git/commitdiff
better (more consistent) handling of ostatus contacts
authorFriendika <info@friendika.com>
Sat, 2 Jul 2011 01:18:01 +0000 (18:18 -0700)
committerFriendika <info@friendika.com>
Sat, 2 Jul 2011 01:18:01 +0000 (18:18 -0700)
boot.php
include/poller.php

index b81bd9cfc7e1c23904f65a309fa51fc88cd3b5f3..2c7836301a51e78d4296d8fc361d098661be053e 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -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      );
 
index 5565130e99714045373689d2a78d449d5088ec4e..569eb59d1cb97fbf5d4df7bb169e7544e071aff6 100644 (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) {