2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Initial chat-translation feature implementation.

This commit is contained in:
John Preston
2023-01-26 19:36:43 +04:00
parent 02a0ca7112
commit 719466fcac
40 changed files with 1356 additions and 141 deletions

View File

@@ -56,52 +56,53 @@ struct PeerUpdate {
None = 0,
// Common flags
Name = (1ULL << 0),
Username = (1ULL << 1),
Photo = (1ULL << 2),
About = (1ULL << 3),
Notifications = (1ULL << 4),
Migration = (1ULL << 5),
UnavailableReason = (1ULL << 6),
ChatThemeEmoji = (1ULL << 7),
IsBlocked = (1ULL << 8),
MessagesTTL = (1ULL << 9),
FullInfo = (1ULL << 10),
Usernames = (1ULL << 11),
Name = (1ULL << 0),
Username = (1ULL << 1),
Photo = (1ULL << 2),
About = (1ULL << 3),
Notifications = (1ULL << 4),
Migration = (1ULL << 5),
UnavailableReason = (1ULL << 6),
ChatThemeEmoji = (1ULL << 7),
IsBlocked = (1ULL << 8),
MessagesTTL = (1ULL << 9),
FullInfo = (1ULL << 10),
Usernames = (1ULL << 11),
TranslationDisabled = (1ULL << 12),
// For users
CanShareContact = (1ULL << 12),
IsContact = (1ULL << 13),
PhoneNumber = (1ULL << 14),
OnlineStatus = (1ULL << 15),
BotCommands = (1ULL << 16),
BotCanBeInvited = (1ULL << 17),
BotStartToken = (1ULL << 18),
CommonChats = (1ULL << 19),
HasCalls = (1ULL << 20),
SupportInfo = (1ULL << 21),
IsBot = (1ULL << 22),
EmojiStatus = (1ULL << 23),
CanShareContact = (1ULL << 13),
IsContact = (1ULL << 14),
PhoneNumber = (1ULL << 15),
OnlineStatus = (1ULL << 16),
BotCommands = (1ULL << 17),
BotCanBeInvited = (1ULL << 18),
BotStartToken = (1ULL << 19),
CommonChats = (1ULL << 20),
HasCalls = (1ULL << 21),
SupportInfo = (1ULL << 22),
IsBot = (1ULL << 23),
EmojiStatus = (1ULL << 24),
// For chats and channels
InviteLinks = (1ULL << 24),
Members = (1ULL << 25),
Admins = (1ULL << 26),
BannedUsers = (1ULL << 27),
Rights = (1ULL << 28),
PendingRequests = (1ULL << 29),
Reactions = (1ULL << 30),
InviteLinks = (1ULL << 25),
Members = (1ULL << 26),
Admins = (1ULL << 27),
BannedUsers = (1ULL << 28),
Rights = (1ULL << 29),
PendingRequests = (1ULL << 30),
Reactions = (1ULL << 31),
// For channels
ChannelAmIn = (1ULL << 31),
StickersSet = (1ULL << 32),
ChannelLinkedChat = (1ULL << 33),
ChannelLocation = (1ULL << 34),
Slowmode = (1ULL << 35),
GroupCall = (1ULL << 36),
ChannelAmIn = (1ULL << 32),
StickersSet = (1ULL << 33),
ChannelLinkedChat = (1ULL << 34),
ChannelLocation = (1ULL << 35),
Slowmode = (1ULL << 36),
GroupCall = (1ULL << 37),
// For iteration
LastUsedBit = (1ULL << 36),
LastUsedBit = (1ULL << 37),
};
using Flags = base::flags<Flag>;
friend inline constexpr auto is_flag_type(Flag) { return true; }
@@ -128,8 +129,10 @@ struct HistoryUpdate {
OutboxRead = (1U << 10),
BotKeyboard = (1U << 11),
CloudDraft = (1U << 12),
TranslateFrom = (1U << 13),
TranslatedTo = (1U << 14),
LastUsedBit = (1U << 12),
LastUsedBit = (1U << 14),
};
using Flags = base::flags<Flag>;
friend inline constexpr auto is_flag_type(Flag) { return true; }