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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
|
//
// 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/utils/common.h"
#include "td/utils/HashTableUtils.h"
#include "td/utils/StringBuilder.h"
namespace td {
enum class MessageContentType : int32 {
None = -1,
Text,
Animation,
Audio,
Document,
Photo,
Sticker,
Video,
VoiceNote,
Contact,
Location,
Venue,
ChatCreate,
ChatChangeTitle,
ChatChangePhoto,
ChatDeletePhoto,
ChatDeleteHistory,
ChatAddUsers,
ChatJoinedByLink,
ChatDeleteUser,
ChatMigrateTo,
ChannelCreate,
ChannelMigrateFrom,
PinMessage,
Game,
GameScore,
ScreenshotTaken,
ChatSetTtl,
Unsupported,
Call,
Invoice,
PaymentSuccessful,
VideoNote,
ContactRegistered,
ExpiredPhoto,
ExpiredVideo,
LiveLocation,
CustomServiceAction,
WebsiteConnected,
PassportDataSent,
PassportDataReceived,
Poll,
Dice,
ProximityAlertTriggered,
GroupCall,
InviteToGroupCall,
ChatSetTheme,
WebViewDataSent,
WebViewDataReceived,
GiftPremium,
TopicCreate,
TopicEdit,
SuggestProfilePhoto,
WriteAccessAllowed,
RequestedDialog,
WebViewWriteAccessAllowed,
SetBackground,
Story,
WriteAccessAllowedByRequest,
GiftCode,
Giveaway,
GiveawayLaunch,
GiveawayResults,
GiveawayWinners,
ExpiredVideoNote,
ExpiredVoiceNote,
BoostApply,
DialogShared,
PaidMedia,
PaymentRefunded,
GiftStars,
PrizeStars,
StarGift,
StarGiftUnique,
PaidMessagesRefunded,
PaidMessagesPrice,
ConferenceCall,
ToDoList,
TodoCompletions,
TodoAppendTasks,
GiftTon,
SuggestedPostSuccess,
SuggestedPostRefund,
SuggestedPostApproval,
SuggestBirthday,
StarGiftPurchaseOffer,
StarGiftPurchaseOfferDeclined,
NewCreatorPending,
ChangeCreator,
NoForwardsToggle,
NoForwardsRequest,
ManagedBotCreated,
PollAppendAnswer,
PollDeleteAnswer,
RichText,
ChangeCommunity
};
// increase MessageUnsupported::CURRENT_VERSION each time a new message content type is added
StringBuilder &operator<<(StringBuilder &string_builder, MessageContentType content_type);
bool is_allowed_invert_caption_message_content(MessageContentType content_type);
bool is_allowed_media_group_content(MessageContentType content_type);
bool is_homogenous_media_group_content(MessageContentType content_type);
bool is_allowed_poll_content(MessageContentType content_type);
bool is_allowed_poll_option_content(MessageContentType content_type);
bool can_message_content_have_multiple_files(MessageContentType content_type);
bool can_be_secret_message_content(MessageContentType content_type);
bool can_be_local_message_content(MessageContentType content_type);
bool is_service_message_content(MessageContentType content_type);
bool is_editable_message_content(MessageContentType content_type);
bool is_supported_reply_message_content(MessageContentType content_type);
bool is_expired_message_content(MessageContentType content_type);
MessageContentType get_expired_message_content_type(MessageContentType content_type);
bool can_have_message_content_caption(MessageContentType content_type);
bool can_send_message_content_to_secret_chat(MessageContentType content_type);
uint64 get_message_content_chain_id(MessageContentType content_type);
bool get_default_service_message_content_reactions_are_possible(MessageContentType content_type);
struct MessageContentTypeHash {
uint32 operator()(MessageContentType content_type) const {
return Hash<int32>()(static_cast<int32>(content_type));
}
};
} // namespace td
|