New function for contact suggestions

This commit is contained in:
Michael 2020-09-28 21:33:40 +00:00
parent 7252e0b37c
commit fb50a43ac0
6 changed files with 63 additions and 153 deletions

View file

@ -164,19 +164,16 @@ class Introduction extends BaseModel
}
$contact = Contact::selectFirst([], ['id' => $this->{'contact-id'}, 'uid' => $this->uid]);
if (!empty($contact)) {
if (!empty($contact['protocol'])) {
$protocol = $contact['protocol'];
} else {
$protocol = $contact['network'];
}
if (!$contact) {
throw new HTTPException\NotFoundException('Contact record not found.');
}
if (!empty($contact['protocol'])) {
$protocol = $contact['protocol'];
} else {
$protocol = $contact['network'];
}
if ($protocol == Protocol::ACTIVITYPUB) {
ActivityPub\Transmitter::sendContactReject($contact['url'], $contact['hub-verify'], $contact['uid']);
if ($protocol == Protocol::ACTIVITYPUB) {
ActivityPub\Transmitter::sendContactReject($contact['url'], $contact['hub-verify'], $contact['uid']);
}
}
return $this->intro->delete($this);