mirror of
https://github.com/friendica/friendica
synced 2025-04-28 00:30:10 +00:00
Store the receivers of a post in the tags
This commit is contained in:
parent
c03ff7833b
commit
c867581530
7 changed files with 173 additions and 78 deletions
|
@ -526,6 +526,8 @@ class Processor
|
|||
self::storeFromBody($item);
|
||||
self::storeTags($item['uri-id'], $activity['tags']);
|
||||
|
||||
self::storeReceivers($item['uri-id'], $activity['receiver_urls'] ?? []);
|
||||
|
||||
$item['location'] = $activity['location'];
|
||||
|
||||
if (!empty($activity['latitude']) && !empty($activity['longitude'])) {
|
||||
|
@ -756,6 +758,22 @@ class Processor
|
|||
}
|
||||
}
|
||||
|
||||
public static function storeReceivers(int $uriid, array $receivers)
|
||||
{
|
||||
foreach (['as:to' => Tag::TO, 'as:cc' => Tag::CC, 'as:bto' => Tag::BTO, 'as:bcc' => Tag::BCC] as $element => $type) {
|
||||
if (!empty($receivers[$element])) {
|
||||
foreach ($receivers[$element] as $receiver) {
|
||||
if ($receiver == ActivityPub::PUBLIC_COLLECTION) {
|
||||
$name = Receiver::PUBLIC_COLLECTION;
|
||||
} else {
|
||||
$name = trim(parse_url($receiver, PHP_URL_PATH), '/');
|
||||
}
|
||||
Tag::store($uriid, $type, $name, $receiver);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an mail post
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue