diff options
| author | levlam <levlam@telegram.org> | 2022-09-09 16:34:14 +0300 |
|---|---|---|
| committer | levlam <levlam@telegram.org> | 2022-09-09 16:34:14 +0300 |
| commit | 89a1311c91ac394104bef5efb7dbad4d3d9c02c0 (patch) | |
| tree | 936cac1fd827ec4cc5d6beeb3ac9c6642632d573 /td/telegram/ChatReactions.cpp | |
| parent | a223067cd19a162fb4c424400c1302d26fe1d2f1 (diff) | |
Add ChatReactions::is_allowed_reaction.
Diffstat (limited to 'td/telegram/ChatReactions.cpp')
| -rw-r--r-- | td/telegram/ChatReactions.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/td/telegram/ChatReactions.cpp b/td/telegram/ChatReactions.cpp index 44421c679..dc838d5b6 100644 --- a/td/telegram/ChatReactions.cpp +++ b/td/telegram/ChatReactions.cpp @@ -71,6 +71,14 @@ ChatReactions ChatReactions::get_active_reactions(const FlatHashMap<string, size return result; } +bool ChatReactions::is_allowed_reaction(const string &reaction) const { + CHECK(!allow_all_); + if (allow_custom_ && reaction[0] == '#') { + return true; + } + return td::contains(reactions_, reaction); +} + td_api::object_ptr<td_api::ChatAvailableReactions> ChatReactions::get_chat_available_reactions_object() const { if (allow_all_) { return td_api::make_object<td_api::chatAvailableReactionsAll>(); |
