1
0
Fork 0

Fix emoji activities

This commit is contained in:
Michael 2023-02-21 21:07:41 +00:00
parent f4af683af2
commit 08ba9e4183
3 changed files with 4 additions and 4 deletions

View file

@ -1146,8 +1146,8 @@ class Conversation
$emojis[$row['thr-parent-id']][$index]['emoji'] = $emoji;
$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]['title'] = array_unique(array_merge($emojis[$row['thr-parent-id']][$emoji]['title'] ?? [], explode($separator, $row['title'])));
$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']][$index]['title'] ?? [], explode($separator, $row['title'])));
}
DBA::close($rows);

View file

@ -1212,7 +1212,7 @@ class Item
}
// 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);
}

View file

@ -496,7 +496,7 @@ class OStatus
$orig_uri = $xpath->query('activity:object/atom:id', $entry)->item(0)->nodeValue;
Logger::notice('Favorite', ['uri' => $orig_uri, 'item' => $item]);
$item['verb'] = Activity::LIKE;
$item['body'] = $item['verb'] = Activity::LIKE;
$item['thr-parent'] = $orig_uri;
$item['gravity'] = Item::GRAVITY_ACTIVITY;
$item['object-type'] = Activity\ObjectType::NOTE;