Ensure that an existing contact isn't archived or pending
This commit is contained in:
parent
6c34196264
commit
b1222e174e
1 changed files with 4 additions and 1 deletions
|
@ -2105,11 +2105,14 @@ class Contact extends BaseObject
|
||||||
$network = $pub_contact['network'];
|
$network = $pub_contact['network'];
|
||||||
|
|
||||||
if (is_array($contact)) {
|
if (is_array($contact)) {
|
||||||
|
// Make sure that the existing contact isn't archived
|
||||||
|
self::unmarkForArchival($contact);
|
||||||
|
|
||||||
$protocol = self::getProtocol($url, $contact['network']);
|
$protocol = self::getProtocol($url, $contact['network']);
|
||||||
|
|
||||||
if (($contact['rel'] == self::SHARING)
|
if (($contact['rel'] == self::SHARING)
|
||||||
|| ($sharing && $contact['rel'] == self::FOLLOWER)) {
|
|| ($sharing && $contact['rel'] == self::FOLLOWER)) {
|
||||||
DBA::update('contact', ['rel' => self::FRIEND, 'writable' => true],
|
DBA::update('contact', ['rel' => self::FRIEND, 'writable' => true, 'pending' => false],
|
||||||
['id' => $contact['id'], 'uid' => $importer['uid']]);
|
['id' => $contact['id'], 'uid' => $importer['uid']]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue