mirror of
https://github.com/friendica/friendica
synced 2024-12-23 02:40:17 +00:00
Merge pull request #12833 from annando/ostatus-like
Fix emoji activities
This commit is contained in:
commit
6870ccc00e
3 changed files with 4 additions and 4 deletions
|
@ -1146,8 +1146,8 @@ class Conversation
|
||||||
|
|
||||||
$emojis[$row['thr-parent-id']][$index]['emoji'] = $emoji;
|
$emojis[$row['thr-parent-id']][$index]['emoji'] = $emoji;
|
||||||
$emojis[$row['thr-parent-id']][$index]['verb'] = $row['verb'];
|
$emojis[$row['thr-parent-id']][$index]['verb'] = $row['verb'];
|
||||||
$emojis[$row['thr-parent-id']][$index]['total'] = $emojis[$row['thr-parent-id']][$emoji]['total'] ?? 0 + $row['total'];
|
$emojis[$row['thr-parent-id']][$index]['total'] = ($emojis[$row['thr-parent-id']][$index]['total'] ?? 0) + $row['total'];
|
||||||
$emojis[$row['thr-parent-id']][$index]['title'] = array_unique(array_merge($emojis[$row['thr-parent-id']][$emoji]['title'] ?? [], explode($separator, $row['title'])));
|
$emojis[$row['thr-parent-id']][$index]['title'] = array_unique(array_merge($emojis[$row['thr-parent-id']][$index]['title'] ?? [], explode($separator, $row['title'])));
|
||||||
}
|
}
|
||||||
DBA::close($rows);
|
DBA::close($rows);
|
||||||
|
|
||||||
|
|
|
@ -1212,7 +1212,7 @@ class Item
|
||||||
}
|
}
|
||||||
|
|
||||||
// The content of activities normally doesn't matter - except for likes from Misskey
|
// The content of activities normally doesn't matter - except for likes from Misskey
|
||||||
if (!in_array($item['verb'], self::ACTIVITIES) || in_array($item['verb'], [Activity::LIKE, Activity::DISLIKE]) && !empty($item['body']) && ($item['body'] != $item['verb'])) {
|
if (!in_array($item['verb'], self::ACTIVITIES) || in_array($item['verb'], [Activity::LIKE, Activity::DISLIKE]) && !empty($item['body']) && (mb_strlen($item['body']) == 1)) {
|
||||||
Post\Content::insert($item['uri-id'], $item);
|
Post\Content::insert($item['uri-id'], $item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -496,7 +496,7 @@ class OStatus
|
||||||
$orig_uri = $xpath->query('activity:object/atom:id', $entry)->item(0)->nodeValue;
|
$orig_uri = $xpath->query('activity:object/atom:id', $entry)->item(0)->nodeValue;
|
||||||
Logger::notice('Favorite', ['uri' => $orig_uri, 'item' => $item]);
|
Logger::notice('Favorite', ['uri' => $orig_uri, 'item' => $item]);
|
||||||
|
|
||||||
$item['verb'] = Activity::LIKE;
|
$item['body'] = $item['verb'] = Activity::LIKE;
|
||||||
$item['thr-parent'] = $orig_uri;
|
$item['thr-parent'] = $orig_uri;
|
||||||
$item['gravity'] = Item::GRAVITY_ACTIVITY;
|
$item['gravity'] = Item::GRAVITY_ACTIVITY;
|
||||||
$item['object-type'] = Activity\ObjectType::NOTE;
|
$item['object-type'] = Activity\ObjectType::NOTE;
|
||||||
|
|
Loading…
Reference in a new issue