2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 22:55:11 +00:00

Use available reactions list from the server.

This commit is contained in:
John Preston
2021-12-07 15:11:27 +04:00
parent be74f8f2bc
commit b1668afdf1
11 changed files with 212 additions and 18 deletions

View File

@@ -12,6 +12,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
#include "data/data_session.h"
#include "data/data_changes.h"
#include "data/data_group_call.h"
#include "data/data_message_reactions.h"
#include "history/history.h"
#include "main/main_session.h"
#include "apiwrap.h"
@@ -286,6 +287,14 @@ void ChatData::setPendingRequestsCount(
}
}
void ChatData::setAllowedReactions(std::vector<QString> list) {
_allowedReactions = std::move(list);
}
const std::vector<QString> &ChatData::allowedReactions() const {
return _allowedReactions;
}
namespace Data {
void ApplyChatUpdate(
@@ -457,6 +466,8 @@ void ApplyChatUpdate(not_null<ChatData*> chat, const MTPDchatFull &update) {
}
chat->checkFolder(update.vfolder_id().value_or_empty());
chat->setThemeEmoji(qs(update.vtheme_emoticon().value_or_empty()));
chat->setAllowedReactions(
Data::Reactions::ParseAllowed(update.vavailable_reactions()));
chat->fullUpdated();
chat->setAbout(qs(update.vabout()));
chat->setPendingRequestsCount(