This commit is contained in:
Michael 2023-12-31 05:15:25 +00:00
parent 22b01992d2
commit 72f5a64cf3
2 changed files with 4 additions and 7 deletions

View file

@ -1062,9 +1062,6 @@ class Conversation
if (isset($emojis[$row['thr-parent-id']][$emoji]['title'])) {
$emojis[$row['thr-parent-id']][$emoji]['title'] = array_unique(array_merge($emojis[$row['thr-parent-id']][$emoji]['title'] ?? [], explode($separator, $row['title'])));
} else {
Post\Counts::updateForPost($row['thr-parent-id'], $row['parent-uri-id']);
$this->logger->debug('Add missing counts', ['thr-parent-id' => $row['thr-parent-id'], 'parent-uri-id' => $row['parent-uri-id'], 'emoji' => $emoji]);
}
}
DBA::close($rows);

View file

@ -106,16 +106,16 @@ class Counts
Activity::READ => '📖',
];
$vids = array_merge(array_keys($activity_emoji), [Activity::EMOJIREACT, Activity::POST]);
$verbs = array_merge(array_keys($activity_emoji), [Activity::EMOJIREACT, Activity::POST]);
$condition = DBA::mergeConditions($condition, ['verb' => $vids]);
$condition = DBA::mergeConditions($condition, ['verb' => $verbs]);
$countquery = DBA::select('post-counts-view', [], $condition);
while ($count = DBA::fetch($countquery)) {
if (!empty($count['reaction'])) {
$count['verb'] = Activity::EMOJIREACT;
$count['vid'] = Verb::getID($count['verb']);
} elseif (!empty($activity_emoji[$count['vid']])) {
$count['reaction'] = $activity_emoji[$count['vid']];
} elseif (!empty($activity_emoji[$count['verb']])) {
$count['reaction'] = $activity_emoji[$count['verb']];
}
$counts[] = $count;
}