2020-01-27 14:06:00 +01:00
|
|
|
//
|
2024-01-01 01:07:21 +01:00
|
|
|
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2024
|
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"
|
2022-11-23 17:37:32 +01:00
|
|
|
#include "td/utils/HashTableUtils.h"
|
2020-01-27 14:06:00 +01:00
|
|
|
#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,
|
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,
|
2022-12-09 12:13:37 +01:00
|
|
|
TopicEdit,
|
2022-12-14 19:13:48 +01:00
|
|
|
SuggestProfilePhoto,
|
2023-01-10 14:20:30 +01:00
|
|
|
WriteAccessAllowed,
|
2023-02-22 10:24:43 +01:00
|
|
|
RequestedDialog,
|
2023-04-10 13:12:35 +02:00
|
|
|
WebViewWriteAccessAllowed,
|
2023-06-12 18:23:58 +02:00
|
|
|
SetBackground,
|
2023-08-25 15:53:50 +02:00
|
|
|
Story,
|
2023-09-29 16:55:03 +02:00
|
|
|
WriteAccessAllowedByRequest,
|
2023-09-29 23:32:39 +02:00
|
|
|
GiftCode,
|
2023-10-16 10:31:11 +02:00
|
|
|
Giveaway,
|
2023-11-09 18:28:27 +01:00
|
|
|
GiveawayLaunch,
|
2023-12-18 19:03:11 +01:00
|
|
|
GiveawayResults,
|
2024-01-02 12:27:11 +01:00
|
|
|
GiveawayWinners,
|
|
|
|
ExpiredVideoNote,
|
2024-02-07 18:50:00 +01:00
|
|
|
ExpiredVoiceNote,
|
2024-03-21 22:43:18 +01:00
|
|
|
BoostApply,
|
2024-06-21 11:25:23 +02:00
|
|
|
DialogShared,
|
2024-07-04 19:38:40 +02:00
|
|
|
PaidMedia,
|
|
|
|
PaymentRefunded
|
2020-01-27 14:06:00 +01:00
|
|
|
};
|
2023-05-18 14:44:00 +02:00
|
|
|
// increase MessageUnsupported::CURRENT_VERSION each time a new message content type is added
|
2020-01-27 14:06:00 +01:00
|
|
|
|
|
|
|
StringBuilder &operator<<(StringBuilder &string_builder, MessageContentType content_type);
|
|
|
|
|
2024-05-15 22:59:15 +02:00
|
|
|
bool is_allowed_invert_caption_message_content(MessageContentType content_type);
|
|
|
|
|
2020-01-27 14:06:00 +01:00
|
|
|
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);
|
|
|
|
|
2024-01-30 13:07:21 +01:00
|
|
|
bool can_be_secret_message_content(MessageContentType content_type);
|
2020-01-27 14:06:00 +01:00
|
|
|
|
2024-06-22 10:05:35 +02:00
|
|
|
bool can_be_local_message_content(MessageContentType content_type);
|
|
|
|
|
2020-01-27 14:06:00 +01:00
|
|
|
bool is_service_message_content(MessageContentType content_type);
|
|
|
|
|
2024-02-23 18:19:54 +01:00
|
|
|
bool is_editable_message_content(MessageContentType content_type);
|
|
|
|
|
2023-12-21 15:24:21 +01:00
|
|
|
bool is_supported_reply_message_content(MessageContentType content_type);
|
|
|
|
|
2024-01-02 12:27:11 +01:00
|
|
|
bool is_expired_message_content(MessageContentType content_type);
|
|
|
|
|
2024-06-21 13:00:29 +02:00
|
|
|
MessageContentType get_expired_message_content_type(MessageContentType content_type);
|
|
|
|
|
2020-01-27 14:06:00 +01:00
|
|
|
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 {
|
2022-11-23 17:37:32 +01:00
|
|
|
uint32 operator()(MessageContentType content_type) const {
|
|
|
|
return Hash<int32>()(static_cast<int32>(content_type));
|
2020-11-06 00:05:15 +01:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2020-01-27 14:06:00 +01:00
|
|
|
} // namespace td
|