// Directly mention the original author upon a quoted reshare.
// Else just ensure that the original author receives the reshare.
- $announce = self::getAnnounceObject($item);
+ $announce = self::getAnnounceArray($item);
if (!empty($announce['comment'])) {
$data['to'][] = $announce['actor']['url'];
} elseif (!empty($announce)) {
// Only check for a reshare, if it is a real reshare and no quoted reshare
if (strpos($item['body'], "[share") === 0) {
- $announce = self::getAnnounceObject($item);
+ $announce = self::getAnnounceArray($item);
$reshared = !empty($announce);
}
}
}
- $announce = self::getAnnounceObject($item);
+ $announce = self::getAnnounceArray($item);
// Mention the original author upon commented reshares
if (!empty($announce['comment'])) {
$tags[] = ['type' => 'Mention', 'href' => $announce['actor']['url'], 'name' => '@' . $announce['actor']['addr']];
private static function createAnnounce($item, $data)
{
$orig_body = $item['body'];
- $announce = self::getAnnounceObject($item);
+ $announce = self::getAnnounceArray($item);
if (empty($announce)) {
$data['type'] = 'Create';
$data['object'] = self::createNote($item);
*
* @return array
*/
- public static function getAnnounceObject($item)
+ public static function getAnnounceArray($item)
{
if (!preg_match("/(.*?)\[share(.*?)\]\s?.*?\s?\[\/share\]\s?/ism", $item['body'], $matches)) {
return [];