+ $salmon->post($oprofile->salmonuri, $xml);
+ }
+ }
+ }
+
+ /**
+ *
+ */
+
+ function onEndFindMentions($sender, $text, &$mentions)
+ {
+ preg_match_all('/(?:^|\s+)@((?:\w+\.)*\w+@(?:\w+\.)*\w+(?:\w+\-\w+)*\.\w+)/',
+ $text,
+ $wmatches,
+ PREG_OFFSET_CAPTURE);
+
+ foreach ($wmatches[1] as $wmatch) {
+
+ $webfinger = $wmatch[0];
+
+ $oprofile = Ostatus_profile::ensureWebfinger($webfinger);
+
+ if (!empty($oprofile)) {
+
+ $profile = $oprofile->localProfile();
+
+ $mentions[] = array('mentioned' => array($profile),
+ 'text' => $wmatch[0],
+ 'position' => $wmatch[1],
+ 'url' => $profile->profileurl);