X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FModel%2FContact%2FIntroduction.php;h=d78673665037ea51c9226e01f9fc2080c057b263;hb=1ca711802708878a76d29ee4dfcffe4c3c92f1f6;hp=692ba7befecfdef31e0f75c91121c8bbc0722677;hpb=a40f503fddc9f4b0b7619388e47a7f6d7eaaaff3;p=friendica.git diff --git a/src/Model/Contact/Introduction.php b/src/Model/Contact/Introduction.php index 692ba7befe..d786736650 100644 --- a/src/Model/Contact/Introduction.php +++ b/src/Model/Contact/Introduction.php @@ -1,6 +1,6 @@ info('Confirming follower', ['cid' => $introduction->cid]); @@ -66,7 +68,7 @@ class Introduction } if (in_array($protocol, [Protocol::DIASPORA, Protocol::ACTIVITYPUB])) { - if ($introduction->duplex) { + if ($duplex) { $newRelation = Contact::FRIEND; } else { $newRelation = Contact::FOLLOWER; @@ -111,23 +113,6 @@ class Introduction */ public static function discard(Entity\Introduction $introduction): void { - // If it is a friend suggestion, the contact is not a new friend but an existing friend - // that should not be deleted. - if (!$introduction->fid) { - // When the contact entry had been created just for that intro, we want to get rid of it now - $condition = [ - 'id' => $introduction->cid, - 'uid' => $introduction->uid, - 'self' => false, - 'pending' => true, - 'rel' => [0, Contact::FOLLOWER]]; - if (DI::dba()->exists('contact', $condition)) { - Contact::remove($introduction->cid); - } else { - Contact::update(['pending' => false], ['id' => $introduction->cid]); - } - } - $contact = Contact::selectFirst([], ['id' => $introduction->cid, 'uid' => $introduction->uid]); if (!empty($contact)) { if (!empty($contact['protocol'])) { @@ -137,7 +122,10 @@ class Introduction } if ($protocol == Protocol::ACTIVITYPUB) { - ActivityPub\Transmitter::sendContactReject($contact['url'], $contact['hub-verify'], $contact['uid']); + $owner = User::getOwnerDataById($contact['uid']); + if ($owner) { + ActivityPub\Transmitter::sendContactReject($contact['url'], $contact['hub-verify'], $owner); + } } } }