We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 801ca353 authored by mattl's avatar mattl

common_find_attentions to populate activities from content text

parent 3eebf2a3
......@@ -681,6 +681,18 @@ function common_linkify_mention(array $mention)
return $output;
function common_find_attentions($text, Profile $sender, Notice $parent=null)
$mentions = common_find_mentions($text, $sender, $parent);
$atts = array();
foreach ($mentions as $mention) {
foreach ($mention['mentioned'] as $mentioned) {
$atts[$mentioned->getUri()] = $mentioned->isGroup() ? ActivityObject::GROUP : ActivityObject::PERSON;
return $atts;
* Find @-mentions in the given text, using the given notice object as context.
* References will be resolved with common_relative_profile() against the user
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment