We now set the protocol in "gserver" on receiving as well

This commit is contained in:
Michael 2021-03-10 22:31:33 +00:00
parent 5e98a38ac9
commit 9e87dcb25b
6 changed files with 65 additions and 3 deletions

View file

@ -33,6 +33,7 @@ use Friendica\Model\APContact;
use Friendica\Model\Contact;
use Friendica\Model\Conversation;
use Friendica\Model\Event;
use Friendica\Model\GServer;
use Friendica\Model\Item;
use Friendica\Model\ItemURI;
use Friendica\Model\Mail;
@ -367,6 +368,19 @@ class Processor
$item = self::constructAttachList($activity, $item);
// We received the post via AP, so we set the protocol of the server to AP
$contact = Contact::getById($item['author-id'], ['gsid']);
if (!empty($contact['gsid'])) {
GServer::setProtocol($contact['gsid'], Post\DeliveryData::ACTIVITYPUB);
}
if ($item['author-id'] != $item['owner-id']) {
$contact = Contact::getById($item['owner-id'], ['gsid']);
if (!empty($contact['gsid'])) {
GServer::setProtocol($contact['gsid'], Post\DeliveryData::ACTIVITYPUB);
}
}
return $item;
}