2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Update all messages in case of chat reactions toggle.

This commit is contained in:
John Preston
2021-12-29 01:06:01 +03:00
parent ec16ca7df7
commit a8bc7baa70
10 changed files with 70 additions and 25 deletions

View File

@@ -317,6 +317,12 @@ void Reactions::poll(not_null<HistoryItem*> item, crl::time now) {
}
}
void Reactions::updateAllInHistory(not_null<PeerData*> peer, bool enabled) {
if (const auto history = _owner->historyLoaded(peer)) {
history->reactionsEnabledChanged(enabled);
}
}
void Reactions::repaintCollected() {
const auto now = crl::now();
auto closest = 0;
@@ -407,7 +413,6 @@ void MessageReactions::remove() {
void MessageReactions::set(
const QVector<MTPReactionCount> &list,
bool ignoreChosen) {
_lastRefreshTime = crl::now();
if (_item->history()->owner().reactions().sending(_item)) {
// We'll apply non-stale data from the request response.
return;
@@ -458,10 +463,6 @@ bool MessageReactions::empty() const {
return _list.empty();
}
crl::time MessageReactions::lastRefreshTime() const {
return _lastRefreshTime;
}
QString MessageReactions::chosen() const {
return _chosen;
}