mirror of
https://github.com/friendica/friendica
synced 2024-12-23 12:40:17 +00:00
Only update when changed
This commit is contained in:
parent
6b84cb9715
commit
00c444a699
1 changed files with 6 additions and 4 deletions
|
@ -1379,7 +1379,7 @@ class PortableContact
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$failure && in_array($fields['network'], [NETWORK_DFRN, NETWORK_DIASPORA])) {
|
if (!$failure && in_array($fields['network'], [NETWORK_DFRN, NETWORK_DIASPORA])) {
|
||||||
self::discoverRelay(server_url);
|
self::discoverRelay($server_url);
|
||||||
}
|
}
|
||||||
|
|
||||||
logger("End discovery for server " . $server_url, LOGGER_DEBUG);
|
logger("End discovery for server " . $server_url, LOGGER_DEBUG);
|
||||||
|
@ -1401,13 +1401,15 @@ class PortableContact
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$gserver = dba::selectFirst('gserver', ['id'], ['nurl' => normalise_link($server_url)]);
|
$gserver = dba::selectFirst('gserver', ['id', 'relay-subscribe', 'relay-scope'], ['nurl' => normalise_link($server_url)]);
|
||||||
if (!DBM::is_result($gserver)) {
|
if (!DBM::is_result($gserver)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (($gserver['relay-subscribe'] != $data->subscribe) || ($gserver['relay-scope'] != $data->scope)) {
|
||||||
$fields = ['relay-subscribe' => $data->subscribe, 'relay-scope' => $data->scope];
|
$fields = ['relay-subscribe' => $data->subscribe, 'relay-scope' => $data->scope];
|
||||||
dba::update('gserver', $fields, ['id' => $gserver['id']]);
|
dba::update('gserver', $fields, ['id' => $gserver['id']]);
|
||||||
|
}
|
||||||
|
|
||||||
dba::delete('gserver-tag', ['gserver-id' => $gserver['id']]);
|
dba::delete('gserver-tag', ['gserver-id' => $gserver['id']]);
|
||||||
if ($data->scope == 'tags') {
|
if ($data->scope == 'tags') {
|
||||||
|
|
Loading…
Reference in a new issue