From 6b84cb97153864fc94f90ef97a61caf7803eed74 Mon Sep 17 00:00:00 2001 From: Michael Date: Mon, 26 Mar 2018 06:11:55 +0000 Subject: [PATCH] Only add tags in the "tags" scope --- src/Protocol/PortableContact.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Protocol/PortableContact.php b/src/Protocol/PortableContact.php index c7f58b9fb..9c7ad538c 100644 --- a/src/Protocol/PortableContact.php +++ b/src/Protocol/PortableContact.php @@ -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]); + } } }