mirror of
https://github.com/friendica/friendica
synced 2025-04-22 16:30:11 +00:00
We now set the protocol in "gserver" on receiving as well
This commit is contained in:
parent
5e98a38ac9
commit
9e87dcb25b
6 changed files with 65 additions and 3 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue