2020-01-27 14:06:00 +01:00
|
|
|
//
|
2022-01-01 01:35:39 +01:00
|
|
|
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2022
|
2020-01-27 14:06:00 +01:00
|
|
|
//
|
|
|
|
// 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/StringBuilder.h"
|
|
|
|
|
2020-11-08 12:00:36 +01:00
|
|
|
#include <functional>
|
|
|
|
|
2020-01-27 14:06:00 +01:00
|
|
|
namespace td {
|
|
|
|
|
2021-04-05 23:40:31 +02:00
|
|
|
// increase MessageUnsupported::CURRENT_VERSION each time a new message content type is added
|
2020-01-27 14:06:00 +01:00
|
|
|
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,
|
2020-03-14 17:56:39 +01:00
|
|
|
Poll,
|
2020-10-19 19:44:09 +02:00
|
|
|
Dice,
|
2020-11-24 12:33:16 +01:00
|
|
|
ProximityAlertTriggered,
|
|
|
|
GroupCall,
|
2021-08-18 15:03:10 +02:00
|
|
|
InviteToGroupCall,
|
2022-03-28 09:01:39 +02:00
|
|
|
ChatSetTheme,
|
|
|
|
WebViewDataSent,
|
2022-07-01 14:28:22 +02:00
|
|
|
WebViewDataReceived,
|
2022-10-18 15:08:53 +02:00
|
|
|
GiftPremium,
|
2022-10-18 21:16:03 +02:00
|
|
|
TopicCreate,
|
|
|
|
TopicEdit
|
2020-01-27 14:06:00 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
StringBuilder &operator<<(StringBuilder &string_builder, MessageContentType content_type);
|
|
|
|
|
|
|
|
bool is_allowed_media_group_content(MessageContentType content_type);
|
|
|
|
|
2020-10-15 17:13:54 +02:00
|
|
|
bool is_homogenous_media_group_content(MessageContentType content_type);
|
|
|
|
|
2020-01-27 14:06:00 +01:00
|
|
|
bool is_secret_message_content(int32 ttl, MessageContentType content_type);
|
|
|
|
|
|
|
|
bool is_service_message_content(MessageContentType content_type);
|
|
|
|
|
|
|
|
bool can_have_message_content_caption(MessageContentType content_type);
|
|
|
|
|
2022-02-05 21:28:43 +01:00
|
|
|
uint64 get_message_content_chain_id(MessageContentType content_type);
|
|
|
|
|
2020-11-06 00:05:15 +01:00
|
|
|
struct MessageContentTypeHash {
|
|
|
|
std::size_t operator()(MessageContentType content_type) const {
|
|
|
|
return std::hash<int32>()(static_cast<int32>(content_type));
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2020-01-27 14:06:00 +01:00
|
|
|
} // namespace td
|