blob: 91683b2cb588e986a442828c8189b239bb1e153e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
//
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2026
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#pragma once
#include "td/telegram/ChatReactions.h"
#include "td/telegram/ReactionType.hpp"
#include "td/utils/common.h"
#include "td/utils/tl_helpers.h"
namespace td {
template <class StorerT>
void ChatReactions::store(StorerT &storer) const {
bool has_reactions = !reaction_types_.empty();
bool has_reactions_limit = reactions_limit_ != 0;
BEGIN_STORE_FLAGS();
STORE_FLAG(allow_all_regular_);
STORE_FLAG(allow_all_custom_);
STORE_FLAG(has_reactions);
STORE_FLAG(has_reactions_limit);
STORE_FLAG(paid_reactions_available_);
END_STORE_FLAGS();
if (has_reactions) {
td::store(reaction_types_, storer);
}
if (has_reactions_limit) {
td::store(reactions_limit_, storer);
}
}
template <class ParserT>
void ChatReactions::parse(ParserT &parser) {
bool has_reactions;
bool has_reactions_limit;
BEGIN_PARSE_FLAGS();
PARSE_FLAG(allow_all_regular_);
PARSE_FLAG(allow_all_custom_);
PARSE_FLAG(has_reactions);
PARSE_FLAG(has_reactions_limit);
PARSE_FLAG(paid_reactions_available_);
END_PARSE_FLAGS();
if (has_reactions) {
td::parse(reaction_types_, parser);
}
if (has_reactions_limit) {
td::parse(reactions_limit_, parser);
}
}
} // namespace td
|