]> git.mxchange.org Git - friendica.git/commitdiff
Only add tags in the "tags" scope
authorMichael <heluecht@pirati.ca>
Mon, 26 Mar 2018 06:11:55 +0000 (06:11 +0000)
committerMichael <heluecht@pirati.ca>
Mon, 26 Mar 2018 06:11:55 +0000 (06:11 +0000)
src/Protocol/PortableContact.php

index c7f58b9fb2adb67c7033100b06cf4ee2b309e01c..9c7ad538ccc167f52b36be292572946b16c709e1 100644 (file)
@@ -1378,7 +1378,7 @@ class PortableContact
                        dba::insert('gserver', $fields);
                }
 
-               if (in_array($fields['network'], [NETWORK_DFRN, NETWORK_DIASPORA])) {
+               if (!$failure && in_array($fields['network'], [NETWORK_DFRN, NETWORK_DIASPORA])) {
                        self::discoverRelay(server_url);
                }
 
@@ -1410,8 +1410,10 @@ class PortableContact
                dba::update('gserver', $fields, ['id' => $gserver['id']]);
 
                dba::delete('gserver-tag', ['gserver-id' => $gserver['id']]);
-               foreach ($data->tags as $tag) {
-                       dba::insert('gserver-tag', ['gserver-id' => $gserver['id'], 'tag' => $tag]);
+               if ($data->scope == 'tags') {
+                       foreach ($data->tags as $tag) {
+                               dba::insert('gserver-tag', ['gserver-id' => $gserver['id'], 'tag' => $tag]);
+                       }
                }
        }