Added group detection for via exclusive mentions
This commit is contained in:
parent
d2b02d07b4
commit
f6b9f8d476
1 changed files with 14 additions and 0 deletions
|
@ -442,6 +442,7 @@ class Processor
|
||||||
$item['isGroup'] = true;
|
$item['isGroup'] = true;
|
||||||
$item['group-link'] = $item['owner-link'] = $audience;
|
$item['group-link'] = $item['owner-link'] = $audience;
|
||||||
$item['owner-id'] = Contact::getIdForURL($audience);
|
$item['owner-id'] = Contact::getIdForURL($audience);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -902,6 +903,19 @@ class Processor
|
||||||
$item['raw-body'] = $item['body'] = $content;
|
$item['raw-body'] = $item['body'] = $content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!empty($item['author-id']) && ($item['author-id'] == $item['owner-id'])) {
|
||||||
|
foreach (Tag::getFromBody($item['body'], Tag::TAG_CHARACTER[Tag::EXCLUSIVE_MENTION]) as $tag) {
|
||||||
|
$actor = APContact::getByURL($tag[2], false);
|
||||||
|
if (($actor['type'] ?? 'Person') == 'Group') {
|
||||||
|
Logger::debug('Group post detected via exclusive mention.', ['mention' => $actor['url'], 'actor' => $activity['actor'], 'author' => $activity['author']]);
|
||||||
|
$item['isGroup'] = true;
|
||||||
|
$item['group-link'] = $item['owner-link'] = $actor['url'];
|
||||||
|
$item['owner-id'] = Contact::getIdForURL($actor['url']);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
self::storeFromBody($item);
|
self::storeFromBody($item);
|
||||||
self::storeTags($item['uri-id'], $activity['tags']);
|
self::storeTags($item['uri-id'], $activity['tags']);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue