diff --git a/src/api/gramjs/apiBuilders/chats.ts b/src/api/gramjs/apiBuilders/chats.ts index 696248622..12a1dd640 100644 --- a/src/api/gramjs/apiBuilders/chats.ts +++ b/src/api/gramjs/apiBuilders/chats.ts @@ -20,7 +20,6 @@ import type { ApiSponsoredMessageReportResult, ApiSponsoredPeer, ApiStarsSubscriptionPricing, - ApiTopic, } from '../../types'; import { pickTruthy } from '../../../util/iteratees'; @@ -38,7 +37,6 @@ import { buildApiEmojiStatus, buildApiPeerColor, buildApiPeerId, - buildApiPeerNotifySettings, buildAvatarPhotoId, getApiChatIdFromMtpPeer, isMtpPeerChat, @@ -552,50 +550,6 @@ export function buildApiSendAsPeerId(sendAs: GramJs.SendAsPeer): ApiSendAsPeerId }; } -export function buildApiTopic(forumTopic: GramJs.TypeForumTopic): ApiTopic | undefined { - if (forumTopic instanceof GramJs.ForumTopicDeleted) { - return undefined; - } - - const { - id, - my, - closed, - pinned, - hidden, - short, - date, - title, - iconColor, - iconEmojiId, - topMessage, - unreadCount, - unreadMentionsCount, - unreadReactionsCount, - fromId, - notifySettings, - } = forumTopic; - - return { - id, - isClosed: closed, - isPinned: pinned, - isHidden: hidden, - isOwner: my, - isMin: short, - date, - title, - iconColor, - iconEmojiId: iconEmojiId?.toString(), - lastMessageId: topMessage, - unreadCount, - unreadMentionsCount, - unreadReactionsCount, - fromId: getApiChatIdFromMtpPeer(fromId), - notifySettings: buildApiPeerNotifySettings(notifySettings), - }; -} - export function buildApiChatlistInvite( invite: GramJs.chatlists.TypeChatlistInvite | undefined, slug: string, ): ApiChatlistInvite | undefined { diff --git a/src/api/gramjs/apiBuilders/forums.ts b/src/api/gramjs/apiBuilders/forums.ts new file mode 100644 index 000000000..a3ffb2493 --- /dev/null +++ b/src/api/gramjs/apiBuilders/forums.ts @@ -0,0 +1,51 @@ +import { Api as GramJs } from '../../../lib/gramjs'; + +import type { ApiTopic } from '../../types'; + +import { buildApiPeerNotifySettings, getApiChatIdFromMtpPeer } from './peers'; + +export function buildApiTopic(forumTopic: GramJs.TypeForumTopic): ApiTopic | undefined { + if (forumTopic instanceof GramJs.ForumTopicDeleted) { + return undefined; + } + + const { + id, + my, + closed, + pinned, + hidden, + short, + date, + title, + iconColor, + iconEmojiId, + topMessage, + unreadCount, + unreadMentionsCount, + unreadReactionsCount, + fromId, + notifySettings, + titleMissing, + } = forumTopic; + + return { + id, + isClosed: closed, + isPinned: pinned, + isHidden: hidden, + isOwner: my, + isMin: short, + date, + title, + iconColor, + iconEmojiId: iconEmojiId?.toString(), + lastMessageId: topMessage, + unreadCount, + unreadMentionsCount, + unreadReactionsCount, + fromId: getApiChatIdFromMtpPeer(fromId), + notifySettings: buildApiPeerNotifySettings(notifySettings), + isTitleMissing: titleMissing, + }; +} diff --git a/src/api/gramjs/apiBuilders/peers.ts b/src/api/gramjs/apiBuilders/peers.ts index c9a67627b..9dbe84235 100644 --- a/src/api/gramjs/apiBuilders/peers.ts +++ b/src/api/gramjs/apiBuilders/peers.ts @@ -3,11 +3,11 @@ import { Api as GramJs } from '../../../lib/gramjs'; import type { ApiBotVerification, ApiEmojiStatusType, - ApiPeerColor, ApiPeerColors, ApiPeerNotifySettings, ApiPeerProfileColorSet, ApiProfileTab, + ApiTypePeerColor, } from '../../types'; import { CHANNEL_ID_BASE } from '../../../config'; @@ -50,12 +50,33 @@ export function getApiChatIdFromMtpPeer(peer: TypePeerOrInput) { } } -export function buildApiPeerColor(peerColor: GramJs.TypePeerColor): ApiPeerColor { - const { color, backgroundEmojiId } = peerColor; - return { - color, - backgroundEmojiId: backgroundEmojiId?.toString(), - }; +export function buildApiPeerColor(peerColor: GramJs.TypePeerColor): ApiTypePeerColor | undefined { + if (peerColor instanceof GramJs.PeerColor) { + const { color, backgroundEmojiId } = peerColor; + return { + type: 'regular', + color, + backgroundEmojiId: backgroundEmojiId?.toString(), + }; + } + + if (peerColor instanceof GramJs.PeerColorCollectible) { + const { + collectibleId, giftEmojiId, backgroundEmojiId, accentColor, colors, darkAccentColor, darkColors, + } = peerColor; + return { + type: 'collectible', + giftEmojiId: giftEmojiId.toString(), + collectibleId: collectibleId.toString(), + backgroundEmojiId: backgroundEmojiId.toString(), + accentColor: int2hex(accentColor), + colors: colors.map((color) => int2hex(color)), + darkAccentColor: darkAccentColor ? int2hex(darkAccentColor) : undefined, + darkColors: darkColors?.map((color) => int2hex(color)), + }; + } + + return undefined; } function buildApiPeerColorSet(colorSet: GramJs.help.PeerColorSet) { diff --git a/src/api/gramjs/methods/chats.ts b/src/api/gramjs/methods/chats.ts index bbc0941cc..741a1d562 100644 --- a/src/api/gramjs/methods/chats.ts +++ b/src/api/gramjs/methods/chats.ts @@ -1,6 +1,5 @@ import { Api as GramJs } from '../../../lib/gramjs'; import { RPCError } from '../../../lib/gramjs/errors'; -import { generateRandomBigInt } from '../../../lib/gramjs/Helpers'; import type { ChatListType } from '../../../types'; import type { @@ -18,7 +17,6 @@ import type { ApiPeerNotifySettings, ApiPhoto, ApiProfileTab, - ApiTopic, ApiUser, ApiUserStatus, } from '../../types'; @@ -27,10 +25,8 @@ import { ALL_FOLDER_ID, ARCHIVED_FOLDER_ID, DEBUG, - GENERAL_TOPIC_ID, MEMBERS_LOAD_SLICE, SERVICE_NOTIFICATIONS_USER_ID, - TOPICS_SLICE, } from '../../../config'; import { buildCollectionByKey, omitUndefined } from '../../../util/iteratees'; import { GLOBAL_SEARCH_CONTACTS_LIMIT } from '../../../limits'; @@ -47,7 +43,6 @@ import { buildApiChatReactions, buildApiMissingInvitedUser, buildApiSponsoredPeer, - buildApiTopic, buildChatMember, buildChatMembers, getPeerKey, @@ -87,7 +82,7 @@ import { isChatFolder } from '../helpers/misc'; import { scheduleMutedChatUpdate } from '../scheduleUnmute'; import { sendApiUpdate } from '../updates/apiUpdateEmitter'; import { - applyState, processAffectedHistory, updateChannelState, + applyState, updateChannelState, } from '../updates/updateManager'; import { handleGramJsUpdate, invokeRequest, uploadFile } from './client'; @@ -1699,186 +1694,6 @@ export function toggleForum({ }); } -export async function createTopic({ - chat, title, iconColor, iconEmojiId, sendAs, -}: { - chat: ApiChat; - title: string; - iconColor?: number; - iconEmojiId?: string; - sendAs?: ApiPeer; -}) { - const { id, accessHash } = chat; - - const updates = await invokeRequest(new GramJs.channels.CreateForumTopic({ - channel: buildInputChannel(id, accessHash), - title, - iconColor, - iconEmojiId: iconEmojiId ? BigInt(iconEmojiId) : undefined, - sendAs: sendAs ? buildInputPeer(sendAs.id, sendAs.accessHash) : undefined, - randomId: generateRandomBigInt(), - })); - - if (!(updates instanceof GramJs.Updates) || !updates.updates.length) { - return undefined; - } - - // Finding topic id in updates - return updates.updates?.find((update): update is GramJs.UpdateMessageID => ( - update instanceof GramJs.UpdateMessageID - ))?.id; -} - -export async function fetchTopics({ - chat, query, offsetTopicId, offsetId, offsetDate, limit = TOPICS_SLICE, -}: { - chat: ApiChat; - query?: string; - offsetTopicId?: number; - offsetId?: number; - offsetDate?: number; - limit?: number; -}): Promise<{ - topics: ApiTopic[]; - messages: ApiMessage[]; - count: number; - shouldOrderByCreateDate?: boolean; - draftsById: Record>; - readInboxMessageIdByTopicId: Record; -} | undefined> { - const { id, accessHash } = chat; - - const result = await invokeRequest(new GramJs.channels.GetForumTopics({ - channel: buildInputChannel(id, accessHash), - limit, - q: query, - offsetTopic: offsetTopicId ?? DEFAULT_PRIMITIVES.INT, - offsetId: offsetId ?? DEFAULT_PRIMITIVES.INT, - offsetDate: offsetDate ?? DEFAULT_PRIMITIVES.INT, - })); - - if (!result) return undefined; - - const { count, orderByCreateDate } = result; - - const topics = result.topics.map(buildApiTopic).filter(Boolean); - const messages = result.messages.map(buildApiMessage).filter(Boolean); - const draftsById = result.topics.reduce((acc, topic) => { - if (topic instanceof GramJs.ForumTopic && topic.draft) { - acc[topic.id] = buildMessageDraft(topic.draft); - } - return acc; - }, {} as Record>); - const readInboxMessageIdByTopicId = result.topics.reduce((acc, topic) => { - if (topic instanceof GramJs.ForumTopic && topic.readInboxMaxId) { - acc[topic.id] = topic.readInboxMaxId; - } - return acc; - }, {} as Record); - - return { - topics, - messages, - // Include general topic - count: count + 1, - shouldOrderByCreateDate: orderByCreateDate, - draftsById, - readInboxMessageIdByTopicId, - }; -} - -export async function fetchTopicById({ - chat, topicId, -}: { - chat: ApiChat; - topicId: number; -}): Promise<{ - topic: ApiTopic; - messages: ApiMessage[]; -} | undefined> { - const { id, accessHash } = chat; - - const result = await invokeRequest(new GramJs.channels.GetForumTopicsByID({ - channel: buildInputChannel(id, accessHash), - topics: [topicId], - })); - - if (!result?.topics.length || !(result.topics[0] instanceof GramJs.ForumTopic)) { - return undefined; - } - - const messages = result.messages.map(buildApiMessage).filter(Boolean); - - return { - topic: buildApiTopic(result.topics[0])!, - messages, - }; -} - -export async function deleteTopic({ - chat, topicId, -}: { - chat: ApiChat; - topicId: number; -}) { - const { id, accessHash } = chat; - - const result = await invokeRequest(new GramJs.channels.DeleteTopicHistory({ - channel: buildInputChannel(id, accessHash), - topMsgId: topicId, - })); - - if (!result) return; - - processAffectedHistory(chat, result); - - if (result.offset) { - await deleteTopic({ chat, topicId }); - } -} - -export function togglePinnedTopic({ - chat, topicId, isPinned, -}: { - chat: ApiChat; - topicId: number; - isPinned: boolean; -}) { - const { id, accessHash } = chat; - - return invokeRequest(new GramJs.channels.UpdatePinnedForumTopic({ - channel: buildInputChannel(id, accessHash), - topicId, - pinned: isPinned, - }), { - shouldReturnTrue: true, - }); -} - -export function editTopic({ - chat, topicId, title, iconEmojiId, isClosed, isHidden, -}: { - chat: ApiChat; - topicId: number; - title?: string; - iconEmojiId?: string; - isClosed?: boolean; - isHidden?: boolean; -}) { - const { id, accessHash } = chat; - - return invokeRequest(new GramJs.channels.EditForumTopic({ - channel: buildInputChannel(id, accessHash), - topicId, - title, - iconEmojiId: topicId !== GENERAL_TOPIC_ID && iconEmojiId ? BigInt(iconEmojiId) : undefined, - closed: isClosed, - hidden: isHidden, - }), { - shouldReturnTrue: true, - }); -} - export async function checkChatlistInvite({ slug, }: { diff --git a/src/api/gramjs/methods/client.ts b/src/api/gramjs/methods/client.ts index c22fd736d..5456602b5 100644 --- a/src/api/gramjs/methods/client.ts +++ b/src/api/gramjs/methods/client.ts @@ -466,7 +466,7 @@ function dispatchNotSupportedInFrozenAccountUpdate( || request instanceof GramJs.phone.GetGroupParticipants || request instanceof GramJs.channels.GetParticipant || request instanceof GramJs.channels.GetParticipants - || request instanceof GramJs.channels.GetForumTopics) { + || request instanceof GramJs.messages.GetForumTopics) { return; } diff --git a/src/api/gramjs/methods/forum.ts b/src/api/gramjs/methods/forum.ts new file mode 100644 index 000000000..1efe100db --- /dev/null +++ b/src/api/gramjs/methods/forum.ts @@ -0,0 +1,196 @@ +import { Api as GramJs } from '../../../lib/gramjs'; +import { generateRandomBigInt } from '../../../lib/gramjs/Helpers'; + +import type { ApiMessage, ApiTopic } from '../../types'; +import type { + ApiChat, + ApiDraft, + ApiPeer, +} from '../../types/chats'; + +import { GENERAL_TOPIC_ID, TOPICS_SLICE } from '../../../config'; +import { buildApiTopic } from '../apiBuilders/forums'; +import { buildApiMessage, buildMessageDraft } from '../apiBuilders/messages'; +import { buildInputPeer, DEFAULT_PRIMITIVES } from '../gramjsBuilders'; +import { processAffectedHistory } from '../updates/updateManager'; +import { invokeRequest } from './client'; + +export async function createTopic({ + chat, title, iconColor, iconEmojiId, sendAs, +}: { + chat: ApiChat; + title: string; + iconColor?: number; + iconEmojiId?: string; + sendAs?: ApiPeer; +}) { + const { id, accessHash } = chat; + + const updates = await invokeRequest(new GramJs.messages.CreateForumTopic({ + peer: buildInputPeer(id, accessHash), + title, + iconColor, + iconEmojiId: iconEmojiId ? BigInt(iconEmojiId) : undefined, + sendAs: sendAs ? buildInputPeer(sendAs.id, sendAs.accessHash) : undefined, + randomId: generateRandomBigInt(), + })); + + if (!(updates instanceof GramJs.Updates) || !updates.updates.length) { + return undefined; + } + + // Finding topic id in updates + return updates.updates?.find((update): update is GramJs.UpdateMessageID => ( + update instanceof GramJs.UpdateMessageID + ))?.id; +} + +export async function fetchTopics({ + chat, query, offsetTopicId, offsetId, offsetDate, limit = TOPICS_SLICE, +}: { + chat: ApiChat; + query?: string; + offsetTopicId?: number; + offsetId?: number; + offsetDate?: number; + limit?: number; +}): Promise<{ + topics: ApiTopic[]; + messages: ApiMessage[]; + count: number; + shouldOrderByCreateDate?: boolean; + draftsById: Record; + readInboxMessageIdByTopicId: Record; +} | undefined> { + const { id, accessHash } = chat; + + const result = await invokeRequest(new GramJs.messages.GetForumTopics({ + peer: buildInputPeer(id, accessHash), + limit, + q: query, + offsetTopic: offsetTopicId ?? DEFAULT_PRIMITIVES.INT, + offsetId: offsetId ?? DEFAULT_PRIMITIVES.INT, + offsetDate: offsetDate ?? DEFAULT_PRIMITIVES.INT, + })); + + if (!result) return undefined; + + const { count, orderByCreateDate } = result; + + const topics = result.topics.map(buildApiTopic).filter(Boolean); + const messages = result.messages.map(buildApiMessage).filter(Boolean); + const draftsById = result.topics.reduce((acc, topic) => { + if (topic instanceof GramJs.ForumTopic && topic.draft) { + acc[topic.id] = buildMessageDraft(topic.draft); + } + return acc; + }, {} as Record>); + const readInboxMessageIdByTopicId = result.topics.reduce((acc, topic) => { + if (topic instanceof GramJs.ForumTopic && topic.readInboxMaxId) { + acc[topic.id] = topic.readInboxMaxId; + } + return acc; + }, {} as Record); + + return { + topics, + messages, + // Include general topic + count: count + 1, + shouldOrderByCreateDate: orderByCreateDate, + draftsById, + readInboxMessageIdByTopicId, + }; +} + +export async function fetchTopicById({ + chat, topicId, +}: { + chat: ApiChat; + topicId: number; +}): Promise<{ + topic: ApiTopic; + messages: ApiMessage[]; +} | undefined> { + const { id, accessHash } = chat; + + const result = await invokeRequest(new GramJs.messages.GetForumTopicsByID({ + peer: buildInputPeer(id, accessHash), + topics: [topicId], + })); + + if (!result?.topics.length || !(result.topics[0] instanceof GramJs.ForumTopic)) { + return undefined; + } + + const messages = result.messages.map(buildApiMessage).filter(Boolean); + + return { + topic: buildApiTopic(result.topics[0])!, + messages, + }; +} + +export async function deleteTopic({ + chat, topicId, +}: { + chat: ApiChat; + topicId: number; +}) { + const { id, accessHash } = chat; + + const result = await invokeRequest(new GramJs.messages.DeleteTopicHistory({ + peer: buildInputPeer(id, accessHash), + topMsgId: topicId, + })); + + if (!result) return; + + processAffectedHistory(chat, result); + + if (result.offset) { + await deleteTopic({ chat, topicId }); + } +} + +export function togglePinnedTopic({ + chat, topicId, isPinned, +}: { + chat: ApiChat; + topicId: number; + isPinned: boolean; +}) { + const { id, accessHash } = chat; + + return invokeRequest(new GramJs.messages.UpdatePinnedForumTopic({ + peer: buildInputPeer(id, accessHash), + topicId, + pinned: isPinned, + }), { + shouldReturnTrue: true, + }); +} + +export function editTopic({ + chat, topicId, title, iconEmojiId, isClosed, isHidden, +}: { + chat: ApiChat; + topicId: number; + title?: string; + iconEmojiId?: string; + isClosed?: boolean; + isHidden?: boolean; +}) { + const { id, accessHash } = chat; + + return invokeRequest(new GramJs.messages.EditForumTopic({ + peer: buildInputPeer(id, accessHash), + topicId, + title, + iconEmojiId: topicId !== GENERAL_TOPIC_ID && iconEmojiId ? BigInt(iconEmojiId) : undefined, + closed: isClosed, + hidden: isHidden, + }), { + shouldReturnTrue: true, + }); +} diff --git a/src/api/gramjs/methods/index.ts b/src/api/gramjs/methods/index.ts index de6807d94..5c1412807 100644 --- a/src/api/gramjs/methods/index.ts +++ b/src/api/gramjs/methods/index.ts @@ -44,3 +44,5 @@ export * from './payments'; export * from './fragment'; export * from './stars'; + +export * from './forum'; diff --git a/src/api/gramjs/updates/mtpUpdateHandler.ts b/src/api/gramjs/updates/mtpUpdateHandler.ts index 4127fa23e..5304af2c5 100644 --- a/src/api/gramjs/updates/mtpUpdateHandler.ts +++ b/src/api/gramjs/updates/mtpUpdateHandler.ts @@ -1003,17 +1003,17 @@ export function updater(update: Update) { }); } else if (update instanceof GramJs.UpdateConfig) { sendApiUpdate({ '@type': 'updateConfig' }); - } else if (update instanceof GramJs.UpdateChannelPinnedTopic) { + } else if (update instanceof GramJs.UpdatePinnedForumTopic) { sendApiUpdate({ '@type': 'updatePinnedTopic', - chatId: buildApiPeerId(update.channelId, 'channel'), + chatId: getApiChatIdFromMtpPeer(update.peer), topicId: update.topicId, isPinned: Boolean(update.pinned), }); - } else if (update instanceof GramJs.UpdateChannelPinnedTopics) { + } else if (update instanceof GramJs.UpdatePinnedForumTopics) { sendApiUpdate({ '@type': 'updatePinnedTopicsOrder', - chatId: buildApiPeerId(update.channelId, 'channel'), + chatId: getApiChatIdFromMtpPeer(update.peer), order: update.order || [], }); } else if (update instanceof GramJs.UpdateRecentEmojiStatuses) { diff --git a/src/api/types/chats.ts b/src/api/types/chats.ts index 788b2df7f..65be0a1fa 100644 --- a/src/api/types/chats.ts +++ b/src/api/types/chats.ts @@ -2,14 +2,14 @@ import type { ApiBotCommand } from './bots'; import type { ApiChatReactions, ApiFormattedText, ApiInputMessageReplyInfo, ApiInputSuggestedPostInfo, ApiPhoto, ApiStickerSet, } from './messages'; -import type { ApiChatInviteImporter, ApiPeerNotifySettings, ApiRestrictionReason } from './misc'; +import type { ApiChatInviteImporter, ApiRestrictionReason } from './misc'; import type { ApiBotVerification, ApiEmojiStatusType, ApiFakeType, - ApiPeerColor, ApiProfileTab, ApiSendAsPeerId, + ApiTypePeerColor, } from './peers'; import type { ApiUser, ApiUsername, @@ -51,8 +51,8 @@ export interface ApiChat { draftDate?: number; isProtected?: boolean; fakeType?: ApiFakeType; - color?: ApiPeerColor; - profileColor?: ApiPeerColor; + color?: ApiTypePeerColor; + profileColor?: ApiTypePeerColor; emojiStatus?: ApiEmojiStatusType; isForum?: boolean; isForumAsMessages?: true; @@ -244,27 +244,6 @@ export interface ApiChatFolder { hasMyInvites?: true; } -export interface ApiTopic { - id: number; - isClosed?: boolean; - isPinned?: boolean; - isHidden?: boolean; - isOwner?: boolean; - - // TODO[forums] https://github.com/telegramdesktop/tdesktop/blob/1aece79a471d99a8b63d826b1bce1f36a04d7293/Telegram/SourceFiles/data/data_forum_topic.cpp#L318 - isMin?: boolean; - date: number; - title: string; - iconColor: number; - iconEmojiId?: string; - lastMessageId: number; - unreadCount: number; - unreadMentionsCount: number; - unreadReactionsCount: number; - fromId: string; - notifySettings: ApiPeerNotifySettings; -} - export interface ApiChatlistInviteNew { title: ApiFormattedText; noTitleAnimations?: true; diff --git a/src/api/types/messages.ts b/src/api/types/messages.ts index 7f659da96..508d3575c 100644 --- a/src/api/types/messages.ts +++ b/src/api/types/messages.ts @@ -5,11 +5,11 @@ import type { ApiWebDocument, } from './bots'; import type { ApiMessageAction } from './messageActions'; -import type { ApiRestrictionReason } from './misc'; +import type { ApiPeerNotifySettings, ApiRestrictionReason } from './misc'; import type { ApiLabeledPrice, } from './payments'; -import type { ApiPeerColor } from './peers'; +import type { ApiTypePeerColor } from './peers'; import type { ApiStarGiftUnique, ApiTypeCurrencyAmount } from './stars'; import type { ApiMessageStoryData, ApiStory, ApiWebPageStickerData, ApiWebPageStoryData, @@ -851,7 +851,7 @@ export type ApiSponsoredMessage = { url: string; photo?: ApiPhoto; content: MediaContent; - peerColor?: ApiPeerColor; + peerColor?: ApiTypePeerColor; }; // KeyboardButtons @@ -1049,6 +1049,28 @@ export type LinkContext = { messageId: number; }; +export interface ApiTopic { + id: number; + isClosed?: boolean; + isPinned?: boolean; + isHidden?: boolean; + isOwner?: boolean; + + // TODO[forums] https://github.com/telegramdesktop/tdesktop/blob/1aece79a471d99a8b63d826b1bce1f36a04d7293/Telegram/SourceFiles/data/data_forum_topic.cpp#L318 + isMin?: boolean; + date: number; + title: string; + iconColor: number; + iconEmojiId?: string; + lastMessageId: number; + unreadCount: number; + unreadMentionsCount: number; + unreadReactionsCount: number; + fromId: string; + notifySettings: ApiPeerNotifySettings; + isTitleMissing?: boolean; +} + export const MAIN_THREAD_ID = -1; // `Symbol` can not be transferred from worker diff --git a/src/api/types/peers.ts b/src/api/types/peers.ts index 9735dc615..42d677123 100644 --- a/src/api/types/peers.ts +++ b/src/api/types/peers.ts @@ -57,10 +57,24 @@ export interface ApiSendAsPeerId { } export interface ApiPeerColor { + type: 'regular'; color?: number; backgroundEmojiId?: string; } +export interface ApiPeerColorCollectible { + type: 'collectible'; + collectibleId: string; + giftEmojiId: string; + backgroundEmojiId: string; + accentColor: string; + colors: string[]; + darkAccentColor?: string; + darkColors?: string[]; +} + +export type ApiTypePeerColor = ApiPeerColor | ApiPeerColorCollectible; + export type ApiPeerColorSet = string[]; export type ApiPeerProfileColorSet = { paletteColors: string[]; diff --git a/src/api/types/users.ts b/src/api/types/users.ts index 3811032da..6277a7643 100644 --- a/src/api/types/users.ts +++ b/src/api/types/users.ts @@ -6,9 +6,9 @@ import type { ApiBotVerification, ApiEmojiStatusType, ApiFakeType, - ApiPeerColor, ApiPeerSettings, ApiProfileTab, + ApiTypePeerColor, } from './peers'; import type { ApiSavedStarGift, ApiStarsRating } from './stars'; @@ -40,8 +40,8 @@ export interface ApiUser { hasStories?: boolean; hasUnreadStories?: boolean; maxStoryId?: number; - color?: ApiPeerColor; - profileColor?: ApiPeerColor; + color?: ApiTypePeerColor; + profileColor?: ApiTypePeerColor; canEditBot?: boolean; hasMainMiniApp?: boolean; botActiveUsers?: number; diff --git a/src/components/common/Avatar.tsx b/src/components/common/Avatar.tsx index 2becd03a0..9d7df5cf4 100644 --- a/src/components/common/Avatar.tsx +++ b/src/components/common/Avatar.tsx @@ -1,6 +1,5 @@ import type { MouseEvent as ReactMouseEvent } from 'react'; -import type { FC, TeactNode } from '../../lib/teact/teact'; -import type React from '../../lib/teact/teact'; +import type { TeactNode } from '../../lib/teact/teact'; import { memo, useMemo, useRef } from '../../lib/teact/teact'; import { getActions } from '../../global'; @@ -15,6 +14,7 @@ import { IS_TEST } from '../../config'; import { getChatAvatarHash, getChatTitle, + getPeerColorKey, getPeerStoryHtmlId, getUserFullName, getVideoProfilePhotoMediaHash, @@ -29,7 +29,6 @@ import buildStyle from '../../util/buildStyle'; import { isUserId } from '../../util/entities/ids'; import { getFirstLetters } from '../../util/textFormat'; import { REM } from './helpers/mediaDimensions'; -import { getPeerColorClass } from './helpers/peerColor'; import renderText from './helpers/renderText'; import { useFastClick } from '../../hooks/useFastClick'; @@ -37,6 +36,7 @@ import useLastCallback from '../../hooks/useLastCallback'; import useMedia from '../../hooks/useMedia'; import useMediaTransition from '../../hooks/useMediaTransition'; import useOldLang from '../../hooks/useOldLang'; +import { getPeerColorClass } from '../../hooks/usePeerColor'; import OptimizedVideo from '../ui/OptimizedVideo'; import AvatarStoryCircle from './AvatarStoryCircle'; @@ -94,7 +94,7 @@ type OwnProps = { onMouseMove?: (e: React.MouseEvent) => void; }; -const Avatar: FC = ({ +const Avatar = ({ className, style, size = 'large', @@ -121,7 +121,7 @@ const Avatar: FC = ({ onClick, onContextMenu, onMouseMove, -}) => { +}: OwnProps) => { const { openStoryViewer } = getActions(); const ref = useRef(); @@ -135,6 +135,9 @@ const Avatar: FC = ({ const isAnonymousForwards = realPeer && isAnonymousForwardsChat(realPeer.id); const isForum = chat?.isForum; + const peerColorKey = getPeerColorKey(peer); + const peerColorClass = peerColorKey !== undefined ? getPeerColorClass(peerColorKey) : undefined; + const isStoryClickable = withStory && storyViewerMode !== 'disabled' && realPeer?.hasStories; let imageHash: string | undefined; @@ -265,7 +268,7 @@ const Avatar: FC = ({ const fullClassName = buildClassName( 'Avatar', className, - getPeerColorClass(peer), + peerColorClass, !peer && text && 'hidden-user', isSavedMessages && 'saved-messages', isAnonymousForwards && 'anonymous-forwards', @@ -283,6 +286,12 @@ const Avatar: FC = ({ (!isSavedMessages && !imgUrl) && 'no-photo', ); + const fullStyle = buildStyle( + `--_size: ${pxSize}px;`, + customColor && `--color-user: ${customColor}`, + style, + ); + const hasMedia = Boolean(isSavedMessages || imgUrl); const { handleClick, handleMouseDown } = useFastClick((e: ReactMouseEvent) => { @@ -310,7 +319,7 @@ const Avatar: FC = ({ data-peer-id={realPeer?.id} data-test-sender-id={IS_TEST ? realPeer?.id : undefined} aria-label={typeof content === 'string' ? author : undefined} - style={buildStyle(`--_size: ${pxSize}px;`, customColor && `--color-user: ${customColor}`, style)} + style={fullStyle} onClick={handleClick} onContextMenu={onContextMenu} onMouseDown={handleMouseDown} diff --git a/src/components/common/Composer.tsx b/src/components/common/Composer.tsx index 26e17cd15..d59923277 100644 --- a/src/components/common/Composer.tsx +++ b/src/components/common/Composer.tsx @@ -127,7 +127,6 @@ import applyIosAutoCapitalizationFix from '../middle/composer/helpers/applyIosAu import buildAttachment, { prepareAttachmentsToSend } from '../middle/composer/helpers/buildAttachment'; import { buildCustomEmojiHtml } from '../middle/composer/helpers/customEmoji'; import { isSelectionInsideInput } from '../middle/composer/helpers/selection'; -import { getPeerColorClass } from './helpers/peerColor'; import renderText from './helpers/renderText'; import { getTextWithEntitiesAsHtml } from './helpers/renderTextWithEntities'; @@ -141,6 +140,7 @@ import useGetSelectionRange from '../../hooks/useGetSelectionRange'; import useLang from '../../hooks/useLang'; import useLastCallback from '../../hooks/useLastCallback'; import useOldLang from '../../hooks/useOldLang'; +import usePeerColor from '../../hooks/usePeerColor'; import usePrevious from '../../hooks/usePrevious'; import usePreviousDeprecated from '../../hooks/usePreviousDeprecated'; import useSchedule from '../../hooks/useSchedule'; @@ -981,6 +981,11 @@ const Composer: FC = ({ } }, [chatId, handleStoryPickerContextMenuHide, isReactionPickerOpen, storyId, storyReactionPickerAnchor]); + const { className: peerColorClass, style: peerColorStyle } = usePeerColor({ + peer: sendAsPeer || currentUser, + theme, + }); + useClipboardPaste( isForCurrentMessageList || isInStoryViewer, insertFormattedTextAndUpdateCursor, @@ -2082,7 +2087,7 @@ const Composer: FC = ({ /> )} -
+
{isInMessageList && ( <> {withBotMenuButton && ( diff --git a/src/components/common/PeerChip.tsx b/src/components/common/PeerChip.tsx index d1e6e9e3c..c87cae219 100644 --- a/src/components/common/PeerChip.tsx +++ b/src/components/common/PeerChip.tsx @@ -3,15 +3,16 @@ import { memo } from '../../lib/teact/teact'; import { withGlobal } from '../../global'; import type { ApiPeer } from '../../api/types'; -import type { CustomPeer } from '../../types'; +import type { CustomPeer, ThemeKey } from '../../types'; import type { IconName } from '../../types/icons'; import { getPeerTitle, isApiPeerChat } from '../../global/helpers/peers'; -import { selectPeer, selectUser } from '../../global/selectors'; +import { selectPeer, selectTheme, selectUser } from '../../global/selectors'; import buildClassName from '../../util/buildClassName'; -import { getPeerColorClass } from './helpers/peerColor'; +import buildStyle from '../../util/buildStyle'; -import useOldLang from '../../hooks/useOldLang'; +import useLang from '../../hooks/useLang'; +import usePeerColor from '../../hooks/usePeerColor'; import Avatar from './Avatar'; import FullNameTitle from './FullNameTitle'; @@ -41,6 +42,7 @@ type OwnProps = { type StateProps = { peer?: ApiPeer; + theme: ThemeKey; isSavedMessages?: boolean; }; @@ -58,14 +60,20 @@ const PeerChip = ({ isSavedMessages, withPeerColors, withEmojiStatus, - onClick, itemClassName, + theme, + onClick, }: OwnProps & StateProps) => { - const lang = useOldLang(); + const lang = useLang(); const apiPeer = mockPeer || peer; const anyPeer = customPeer || apiPeer; + const { className: peerColorClass, style: peerColorStyle } = usePeerColor({ + peer: anyPeer, + theme, + }); + const chat = apiPeer && isApiPeerChat(apiPeer) ? apiPeer : undefined; let iconElement: TeactNode | undefined; @@ -103,13 +111,18 @@ const PeerChip = ({ canClose && styles.closeable, isCloseNonDestructive && styles.nonDestructive, !onClick && styles.notClickable, - withPeerColors && getPeerColorClass(customPeer || peer), + withPeerColors && peerColorClass, className, ); + const style = buildStyle( + withPeerColors && peerColorStyle, + ); + return (
onClick?.(clickArg!)} title={isMinimized ? titleText : undefined} dir={lang.isRtl ? 'rtl' : undefined} @@ -131,10 +144,12 @@ const PeerChip = ({ export default memo(withGlobal( (global, { peerId, forceShowSelf }): Complete => { + const theme = selectTheme(global); if (!peerId) { return { peer: undefined, isSavedMessages: undefined, + theme, }; } @@ -145,6 +160,7 @@ export default memo(withGlobal( return { peer, isSavedMessages, + theme, }; }, -)(PeerChip)) as typeof PeerChip; +)(PeerChip)) as (props: OwnProps) => ReturnType>; diff --git a/src/components/common/PeerColorWrapper.module.scss b/src/components/common/PeerColorWrapper.module.scss index 4a3288db6..e9b74dcfe 100644 --- a/src/components/common/PeerColorWrapper.module.scss +++ b/src/components/common/PeerColorWrapper.module.scss @@ -1,5 +1,4 @@ .root { - --peer-color-wrapper-bar-color: var(--bar-gradient, var(--accent-color)); position: relative; @@ -13,19 +12,31 @@ color: var(--accent-color); background-color: var(--accent-background-color); - - &::before { - content: ""; - - position: absolute; - top: 0; - bottom: 0; - inset-inline-start: 0; - - display: block; - - width: 0.1875rem; - - background: var(--peer-color-wrapper-bar-color); - } +} + +.withBar::before { + content: ""; + + position: absolute; + top: 0; + bottom: 0; + inset-inline-start: 0; + + display: block; + + width: 0.1875rem; + + background: var(--peer-color-wrapper-bar-color); +} + +.hasGiftEmoji { + padding-inline-end: 1.75rem; +} + +.giftEmoji { + --custom-emoji-size: 1.25rem; + + position: absolute; + top: 0.25rem; + right: 0.25rem; } diff --git a/src/components/common/PeerColorWrapper.tsx b/src/components/common/PeerColorWrapper.tsx index 0eca48dcd..41f5d1775 100644 --- a/src/components/common/PeerColorWrapper.tsx +++ b/src/components/common/PeerColorWrapper.tsx @@ -2,11 +2,16 @@ import type { ElementRef } from '../../lib/teact/teact'; import type React from '../../lib/teact/teact'; import { memo } from '../../lib/teact/teact'; -import type { ApiPeer, ApiPeerColor } from '../../api/types'; +import type { ApiPeer, ApiTypePeerColor } from '../../api/types'; +import { selectTheme } from '../../global/selectors'; import buildClassName from '../../util/buildClassName'; -import { getApiPeerColorClass, getPeerColorClass } from './helpers/peerColor'; +import { REM } from './helpers/mediaDimensions'; +import useSelector from '../../hooks/data/useSelector'; +import usePeerColor from '../../hooks/usePeerColor'; + +import CustomEmoji from './CustomEmoji'; import EmojiIconBackground from './embedded/EmojiIconBackground'; import styles from './PeerColorWrapper.module.scss'; @@ -14,7 +19,9 @@ import styles from './PeerColorWrapper.module.scss'; interface OwnProps extends React.HTMLAttributes { ref?: ElementRef; peer?: ApiPeer; - peerColor?: ApiPeerColor; + peerColor?: ApiTypePeerColor; + isReply?: boolean; + noBar?: boolean; noUserColors?: boolean; shouldReset?: boolean; className?: string; @@ -22,29 +29,58 @@ interface OwnProps extends React.HTMLAttributes { children: React.ReactNode; } +const GIFT_EMOJI_SIZE = 1.25 * REM; + function PeerColorWrapper({ - peer, ref, peerColor, noUserColors, - shouldReset, className, emojiIconClassName, - children, ...otherProps + ref, + peer, + peerColor, + isReply, + noBar, + noUserColors, + shouldReset, + className, + emojiIconClassName, + children, + ...otherProps }: OwnProps) { const color = peerColor || peer?.color; + const theme = useSelector(selectTheme); + + const { + style, + className: peerColorClassName, + backgroundEmojiId, + giftEmojiId, + } = usePeerColor({ peer, color, noUserColors, shouldReset, theme }); + const hasGiftEmoji = isReply && Boolean(giftEmojiId); return (
- {color?.backgroundEmojiId && ( + {backgroundEmojiId && ( + )} + {hasGiftEmoji && ( + )} {children} diff --git a/src/components/common/embedded/EmbeddedMessage.tsx b/src/components/common/embedded/EmbeddedMessage.tsx index 39d70e9bf..7d0756c5b 100644 --- a/src/components/common/embedded/EmbeddedMessage.tsx +++ b/src/components/common/embedded/EmbeddedMessage.tsx @@ -305,6 +305,7 @@ const EmbeddedMessage: FC = ({ emojiIconClassName="EmbeddedMessage--background-icons" ref={ref} shouldReset + isReply={Boolean(replyInfo)} noUserColors={noUserColors} className={buildClassName( 'EmbeddedMessage', diff --git a/src/components/common/embedded/EmbeddedStoryForward.tsx b/src/components/common/embedded/EmbeddedStoryForward.tsx index a1e7cd8a3..f38e2e1b2 100644 --- a/src/components/common/embedded/EmbeddedStoryForward.tsx +++ b/src/components/common/embedded/EmbeddedStoryForward.tsx @@ -1,4 +1,3 @@ -import type { FC } from '../../../lib/teact/teact'; import { memo, useEffect, useRef } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; @@ -7,19 +6,20 @@ import type { ApiStoryForwardInfo, ApiTypeStory, } from '../../../api/types'; +import type { ThemeKey } from '../../../types'; import type { IconName } from '../../../types/icons'; import { getPeerTitle } from '../../../global/helpers/peers'; -import { selectPeer, selectPeerStory } from '../../../global/selectors'; +import { selectPeer, selectPeerStory, selectTheme } from '../../../global/selectors'; import buildClassName from '../../../util/buildClassName'; import { isUserId } from '../../../util/entities/ids'; -import { getPeerColorClass } from '../helpers/peerColor'; import renderText from '../helpers/renderText'; import { renderTextWithEntities } from '../helpers/renderTextWithEntities'; import { useFastClick } from '../../../hooks/useFastClick'; import useLastCallback from '../../../hooks/useLastCallback'; import useOldLang from '../../../hooks/useOldLang'; +import usePeerColor from '../../../hooks/usePeerColor'; import Icon from '../icons/Icon'; import PeerColorWrapper from '../PeerColorWrapper'; @@ -35,14 +35,16 @@ type OwnProps = { type StateProps = { sender?: ApiPeer; story?: ApiTypeStory; + theme: ThemeKey; }; -const EmbeddedStoryForward: FC = ({ +const EmbeddedStoryForward = ({ className, forwardInfo, sender, story, -}) => { + theme, +}: OwnProps & StateProps) => { const { openStoryViewer, loadPeerStoriesByIds, openChat } = getActions(); const ref = useRef(); @@ -57,6 +59,13 @@ const EmbeddedStoryForward: FC = ({ } }, [forwardInfo, story]); + const { className: peerColorClass, style: peerColorStyle } = usePeerColor({ + peer: sender, + noUserColors: true, + shouldReset: true, + theme, + }); + const senderTitle = sender ? getPeerTitle(lang, sender) : forwardInfo.fromName; const openOriginalStory = useLastCallback(() => { @@ -111,8 +120,9 @@ const EmbeddedStoryForward: FC = ({ className={buildClassName( 'EmbeddedMessage', className, - getPeerColorClass(sender, true, true), + peerColorClass, )} + style={peerColorStyle} dir={lang.isRtl ? 'rtl' : undefined} onClick={handleClick} onMouseDown={handleMouseDown} @@ -138,9 +148,11 @@ export default memo(withGlobal( const sender = forwardInfo.fromPeerId ? selectPeer(global, forwardInfo.fromPeerId) : undefined; const story = forwardInfo.storyId && forwardInfo.fromPeerId ? selectPeerStory(global, forwardInfo.fromPeerId, forwardInfo.storyId) : undefined; + return { sender, story, + theme: selectTheme(global), }; }, )(EmbeddedStoryForward)); diff --git a/src/components/common/embedded/EmojiIconBackground.tsx b/src/components/common/embedded/EmojiIconBackground.tsx index 158693b73..1a682688b 100644 --- a/src/components/common/embedded/EmojiIconBackground.tsx +++ b/src/components/common/embedded/EmojiIconBackground.tsx @@ -56,15 +56,18 @@ const ICON_POSITIONS: IconPosition[] = [ const EMOJI_SIZE = REM; const LOTTIE_TINT_OPACITY = 'ff'; const NON_LOTTIE_TINT_OPACITY = 'bb'; +const EMOJI_SPACE = 0.75 * REM; type OwnProps = { emojiDocumentId: string; className?: string; + withEmojiSpace?: boolean; }; const EmojiIconBackground = ({ emojiDocumentId, className, + withEmojiSpace, }: OwnProps) => { const canvasRef = useRef(); const containerRef = useRef(); @@ -102,7 +105,8 @@ const EmojiIconBackground = ({ ICON_POSITIONS.forEach(({ inline, block, opacity, scale, }) => { - const x = (lang.isRtl ? inline : width / dpr - inline) * dpr; + const xShift = withEmojiSpace ? -EMOJI_SPACE : 0; + const x = ((lang.isRtl ? inline : width / dpr - inline) + xShift) * dpr; const y = block * dpr; const emojiSize = EMOJI_SIZE * dpr; @@ -128,7 +132,7 @@ const EmojiIconBackground = ({ useEffect(() => { updateCanvasAfterHeavyAnimation(); - }, [emojiImage, lang.isRtl, customColor, updateCanvasAfterHeavyAnimation]); + }, [emojiImage, lang.isRtl, customColor, updateCanvasAfterHeavyAnimation, withEmojiSpace]); const updateCanvasSize = useThrottleForHeavyAnimation((parentWidth: number, parentHeight: number) => { requestMutation(() => { diff --git a/src/components/common/helpers/peerColor.ts b/src/components/common/helpers/peerColor.ts deleted file mode 100644 index 4c606fe7b..000000000 --- a/src/components/common/helpers/peerColor.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { ApiPeer, ApiPeerColor } from '../../../api/types'; -import type { CustomPeer } from '../../../types'; - -import { getPeerColorCount, getPeerColorKey } from '../../../global/helpers'; - -export function getPeerColorClass(peer?: ApiPeer | CustomPeer, noUserColors?: boolean, shouldReset?: boolean) { - if (!peer) { - if (!shouldReset) return undefined; - return noUserColors ? 'peer-color-count-1' : 'peer-color-0'; - } - - if ('isCustomPeer' in peer) { - if (peer.peerColorId === undefined) return undefined; - return `peer-color-${peer.peerColorId}`; - } - return noUserColors ? `peer-color-count-${getPeerColorCount(peer)}` : `peer-color-${getPeerColorKey(peer)}`; -} - -export function getApiPeerColorClass(color: ApiPeerColor) { - return `peer-color-${color.color}`; -} diff --git a/src/components/common/profile/ProfileInfo.tsx b/src/components/common/profile/ProfileInfo.tsx index cb56a72b8..ba0d2acaf 100644 --- a/src/components/common/profile/ProfileInfo.tsx +++ b/src/components/common/profile/ProfileInfo.tsx @@ -369,6 +369,7 @@ const ProfileInfo = ({ user={user} chat={chat} photo={photo} + theme={theme} canPlayVideo={Boolean(isActive && canPlayVideo)} className={buildClassName(isActive && styles.activeProfilePhoto)} style={isActive ? createVtnStyle('avatar', true) : undefined} diff --git a/src/components/common/profile/ProfilePhoto.tsx b/src/components/common/profile/ProfilePhoto.tsx index f6500dd63..1308e39c0 100644 --- a/src/components/common/profile/ProfilePhoto.tsx +++ b/src/components/common/profile/ProfilePhoto.tsx @@ -1,9 +1,10 @@ -import type { FC, TeactNode } from '../../../lib/teact/teact'; +import type { TeactNode } from '../../../lib/teact/teact'; import { memo, useEffect, useMemo, useRef, } from '../../../lib/teact/teact'; import type { ApiChat, ApiPhoto, ApiUser } from '../../../api/types'; +import type { ThemeKey } from '../../../types'; import { getChatAvatarHash, @@ -18,9 +19,9 @@ import { } from '../../../global/helpers'; import { IS_CANVAS_FILTER_SUPPORTED } from '../../../util/browser/windowEnvironment'; import buildClassName from '../../../util/buildClassName'; +import buildStyle from '../../../util/buildStyle'; import { isUserId } from '../../../util/entities/ids'; import { getFirstLetters } from '../../../util/textFormat'; -import { getPeerColorClass } from '../helpers/peerColor'; import renderText from '../helpers/renderText'; import useAppLayout from '../../../hooks/useAppLayout'; @@ -29,6 +30,7 @@ import useFlag from '../../../hooks/useFlag'; import useLang from '../../../hooks/useLang'; import useMedia from '../../../hooks/useMedia'; import useMediaTransitionDeprecated from '../../../hooks/useMediaTransitionDeprecated'; +import usePeerColor from '../../../hooks/usePeerColor'; import OptimizedVideo from '../../ui/OptimizedVideo'; import Spinner from '../../ui/Spinner'; @@ -45,10 +47,11 @@ type OwnProps = { canPlayVideo: boolean; className?: string; style?: string; + theme: ThemeKey; onClick: NoneToVoidFunction; }; -const ProfilePhoto: FC = ({ +const ProfilePhoto = ({ chat, user, photo, @@ -57,8 +60,9 @@ const ProfilePhoto: FC = ({ canPlayVideo, className, style, + theme, onClick, -}) => { +}: OwnProps) => { const videoRef = useRef(); const lang = useLang(); @@ -92,6 +96,8 @@ const ProfilePhoto: FC = ({ ); const hasMedia = photo || previewBlobUrl || isBlurredThumb; + const { className: peerColorClass, style: peerColorStyle } = usePeerColor({ peer, theme }); + useEffect(() => { if (videoRef.current && !canPlayVideo) { videoRef.current.currentTime = 0; @@ -170,7 +176,7 @@ const ProfilePhoto: FC = ({ const fullClassName = buildClassName( 'ProfilePhoto', - getPeerColorClass(peer), + peerColorClass, isSavedMessages && 'saved-messages', isAnonymousForwards && 'anonymous-forwards', isDeleted && 'deleted-account', @@ -180,7 +186,11 @@ const ProfilePhoto: FC = ({ ); return ( -
+
{typeof content === 'string' ? renderText(content, ['hq_emoji']) : content}
); diff --git a/src/components/left/main/ChatTags.tsx b/src/components/left/main/ChatTags.tsx index 471ce3f3e..883d3dc72 100644 --- a/src/components/left/main/ChatTags.tsx +++ b/src/components/left/main/ChatTags.tsx @@ -4,9 +4,10 @@ import type { ApiChatFolder } from '../../../api/types'; import buildClassName from '../../../util/buildClassName'; import { REM } from '../../common/helpers/mediaDimensions'; -import { getApiPeerColorClass } from '../../common/helpers/peerColor'; import { renderTextWithEntities } from '../../common/helpers/renderTextWithEntities'; +import { getPeerColorClass } from '../../../hooks/usePeerColor'; + import styles from './ChatTags.module.scss'; const MAX_VISIBLE_TAGS = 3; @@ -39,7 +40,7 @@ const ChatTags = ({ key={folder.id} className={buildClassName( styles.tag, - getApiPeerColorClass({ color: folder.color }), + folder.color !== undefined && folder.color !== -1 && getPeerColorClass(folder.color), itemClassName, )} > diff --git a/src/components/left/settings/folders/SettingsFoldersEdit.tsx b/src/components/left/settings/folders/SettingsFoldersEdit.tsx index ef46cc1aa..d1560b572 100644 --- a/src/components/left/settings/folders/SettingsFoldersEdit.tsx +++ b/src/components/left/settings/folders/SettingsFoldersEdit.tsx @@ -20,12 +20,12 @@ import { findIntersectionWithSet } from '../../../../util/iteratees'; import { MEMO_EMPTY_ARRAY } from '../../../../util/memo'; import { CUSTOM_PEER_EXCLUDED_CHAT_TYPES, CUSTOM_PEER_INCLUDED_CHAT_TYPES } from '../../../../util/objects/customPeer'; import { LOCAL_TGS_URLS } from '../../../common/helpers/animatedAssets'; -import { getApiPeerColorClass } from '../../../common/helpers/peerColor'; import { renderTextWithEntities } from '../../../common/helpers/renderTextWithEntities'; import { selectChatFilters } from '../../../../hooks/reducers/useFoldersReducer'; import useHistoryBack from '../../../../hooks/useHistoryBack'; import useOldLang from '../../../../hooks/useOldLang'; +import { getPeerColorClass } from '../../../../hooks/usePeerColor'; import AnimatedIconWithPreview from '../../../common/AnimatedIconWithPreview'; import GroupChatInfo from '../../../common/GroupChatInfo'; @@ -362,7 +362,7 @@ const SettingsFoldersEdit: FC = ({ 'color-picker-title', 'color-picker-selected-color', isCurrentUserPremium && state.folder.color !== undefined && state.folder.color !== -1 - ? getApiPeerColorClass({ color: state.folder.color }) + ? getPeerColorClass(state.folder.color) : 'color-picker-item-disabled', )} > @@ -388,7 +388,7 @@ const SettingsFoldersEdit: FC = ({ }} className={buildClassName( 'color-picker-item', - getApiPeerColorClass({ color }), + getPeerColorClass(color), !isCurrentUserPremium && 'color-picker-item-hover-disabled', color === state.folder.color && isCurrentUserPremium && 'color-picker-item-active', )} diff --git a/src/components/left/settings/folders/SettingsFoldersMain.tsx b/src/components/left/settings/folders/SettingsFoldersMain.tsx index 2726423f3..e90bb3484 100644 --- a/src/components/left/settings/folders/SettingsFoldersMain.tsx +++ b/src/components/left/settings/folders/SettingsFoldersMain.tsx @@ -15,12 +15,12 @@ import { isBetween } from '../../../../util/math'; import { MEMO_EMPTY_ARRAY } from '../../../../util/memo'; import { throttle } from '../../../../util/schedulers'; import { LOCAL_TGS_URLS } from '../../../common/helpers/animatedAssets'; -import { getApiPeerColorClass } from '../../../common/helpers/peerColor'; import { renderTextWithEntities } from '../../../common/helpers/renderTextWithEntities'; import { useFolderManagerForChatsCount } from '../../../../hooks/useFolderManager'; import useHistoryBack from '../../../../hooks/useHistoryBack'; import useLang from '../../../../hooks/useLang'; +import { getPeerColorClass } from '../../../../hooks/usePeerColor'; import usePreviousDeprecated from '../../../../hooks/usePreviousDeprecated'; import AnimatedIconWithPreview from '../../../common/AnimatedIconWithPreview'; @@ -338,7 +338,7 @@ const SettingsFoldersMain: FC = ({ shouldRenderColor && (
) diff --git a/src/components/middle/composer/ComposerEmbeddedMessage.tsx b/src/components/middle/composer/ComposerEmbeddedMessage.tsx index a5d618883..96176eb2e 100644 --- a/src/components/middle/composer/ComposerEmbeddedMessage.tsx +++ b/src/components/middle/composer/ComposerEmbeddedMessage.tsx @@ -1,5 +1,3 @@ -import type { FC } from '../../../lib/teact/teact'; -import type React from '../../../lib/teact/teact'; import { memo, useEffect, useMemo, useRef, } from '../../../lib/teact/teact'; @@ -8,7 +6,7 @@ import { getActions, getGlobal, withGlobal } from '../../../global'; import type { ApiChat, ApiInputMessageReplyInfo, ApiInputSuggestedPostInfo, ApiMessage, ApiPeer, } from '../../../api/types'; -import type { MessageListType, ThreadId } from '../../../types/index'; +import type { MessageListType, ThemeKey, ThreadId } from '../../../types/index'; import { isChatChannel, stripCustomEmoji } from '../../../global/helpers'; import { @@ -24,18 +22,19 @@ import { selectIsCurrentUserPremium, selectSender, selectTabState, + selectTheme, } from '../../../global/selectors'; import { selectIsMediaNsfw } from '../../../global/selectors/media'; import buildClassName from '../../../util/buildClassName'; import captureEscKeyListener from '../../../util/captureEscKeyListener'; import { unique } from '../../../util/iteratees'; -import { getPeerColorClass } from '../../common/helpers/peerColor'; import useContextMenuHandlers from '../../../hooks/useContextMenuHandlers'; import useCurrentOrPrev from '../../../hooks/useCurrentOrPrev'; import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; import useOldLang from '../../../hooks/useOldLang'; +import usePeerColor from '../../../hooks/usePeerColor'; import useShowTransitionDeprecated from '../../../hooks/useShowTransitionDeprecated'; import { ClosableEmbeddedMessage } from '../../common/embedded/EmbeddedMessage'; @@ -69,6 +68,7 @@ type StateProps = { forwardMessageIds?: number[]; fromChatId?: string; isMediaNsfw?: boolean; + theme: ThemeKey; }; type OwnProps = { @@ -81,7 +81,7 @@ type OwnProps = { const CLOSE_DURATION = 350; -const ComposerEmbeddedMessage: FC = ({ +const ComposerEmbeddedMessage = ({ replyInfo, suggestedPostInfo, editingId, @@ -105,8 +105,9 @@ const ComposerEmbeddedMessage: FC = ({ forwardMessageIds, fromChatId, isMediaNsfw, + theme, onClear, -}) => { +}: OwnProps & StateProps) => { const { resetDraftReplyInfo, resetDraftSuggestedPostInfo, @@ -243,10 +244,12 @@ const ComposerEmbeddedMessage: FC = ({ const className = buildClassName('ComposerEmbeddedMessage', transitionClassNames); const renderingSender = useCurrentOrPrev(sender, true); - const innerClassName = buildClassName( - 'ComposerEmbeddedMessage_inner', - getPeerColorClass(renderingSender), - ); + + const { className: peerColorClass, style: peerColorStyle } = usePeerColor({ + peer: renderingSender, + theme, + }); + const innerClassName = buildClassName('ComposerEmbeddedMessage_inner', peerColorClass); const leftIcon = useMemo(() => { if (editingId) { @@ -292,7 +295,7 @@ const ComposerEmbeddedMessage: FC = ({ return (
-
+
{renderingLeftIcon && } {Boolean(replyInfo?.quoteText) && ( @@ -524,6 +527,7 @@ export default memo(withGlobal( forwardMessageIds, fromChatId, isMediaNsfw, + theme: selectTheme(global), }; }, )(ComposerEmbeddedMessage)); diff --git a/src/components/middle/message/FactCheck.tsx b/src/components/middle/message/FactCheck.tsx index 39074989f..2771964c8 100644 --- a/src/components/middle/message/FactCheck.tsx +++ b/src/components/middle/message/FactCheck.tsx @@ -1,6 +1,6 @@ import { memo, useMemo, useRef } from '../../../lib/teact/teact'; -import type { ApiFactCheck } from '../../../api/types'; +import type { ApiFactCheck, ApiPeerColor } from '../../../api/types'; import buildClassName from '../../../util/buildClassName'; import { renderTextWithEntities } from '../../common/helpers/renderTextWithEntities'; @@ -20,7 +20,8 @@ type OwnProps = { isToggleDisabled?: boolean; }; -const COLOR = { +const COLOR: ApiPeerColor = { + type: 'regular', color: 0, }; const MAX_LINES = 4; diff --git a/src/components/middle/message/Message.tsx b/src/components/middle/message/Message.tsx index 0eb2faf8e..3301ebc76 100644 --- a/src/components/middle/message/Message.tsx +++ b/src/components/middle/message/Message.tsx @@ -125,13 +125,13 @@ import { selectSharedSettings } from '../../../global/selectors/sharedState'; import { IS_TAURI } from '../../../util/browser/globalEnvironment'; import { IS_ANDROID, IS_TRANSLATION_SUPPORTED } from '../../../util/browser/windowEnvironment'; import buildClassName from '../../../util/buildClassName'; +import buildStyle from '../../../util/buildStyle'; import { isUserId } from '../../../util/entities/ids'; import { getMessageKey } from '../../../util/keys/messageKey'; import { getServerTime } from '../../../util/serverTime'; import stopEvent from '../../../util/stopEvent'; import { isElementInViewport } from '../../../util/visibility/isElementInViewport'; import { calculateDimensionsForMessageMedia, getStickerDimensions, REM } from '../../common/helpers/mediaDimensions'; -import { getPeerColorClass } from '../../common/helpers/peerColor'; import renderText from '../../common/helpers/renderText'; import { getCustomEmojiSize } from '../composer/helpers/customEmoji'; import { buildContentClassName } from './helpers/buildContentClassName'; @@ -148,6 +148,7 @@ import { useOnIntersect } from '../../../hooks/useIntersectionObserver'; import useLang from '../../../hooks/useLang'; import useLastCallback from '../../../hooks/useLastCallback'; import useOldLang from '../../../hooks/useOldLang'; +import usePeerColor from '../../../hooks/usePeerColor'; import usePreviousDeprecated from '../../../hooks/usePreviousDeprecated'; import useMessageResizeObserver from '../../../hooks/useResizeMessageObserver'; import useShowTransition from '../../../hooks/useShowTransition'; @@ -805,6 +806,13 @@ const Message = ({ (photo || video || storyData || (location?.mediaType === 'geo')) && (!hasText || isInvertedMedia)) ); + const { className: peerColorClass, style: peerColorStyle } = usePeerColor({ + peer: messageColorPeer, + noUserColors, + shouldReset: true, + theme, + }); + const contentClassName = buildContentClassName(message, album, { poll, webPage, @@ -820,7 +828,7 @@ const Message = ({ hasReactions, isGeoLiveActive: location?.mediaType === 'geoLive' && !isGeoLiveExpired(message), withVoiceTranscription, - peerColorClass: getPeerColorClass(messageColorPeer, noUserColors, true), + peerColorClass, hasOutsideReactions, }); @@ -987,9 +995,11 @@ const Message = ({ ]); const { - contentWidth, style, reactionsMaxWidth, + contentWidth, style: sizeStyles, reactionsMaxWidth, } = sizeCalculations; + const contentStyle = buildStyle(peerColorStyle, sizeStyles); + function renderMessageText(isForAnimation?: boolean) { if (!textMessage) return undefined; return ( @@ -1710,7 +1720,7 @@ const Message = ({ >
{asForwarded && !isInDocumentGroupNotFirst && ( diff --git a/src/components/middle/panes/BotAdPane.module.scss b/src/components/middle/panes/BotAdPane.module.scss index 400bc4241..5d7be6011 100644 --- a/src/components/middle/panes/BotAdPane.module.scss +++ b/src/components/middle/panes/BotAdPane.module.scss @@ -12,6 +12,7 @@ height: auto; // Slight variation from mixins.header-pane + padding-right: max(1rem, env(safe-area-inset-right)); padding-left: max(1rem, env(safe-area-inset-left)); line-height: 1.25; @@ -24,7 +25,12 @@ } .content { + display: flex; flex-grow: 1; + gap: 0.5rem; + align-items: center; + + color: var(--color-text); } .info { diff --git a/src/components/middle/panes/BotAdPane.tsx b/src/components/middle/panes/BotAdPane.tsx index 9c01c844d..6057c2412 100644 --- a/src/components/middle/panes/BotAdPane.tsx +++ b/src/components/middle/panes/BotAdPane.tsx @@ -1,4 +1,3 @@ -import type React from '../../../lib/teact/teact'; import { memo, useEffect } from '../../../lib/teact/teact'; import { getActions, withGlobal } from '../../../global'; @@ -6,8 +5,6 @@ import type { ApiSponsoredMessage } from '../../../api/types'; import type { MessageListType } from '../../../types'; import { selectBot, selectSponsoredMessage } from '../../../global/selectors'; -import buildClassName from '../../../util/buildClassName'; -import { getApiPeerColorClass } from '../../common/helpers/peerColor'; import { renderTextWithEntities } from '../../common/helpers/renderTextWithEntities'; import useContextMenuHandlers from '../../../hooks/useContextMenuHandlers'; @@ -18,6 +15,7 @@ import useHeaderPane, { type PaneState } from '../hooks/useHeaderPane'; import Avatar from '../../common/Avatar'; import BadgeButton from '../../common/BadgeButton'; +import PeerColorWrapper from '../../common/PeerColorWrapper'; import SponsoredMessageContextMenuContainer from '../message/SponsoredContextMenuContainer'; import styles from './BotAdPane.module.scss'; @@ -66,17 +64,17 @@ const BotAdPane = ({ } = useContextMenuHandlers(ref, !shouldRender, true); const handleClick = useLastCallback(() => { - if (!renderingSponsoredMessage) return; + if (!sponsoredMessage) return; - clickSponsored({ randomId: renderingSponsoredMessage.randomId }); - openUrl({ url: renderingSponsoredMessage.url, shouldSkipModal: true }); + clickSponsored({ randomId: sponsoredMessage.randomId }); + openUrl({ url: sponsoredMessage.url, shouldSkipModal: true }); }); const handleAboutClick = useLastCallback((e: React.MouseEvent) => { - if (!renderingSponsoredMessage) return; + if (!sponsoredMessage) return; const { randomId, additionalInfo, canReport, sponsorInfo, - } = renderingSponsoredMessage; + } = sponsoredMessage; e.stopPropagation(); openAboutAdsModal({ randomId, @@ -116,30 +114,36 @@ const BotAdPane = ({ onMouseDown={handleBeforeContextMenu} onContextMenu={handleContextMenu} > -
- - {lang('SponsoredMessageAd')} - - {lang('SponsoredMessageAdWhatIsThis')} - - -
{title}
- {content.text && ( -
- {renderTextWithEntities({ - text: content.text.text, - entities: content.text.entities, - })} -
+ + {photo && ( + )} -
- {photo && ( - - )} +
+ + {lang('SponsoredMessageAd')} + + {lang('SponsoredMessageAdWhatIsThis')} + + +
{title}
+ {content.text && ( +
+ {renderTextWithEntities({ + text: content.text.text, + entities: content.text.entities, + })} +
+ )} +
+
{contextMenuAnchor && ( ( } export function selectPeerProfileColor(global: T, peer: ApiPeer | CustomPeer) { - const key = 'isCustomPeer' in peer ? peer.peerColorId : peer.profileColor?.color; + const isCustomPeer = 'isCustomPeer' in peer; + const peerColorId = isCustomPeer ? peer.peerColorId : undefined; + const profileColor = !isCustomPeer ? peer.profileColor : undefined; + if (profileColor?.type === 'collectible') return undefined; + + const key = profileColor?.color || peerColorId; if (!key) return undefined; return global.peerColors?.profile?.[key]; } diff --git a/src/hooks/useFocusAfterAnimation.ts b/src/hooks/useFocusAfterAnimation.ts deleted file mode 100644 index 768d85485..000000000 --- a/src/hooks/useFocusAfterAnimation.ts +++ /dev/null @@ -1,23 +0,0 @@ -import type { ElementRef } from '../lib/teact/teact'; -import { useEffect } from '../lib/teact/teact'; - -import { requestMeasure } from '../lib/fasterdom/fasterdom'; -import { IS_TOUCH_ENV } from '../util/browser/windowEnvironment'; - -const DEFAULT_DURATION = 300; - -export default function useFocusAfterAnimation( - ref: ElementRef, animationDuration = DEFAULT_DURATION, -) { - useEffect(() => { - if (IS_TOUCH_ENV) { - return; - } - - setTimeout(() => { - requestMeasure(() => { - ref.current?.focus(); - }); - }, animationDuration); - }, [ref, animationDuration]); -} diff --git a/src/hooks/useMultiaccountInfo.ts b/src/hooks/useMultiaccountInfo.ts index 7df1958cc..a2fdba413 100644 --- a/src/hooks/useMultiaccountInfo.ts +++ b/src/hooks/useMultiaccountInfo.ts @@ -34,12 +34,13 @@ export default function useMultiaccountInfo(currentUser?: ApiUser) { useEffect(() => { if (!isUpdater || !isSynced) return; + const color = currentUser.color?.type === 'regular' ? currentUser.color.color : undefined; storeAccountData(ACCOUNT_SLOT, { userId: currentUser.id, firstName: currentUser.firstName, lastName: currentUser.lastName, emojiStatusId: currentUser.emojiStatus?.documentId, - color: currentUser.color?.color, + color, isPremium: currentUser.isPremium, phone: currentUser.phoneNumber, }); @@ -47,7 +48,7 @@ export default function useMultiaccountInfo(currentUser?: ApiUser) { refresh(); }, [ isUpdater, currentUser?.emojiStatus?.documentId, currentUser?.firstName, currentUser?.id, currentUser?.lastName, - currentUser?.color?.color, currentUser?.isPremium, currentUser?.phoneNumber, refresh, isSynced, + currentUser?.color, currentUser?.isPremium, currentUser?.phoneNumber, refresh, isSynced, ]); const updateAvatar = useLastCallback(async (url: string, abortSignal?: AbortSignal) => { diff --git a/src/hooks/usePeerColor.ts b/src/hooks/usePeerColor.ts new file mode 100644 index 000000000..40ffa3199 --- /dev/null +++ b/src/hooks/usePeerColor.ts @@ -0,0 +1,108 @@ +import { useRef } from '@teact'; + +import type { ApiPeer, ApiTypePeerColor } from '../api/types'; +import type { CustomPeer, ThemeKey } from '../types'; + +import { getPeerColorCollectibleColorCount, getPeerColorCount, getPeerColorKey } from '../global/helpers'; +import buildStyle from '../util/buildStyle'; +import { generateColorVariations, generatePeerColorGradient } from '../util/theme'; +import useSyncEffect from './useSyncEffect'; + +type PeerColorAttributes = { + className?: string; + style?: string; +}; + +type PeerColorProperties = PeerColorAttributes & { + backgroundEmojiId?: string; + giftEmojiId?: string; +}; + +export default function usePeerColor({ + peer, + color, + noUserColors, + shouldReset, + theme, +}: { + peer?: ApiPeer | CustomPeer; + color?: ApiTypePeerColor; + noUserColors?: boolean; + shouldReset?: boolean; + theme: ThemeKey; +}): PeerColorProperties { + const propertiesRef = useRef({}); + const realPeer = peer && !('isCustomPeer' in peer) ? peer : undefined; + + useSyncEffect(() => { + if (!peer) { + if (!shouldReset) { + propertiesRef.current = {}; + return; + } + + propertiesRef.current = { + className: noUserColors ? getPeerColorCountClass(1) : getPeerColorClass(0), + }; + return; + } + + if ('isCustomPeer' in peer) { + if (peer.peerColorId === undefined) { + propertiesRef.current = {}; + return; + } + + propertiesRef.current = { className: `peer-color-${peer.peerColorId}`, style: undefined }; + return; + } + + const peerColor = color || peer.color; + const isCollectible = peerColor?.type === 'collectible'; + const colorCount = peer ? getPeerColorCount(peer) + : isCollectible ? getPeerColorCollectibleColorCount(peerColor) : 1; + const colorCountClass = getPeerColorCountClass(colorCount); + const key = (isCollectible || !peerColor?.color) ? getPeerColorKey(peer) : peerColor.color; + + if (noUserColors) { + propertiesRef.current = { className: colorCountClass }; + return; + } + + if (peerColor?.type === 'collectible' && !noUserColors) { + const accentColor = theme === 'dark' && peerColor.darkAccentColor + ? peerColor.darkAccentColor : peerColor.accentColor; + const colors = theme === 'dark' && peerColor.darkColors ? peerColor.darkColors : peerColor.colors; + const gradient = generatePeerColorGradient(colors); + const { bg, bgActive } = generateColorVariations(accentColor); + propertiesRef.current = { + className: colorCountClass, + style: buildStyle( + `--bar-gradient: ${gradient}`, + `--accent-color: ${accentColor}`, + `--accent-background-color: ${bg}`, + `--accent-background-active-color: ${bgActive}`, + ), + }; + return; + } + + const className = (noUserColors || key === undefined) ? colorCountClass : getPeerColorClass(key); + propertiesRef.current = { className, style: undefined }; + }, [noUserColors, shouldReset, theme, color, peer]); + + return { + style: propertiesRef.current.style, + className: propertiesRef.current.className, + backgroundEmojiId: realPeer?.color?.backgroundEmojiId, + giftEmojiId: realPeer?.color?.type === 'collectible' ? realPeer.color.giftEmojiId : undefined, + }; +} + +export function getPeerColorClass(colorIndex: number) { + return `peer-color-${colorIndex}`; +} + +export function getPeerColorCountClass(colorCount: number) { + return `peer-color-count-${colorCount}`; +} diff --git a/src/lib/gramjs/client/MockClient.ts b/src/lib/gramjs/client/MockClient.ts index 74e80a73e..90be5f75c 100644 --- a/src/lib/gramjs/client/MockClient.ts +++ b/src/lib/gramjs/client/MockClient.ts @@ -138,6 +138,7 @@ class TelegramClient { messages: messages.map((message) => createMockedMessage(peerId, message.id, this.mockData)), chats: [], users: [], + topics: [], }); } @@ -158,11 +159,11 @@ class TelegramClient { }); } - if (request instanceof Api.channels.GetForumTopics) { - const channelId = getIdFromInputPeer(request.channel); - if (!channelId) return undefined; + if (request instanceof Api.messages.GetForumTopics) { + const peerId = getIdFromInputPeer(request.peer); + if (!peerId) return undefined; - const topics = this.getChannel(channelId)?.forumTopics; + const topics = this.getChannel(peerId)?.forumTopics; if (!topics) return undefined; @@ -173,7 +174,7 @@ class TelegramClient { topics: topics .sort((a, b) => b.id - a.id) .map((topic) => { - return createMockedForumTopic(channelId, topic.id, this.mockData); + return createMockedForumTopic(peerId, topic.id, this.mockData); }).filter((topic) => { if (offsetTopicId) { return topic.id < offsetTopicId; @@ -219,6 +220,7 @@ class TelegramClient { messages: this.getMessagesFrom(peerId), chats: [], users: [], + topics: [], }); } diff --git a/src/lib/gramjs/client/__invokeMiddlewares__/forums/no-topics.ts b/src/lib/gramjs/client/__invokeMiddlewares__/forums/no-topics.ts index 15dfbb432..059272d3f 100644 --- a/src/lib/gramjs/client/__invokeMiddlewares__/forums/no-topics.ts +++ b/src/lib/gramjs/client/__invokeMiddlewares__/forums/no-topics.ts @@ -3,7 +3,7 @@ import type TelegramClient from '../../MockClient'; import Api from '../../../tl/api'; export default async function(mockClient: TelegramClient, request: Api.Request) { - if (request instanceof Api.channels.GetForumTopics) { + if (request instanceof Api.messages.GetForumTopics) { await new Promise((resolve) => setTimeout(resolve, 2500)); } return 'pass'; diff --git a/src/lib/gramjs/client/__invokeMiddlewares__/mention.ts b/src/lib/gramjs/client/__invokeMiddlewares__/mention.ts index 310582ad0..662cbaefd 100644 --- a/src/lib/gramjs/client/__invokeMiddlewares__/mention.ts +++ b/src/lib/gramjs/client/__invokeMiddlewares__/mention.ts @@ -11,6 +11,7 @@ export default function(mockClient: TelegramClient, request: Api.Request { - emoticon: string; - CONSTRUCTOR_ID: 2860016453; + theme: Api.TypeChatTheme; + CONSTRUCTOR_ID: 3105602874; SUBCLASS_OF_ID: 2256589094; className: 'MessageActionSetChatTheme'; @@ -2984,11 +2990,13 @@ namespace Api { } export class MessageActionTopicCreate extends VirtualClass<{ // flags: Api.Type; + titleMissing?: true; title: string; iconColor: int; iconEmojiId?: long; }> { // flags: Api.Type; + titleMissing?: true; title: string; iconColor: int; iconEmojiId?: long; @@ -3249,6 +3257,7 @@ namespace Api { saved?: true; refunded?: true; prepaidUpgrade?: true; + assigned?: true; gift: Api.TypeStarGift; canExportAt?: int; transferStars?: long; @@ -3258,6 +3267,7 @@ namespace Api { resaleAmount?: Api.TypeStarsAmount; canTransferAt?: int; canResellAt?: int; + dropOriginalDetailsStars?: long; }> { // flags: Api.Type; upgrade?: true; @@ -3265,6 +3275,7 @@ namespace Api { saved?: true; refunded?: true; prepaidUpgrade?: true; + assigned?: true; gift: Api.TypeStarGift; canExportAt?: int; transferStars?: long; @@ -3274,7 +3285,8 @@ namespace Api { resaleAmount?: Api.TypeStarsAmount; canTransferAt?: int; canResellAt?: int; - CONSTRUCTOR_ID: 888627955; + dropOriginalDetailsStars?: long; + CONSTRUCTOR_ID: 2507310403; SUBCLASS_OF_ID: 2256589094; className: 'MessageActionStarGiftUnique'; @@ -3412,6 +3424,16 @@ namespace Api { static fromReader(reader: Reader): MessageActionGiftTon; } + export class MessageActionSuggestBirthday extends VirtualClass<{ + birthday: Api.TypeBirthday; + }> { + birthday: Api.TypeBirthday; + CONSTRUCTOR_ID: 747579941; + SUBCLASS_OF_ID: 2256589094; + className: 'MessageActionSuggestBirthday'; + + static fromReader(reader: Reader): MessageActionSuggestBirthday; + } export class Dialog extends VirtualClass<{ // flags: Api.Type; pinned?: true; @@ -3920,7 +3942,7 @@ namespace Api { commonChatsCount: int; folderId?: int; ttlPeriod?: int; - themeEmoticon?: string; + theme?: Api.TypeChatTheme; privateForwardName?: string; botGroupAdminRights?: Api.TypeChatAdminRights; botBroadcastAdminRights?: Api.TypeChatAdminRights; @@ -3944,6 +3966,7 @@ namespace Api { starsMyPendingRatingDate?: int; mainTab?: Api.TypeProfileTab; savedMusic?: Api.TypeDocument; + note?: Api.TypeTextWithEntities; }> { // flags: Api.Type; blocked?: true; @@ -3976,7 +3999,7 @@ namespace Api { commonChatsCount: int; folderId?: int; ttlPeriod?: int; - themeEmoticon?: string; + theme?: Api.TypeChatTheme; privateForwardName?: string; botGroupAdminRights?: Api.TypeChatAdminRights; botBroadcastAdminRights?: Api.TypeChatAdminRights; @@ -4000,7 +4023,8 @@ namespace Api { starsMyPendingRatingDate?: int; mainTab?: Api.TypeProfileTab; savedMusic?: Api.TypeDocument; - CONSTRUCTOR_ID: 1071128104; + note?: Api.TypeTextWithEntities; + CONSTRUCTOR_ID: 2687222078; SUBCLASS_OF_ID: 524706233; className: 'UserFull'; @@ -4207,12 +4231,16 @@ namespace Api { static fromReader(reader: Reader): UpdateDeleteMessages; } export class UpdateUserTyping extends VirtualClass<{ + // flags: Api.Type; userId: long; + topMsgId?: int; action: Api.TypeSendMessageAction; }> { + // flags: Api.Type; userId: long; + topMsgId?: int; action: Api.TypeSendMessageAction; - CONSTRUCTOR_ID: 3223225727; + CONSTRUCTOR_ID: 706199388; SUBCLASS_OF_ID: 2676568142; className: 'UpdateUserTyping'; @@ -4444,6 +4472,7 @@ namespace Api { // flags: Api.Type; folderId?: int; peer: Api.TypePeer; + topMsgId?: int; maxId: int; stillUnreadCount: int; pts: int; @@ -4452,11 +4481,12 @@ namespace Api { // flags: Api.Type; folderId?: int; peer: Api.TypePeer; + topMsgId?: int; maxId: int; stillUnreadCount: int; pts: int; ptsCount: int; - CONSTRUCTOR_ID: 2627162079; + CONSTRUCTOR_ID: 2659499161; SUBCLASS_OF_ID: 2676568142; className: 'UpdateReadHistoryInbox'; @@ -5660,36 +5690,6 @@ namespace Api { static fromReader(reader: Reader): UpdateMessageExtendedMedia; } - export class UpdateChannelPinnedTopic extends VirtualClass<{ - // flags: Api.Type; - pinned?: true; - channelId: long; - topicId: int; - }> { - // flags: Api.Type; - pinned?: true; - channelId: long; - topicId: int; - CONSTRUCTOR_ID: 422509539; - SUBCLASS_OF_ID: 2676568142; - className: 'UpdateChannelPinnedTopic'; - - static fromReader(reader: Reader): UpdateChannelPinnedTopic; - } - export class UpdateChannelPinnedTopics extends VirtualClass<{ - // flags: Api.Type; - channelId: long; - order?: int[]; - }> { - // flags: Api.Type; - channelId: long; - order?: int[]; - CONSTRUCTOR_ID: 4263085570; - SUBCLASS_OF_ID: 2676568142; - className: 'UpdateChannelPinnedTopics'; - - static fromReader(reader: Reader): UpdateChannelPinnedTopics; - } export class UpdateUser extends VirtualClass<{ userId: long; }> { @@ -6162,6 +6162,66 @@ namespace Api { static fromReader(reader: Reader): UpdateMonoForumNoPaidException; } + export class UpdateGroupCallMessage extends VirtualClass<{ + call: Api.TypeInputGroupCall; + fromId: Api.TypePeer; + randomId: long; + message: Api.TypeTextWithEntities; + }> { + call: Api.TypeInputGroupCall; + fromId: Api.TypePeer; + randomId: long; + message: Api.TypeTextWithEntities; + CONSTRUCTOR_ID: 2026050784; + SUBCLASS_OF_ID: 2676568142; + className: 'UpdateGroupCallMessage'; + + static fromReader(reader: Reader): UpdateGroupCallMessage; + } + export class UpdateGroupCallEncryptedMessage extends VirtualClass<{ + call: Api.TypeInputGroupCall; + fromId: Api.TypePeer; + encryptedMessage: bytes; + }> { + call: Api.TypeInputGroupCall; + fromId: Api.TypePeer; + encryptedMessage: bytes; + CONSTRUCTOR_ID: 3377964902; + SUBCLASS_OF_ID: 2676568142; + className: 'UpdateGroupCallEncryptedMessage'; + + static fromReader(reader: Reader): UpdateGroupCallEncryptedMessage; + } + export class UpdatePinnedForumTopic extends VirtualClass<{ + // flags: Api.Type; + pinned?: true; + peer: Api.TypePeer; + topicId: int; + }> { + // flags: Api.Type; + pinned?: true; + peer: Api.TypePeer; + topicId: int; + CONSTRUCTOR_ID: 1748708434; + SUBCLASS_OF_ID: 2676568142; + className: 'UpdatePinnedForumTopic'; + + static fromReader(reader: Reader): UpdatePinnedForumTopic; + } + export class UpdatePinnedForumTopics extends VirtualClass<{ + // flags: Api.Type; + peer: Api.TypePeer; + order?: int[]; + }> { + // flags: Api.Type; + peer: Api.TypePeer; + order?: int[]; + CONSTRUCTOR_ID: 3740353488; + SUBCLASS_OF_ID: 2676568142; + className: 'UpdatePinnedForumTopics'; + + static fromReader(reader: Reader): UpdatePinnedForumTopics; + } export class UpdatesTooLong extends VirtualClass { CONSTRUCTOR_ID: 3809980286; SUBCLASS_OF_ID: 2331323052; @@ -6941,6 +7001,18 @@ namespace Api { static fromReader(reader: Reader): SendMessageEmojiInteractionSeen; } + export class SendMessageTextDraftAction extends VirtualClass<{ + randomId: long; + text: Api.TypeTextWithEntities; + }> { + randomId: long; + text: Api.TypeTextWithEntities; + CONSTRUCTOR_ID: 929929052; + SUBCLASS_OF_ID: 548588577; + className: 'SendMessageTextDraftAction'; + + static fromReader(reader: Reader): SendMessageTextDraftAction; + } export class InputPrivacyKeyStatusTimestamp extends VirtualClass { CONSTRUCTOR_ID: 1335282456; SUBCLASS_OF_ID: 87435256; @@ -13483,6 +13555,9 @@ namespace Api { listenersHidden?: true; conference?: true; creator?: true; + messagesEnabled?: true; + canChangeMessagesEnabled?: true; + min?: true; id: long; accessHash: long; participantsCount: int; @@ -13506,6 +13581,9 @@ namespace Api { listenersHidden?: true; conference?: true; creator?: true; + messagesEnabled?: true; + canChangeMessagesEnabled?: true; + min?: true; id: long; accessHash: long; participantsCount: int; @@ -13771,6 +13849,28 @@ namespace Api { static fromReader(reader: Reader): BotCommandScopePeerUser; } + export class ChatTheme extends VirtualClass<{ + emoticon: string; + }> { + emoticon: string; + CONSTRUCTOR_ID: 3286236164; + SUBCLASS_OF_ID: 805087221; + className: 'ChatTheme'; + + static fromReader(reader: Reader): ChatTheme; + } + export class ChatThemeUniqueGift extends VirtualClass<{ + gift: Api.TypeStarGift; + themeSettings: Api.TypeThemeSettings[]; + }> { + gift: Api.TypeStarGift; + themeSettings: Api.TypeThemeSettings[]; + CONSTRUCTOR_ID: 878246344; + SUBCLASS_OF_ID: 805087221; + className: 'ChatThemeUniqueGift'; + + static fromReader(reader: Reader): ChatThemeUniqueGift; + } export class SponsoredMessage extends VirtualClass<{ // flags: Api.Type; recommended?: true; @@ -14321,6 +14421,26 @@ namespace Api { static fromReader(reader: Reader): InputInvoiceStarGiftPrepaidUpgrade; } + export class InputInvoicePremiumAuthCode extends VirtualClass<{ + purpose: Api.TypeInputStorePaymentPurpose; + }> { + purpose: Api.TypeInputStorePaymentPurpose; + CONSTRUCTOR_ID: 1048049172; + SUBCLASS_OF_ID: 1919851518; + className: 'InputInvoicePremiumAuthCode'; + + static fromReader(reader: Reader): InputInvoicePremiumAuthCode; + } + export class InputInvoiceStarGiftDropOriginalDetails extends VirtualClass<{ + stargift: Api.TypeInputSavedStarGift; + }> { + stargift: Api.TypeInputSavedStarGift; + CONSTRUCTOR_ID: 153344209; + SUBCLASS_OF_ID: 1919851518; + className: 'InputInvoiceStarGiftDropOriginalDetails'; + + static fromReader(reader: Reader): InputInvoiceStarGiftDropOriginalDetails; + } export class InputStorePaymentPremiumSubscription extends VirtualClass<{ // flags: Api.Type; restore?: true; @@ -14796,8 +14916,10 @@ namespace Api { pinned?: true; short?: true; hidden?: true; + titleMissing?: true; id: int; date: int; + peer: Api.TypePeer; title: string; iconColor: int; iconEmojiId?: long; @@ -14817,8 +14939,10 @@ namespace Api { pinned?: true; short?: true; hidden?: true; + titleMissing?: true; id: int; date: int; + peer: Api.TypePeer; title: string; iconColor: int; iconEmojiId?: long; @@ -14831,7 +14955,7 @@ namespace Api { fromId: Api.TypePeer; notifySettings: Api.TypePeerNotifySettings; draft?: Api.TypeDraftMessage; - CONSTRUCTOR_ID: 1903173033; + CONSTRUCTOR_ID: 3456044746; SUBCLASS_OF_ID: 2367169027; className: 'ForumTopic'; @@ -15759,6 +15883,40 @@ namespace Api { static fromReader(reader: Reader): PeerColor; } + export class PeerColorCollectible extends VirtualClass<{ + // flags: Api.Type; + collectibleId: long; + giftEmojiId: long; + backgroundEmojiId: long; + accentColor: int; + colors: int[]; + darkAccentColor?: int; + darkColors?: int[]; + }> { + // flags: Api.Type; + collectibleId: long; + giftEmojiId: long; + backgroundEmojiId: long; + accentColor: int; + colors: int[]; + darkAccentColor?: int; + darkColors?: int[]; + CONSTRUCTOR_ID: 3116393370; + SUBCLASS_OF_ID: 4068582527; + className: 'PeerColorCollectible'; + + static fromReader(reader: Reader): PeerColorCollectible; + } + export class InputPeerColorCollectible extends VirtualClass<{ + collectibleId: long; + }> { + collectibleId: long; + CONSTRUCTOR_ID: 3102377641; + SUBCLASS_OF_ID: 4068582527; + className: 'InputPeerColorCollectible'; + + static fromReader(reader: Reader): InputPeerColorCollectible; + } export class StoryReaction extends VirtualClass<{ peerId: Api.TypePeer; date: int; @@ -16552,6 +16710,7 @@ namespace Api { stargiftResale?: true; postsSearch?: true; stargiftPrepaidUpgrade?: true; + stargiftDropOriginalDetails?: true; id: string; amount: Api.TypeStarsAmount; date: int; @@ -16587,6 +16746,7 @@ namespace Api { stargiftResale?: true; postsSearch?: true; stargiftPrepaidUpgrade?: true; + stargiftDropOriginalDetails?: true; id: string; amount: Api.TypeStarsAmount; date: int; @@ -16827,6 +16987,7 @@ namespace Api { birthday?: true; requirePremium?: true; limitedPerUser?: true; + peerColorAvailable?: true; id: long; sticker: Api.TypeDocument; stars: long; @@ -16850,6 +17011,7 @@ namespace Api { birthday?: true; requirePremium?: true; limitedPerUser?: true; + peerColorAvailable?: true; id: long; sticker: Api.TypeDocument; stars: long; @@ -16876,6 +17038,7 @@ namespace Api { // flags: Api.Type; requirePremium?: true; resaleTonOnly?: true; + themeAvailable?: true; id: long; giftId: long; title: string; @@ -16892,10 +17055,14 @@ namespace Api { releasedBy?: Api.TypePeer; valueAmount?: long; valueCurrency?: string; + themePeer?: Api.TypePeer; + peerColor?: Api.TypePeerColor; + hostId?: Api.TypePeer; }> { // flags: Api.Type; requirePremium?: true; resaleTonOnly?: true; + themeAvailable?: true; id: long; giftId: long; title: string; @@ -16912,7 +17079,10 @@ namespace Api { releasedBy?: Api.TypePeer; valueAmount?: long; valueCurrency?: string; - CONSTRUCTOR_ID: 648369470; + themePeer?: Api.TypePeer; + peerColor?: Api.TypePeerColor; + hostId?: Api.TypePeer; + CONSTRUCTOR_ID: 2965337115; SUBCLASS_OF_ID: 3273414923; className: 'StarGiftUnique'; @@ -17173,6 +17343,7 @@ namespace Api { canResellAt?: int; collectionId?: int[]; prepaidUpgradeHash?: string; + dropOriginalDetailsStars?: long; }> { // flags: Api.Type; nameHidden?: true; @@ -17195,7 +17366,8 @@ namespace Api { canResellAt?: int; collectionId?: int[]; prepaidUpgradeHash?: string; - CONSTRUCTOR_ID: 430552434; + dropOriginalDetailsStars?: long; + CONSTRUCTOR_ID: 2307105874; SUBCLASS_OF_ID: 2385198100; className: 'SavedStarGift'; @@ -17607,6 +17779,45 @@ namespace Api { static fromReader(reader: Reader): ProfileTabGifs; } + export class InputChatThemeEmpty extends VirtualClass { + CONSTRUCTOR_ID: 2200339587; + SUBCLASS_OF_ID: 1462324836; + className: 'InputChatThemeEmpty'; + + static fromReader(reader: Reader): InputChatThemeEmpty; + } + export class InputChatTheme extends VirtualClass<{ + emoticon: string; + }> { + emoticon: string; + CONSTRUCTOR_ID: 3376277852; + SUBCLASS_OF_ID: 1462324836; + className: 'InputChatTheme'; + + static fromReader(reader: Reader): InputChatTheme; + } + export class InputChatThemeUniqueGift extends VirtualClass<{ + slug: string; + }> { + slug: string; + CONSTRUCTOR_ID: 2279989220; + SUBCLASS_OF_ID: 1462324836; + className: 'InputChatThemeUniqueGift'; + + static fromReader(reader: Reader): InputChatThemeUniqueGift; + } + export class StarGiftUpgradePrice extends VirtualClass<{ + date: int; + upgradeStars: long; + }> { + date: int; + upgradeStars: long; + CONSTRUCTOR_ID: 2582262557; + SUBCLASS_OF_ID: 4099078244; + className: 'StarGiftUpgradePrice'; + + static fromReader(reader: Reader): StarGiftUpgradePrice; + } export class ResPQ extends VirtualClass<{ nonce: int128; serverNonce: int128; @@ -18296,12 +18507,16 @@ namespace Api { phoneCodeHash: string; supportEmailAddress: string; supportEmailSubject: string; + currency: string; + amount: long; }> { storeProduct: string; phoneCodeHash: string; supportEmailAddress: string; supportEmailSubject: string; - CONSTRUCTOR_ID: 3617783033; + currency: string; + amount: long; + CONSTRUCTOR_ID: 3767884348; SUBCLASS_OF_ID: 1827172481; className: 'SentCodePaymentRequired'; @@ -18798,13 +19013,15 @@ namespace Api { } export class Messages extends VirtualClass<{ messages: Api.TypeMessage[]; + topics: Api.TypeForumTopic[]; chats: Api.TypeChat[]; users: Api.TypeUser[]; }> { messages: Api.TypeMessage[]; + topics: Api.TypeForumTopic[]; chats: Api.TypeChat[]; users: Api.TypeUser[]; - CONSTRUCTOR_ID: 2356252295; + CONSTRUCTOR_ID: 494135274; SUBCLASS_OF_ID: 3568569182; className: 'Messages'; @@ -18818,6 +19035,7 @@ namespace Api { offsetIdOffset?: int; searchFlood?: Api.TypeSearchPostsFlood; messages: Api.TypeMessage[]; + topics: Api.TypeForumTopic[]; chats: Api.TypeChat[]; users: Api.TypeUser[]; }> { @@ -18828,9 +19046,10 @@ namespace Api { offsetIdOffset?: int; searchFlood?: Api.TypeSearchPostsFlood; messages: Api.TypeMessage[]; + topics: Api.TypeForumTopic[]; chats: Api.TypeChat[]; users: Api.TypeUser[]; - CONSTRUCTOR_ID: 1982539325; + CONSTRUCTOR_ID: 1595959062; SUBCLASS_OF_ID: 3568569182; className: 'MessagesSlice'; @@ -20881,6 +21100,33 @@ namespace Api { static fromReader(reader: Reader): ResetPasswordOk; } + export class ChatThemesNotModified extends VirtualClass { + CONSTRUCTOR_ID: 3759268292; + SUBCLASS_OF_ID: 364989096; + className: 'ChatThemesNotModified'; + + static fromReader(reader: Reader): ChatThemesNotModified; + } + export class ChatThemes extends VirtualClass<{ + // flags: Api.Type; + hash: long; + themes: Api.TypeChatTheme[]; + chats: Api.TypeChat[]; + users: Api.TypeUser[]; + nextOffset?: string; + }> { + // flags: Api.Type; + hash: long; + themes: Api.TypeChatTheme[]; + chats: Api.TypeChat[]; + users: Api.TypeUser[]; + nextOffset?: string; + CONSTRUCTOR_ID: 3188294003; + SUBCLASS_OF_ID: 364989096; + className: 'ChatThemes'; + + static fromReader(reader: Reader): ChatThemes; + } export class SavedRingtonesNotModified extends VirtualClass { CONSTRUCTOR_ID: 4227262641; SUBCLASS_OF_ID: 666683742; @@ -21561,9 +21807,13 @@ namespace Api { } export class StarGiftUpgradePreview extends VirtualClass<{ sampleAttributes: Api.TypeStarGiftAttribute[]; + prices: Api.TypeStarGiftUpgradePrice[]; + nextPrices: Api.TypeStarGiftUpgradePrice[]; }> { sampleAttributes: Api.TypeStarGiftAttribute[]; - CONSTRUCTOR_ID: 377215243; + prices: Api.TypeStarGiftUpgradePrice[]; + nextPrices: Api.TypeStarGiftUpgradePrice[]; + CONSTRUCTOR_ID: 1038213101; SUBCLASS_OF_ID: 1579903175; className: 'StarGiftUpgradePreview'; @@ -22810,6 +23060,15 @@ namespace Api { phoneCodeHash: string; mnc: string; } + export class CheckPaidAuth extends Request<{ + phoneNumber: string; + phoneCodeHash: string; + formId: long; + }, auth.TypeSentCode> { + phoneNumber: string; + phoneCodeHash: string; + formId: long; + } } export namespace account { @@ -23370,13 +23629,11 @@ namespace Api { export class UpdateColor extends Request<{ // flags: Api.Type; forProfile?: true; - color?: int; - backgroundEmojiId?: long; + color?: Api.TypePeerColor; } | void, Bool> { // flags: Api.Type; forProfile?: true; - color?: int; - backgroundEmojiId?: long; + color?: Api.TypePeerColor; } export class GetDefaultBackgroundEmojis extends Request<{ hash: long; @@ -23555,6 +23812,15 @@ namespace Api { }, account.TypeSavedMusicIds> { hash: long; } + export class GetUniqueGiftChatThemes extends Request<{ + offset: string; + limit: int; + hash: long; + }, account.TypeChatThemes> { + offset: string; + limit: int; + hash: long; + } } export namespace users { @@ -23598,6 +23864,13 @@ namespace Api { id: Api.TypeInputUser; documents: Api.TypeInputDocument[]; } + export class SuggestBirthday extends Request<{ + id: Api.TypeInputUser; + birthday: Api.TypeBirthday; + }, Api.TypeUpdates> { + id: Api.TypeInputUser; + birthday: Api.TypeBirthday; + } } export namespace contacts { @@ -23722,6 +23995,7 @@ namespace Api { firstName: string; lastName: string; phone: string; + note?: Api.TypeTextWithEntities; }, Api.TypeUpdates> { // flags: Api.Type; addPhonePrivacyException?: true; @@ -23729,6 +24003,7 @@ namespace Api { firstName: string; lastName: string; phone: string; + note?: Api.TypeTextWithEntities; } export class AcceptContact extends Request<{ id: Api.TypeInputUser; @@ -23792,6 +24067,13 @@ namespace Api { }, contacts.TypeSponsoredPeers> { q: string; } + export class UpdateContactNote extends Request<{ + id: Api.TypeInputUser; + note: Api.TypeTextWithEntities; + }, Bool> { + id: Api.TypeInputUser; + note: Api.TypeTextWithEntities; + } } export namespace messages { @@ -25273,10 +25555,10 @@ namespace Api { } export class SetChatTheme extends Request<{ peer: Api.TypeInputPeer; - emoticon: string; + theme: Api.TypeInputChatTheme; }, Api.TypeUpdates> { peer: Api.TypeInputPeer; - emoticon: string; + theme: Api.TypeInputChatTheme; } export class GetMessageReadParticipants extends Request<{ peer: Api.TypeInputPeer; @@ -26125,6 +26407,93 @@ namespace Api { scheduleDate?: int; rejectComment?: string; } + export class GetForumTopics extends Request<{ + // flags: Api.Type; + peer: Api.TypeInputPeer; + q?: string; + offsetDate: int; + offsetId: int; + offsetTopic: int; + limit: int; + }, messages.TypeForumTopics> { + // flags: Api.Type; + peer: Api.TypeInputPeer; + q?: string; + offsetDate: int; + offsetId: int; + offsetTopic: int; + limit: int; + } + export class GetForumTopicsByID extends Request<{ + peer: Api.TypeInputPeer; + topics: int[]; + }, messages.TypeForumTopics> { + peer: Api.TypeInputPeer; + topics: int[]; + } + export class EditForumTopic extends Request<{ + // flags: Api.Type; + peer: Api.TypeInputPeer; + topicId: int; + title?: string; + iconEmojiId?: long; + closed?: Bool; + hidden?: Bool; + }, Api.TypeUpdates> { + // flags: Api.Type; + peer: Api.TypeInputPeer; + topicId: int; + title?: string; + iconEmojiId?: long; + closed?: Bool; + hidden?: Bool; + } + export class UpdatePinnedForumTopic extends Request<{ + peer: Api.TypeInputPeer; + topicId: int; + pinned: Bool; + }, Api.TypeUpdates> { + peer: Api.TypeInputPeer; + topicId: int; + pinned: Bool; + } + export class ReorderPinnedForumTopics extends Request<{ + // flags: Api.Type; + force?: true; + peer: Api.TypeInputPeer; + order: int[]; + }, Api.TypeUpdates> { + // flags: Api.Type; + force?: true; + peer: Api.TypeInputPeer; + order: int[]; + } + export class CreateForumTopic extends Request<{ + // flags: Api.Type; + titleMissing?: true; + peer: Api.TypeInputPeer; + title: string; + iconColor?: int; + iconEmojiId?: long; + randomId: long; + sendAs?: Api.TypeInputPeer; + }, Api.TypeUpdates> { + // flags: Api.Type; + titleMissing?: true; + peer: Api.TypeInputPeer; + title: string; + iconColor?: int; + iconEmojiId?: long; + randomId: long; + sendAs?: Api.TypeInputPeer; + } + export class DeleteTopicHistory extends Request<{ + peer: Api.TypeInputPeer; + topMsgId: int; + }, messages.TypeAffectedHistory> { + peer: Api.TypeInputPeer; + topMsgId: int; + } } export namespace updates { @@ -26752,91 +27121,6 @@ namespace Api { enabled: Bool; tabs: Bool; } - export class CreateForumTopic extends Request<{ - // flags: Api.Type; - channel: Api.TypeInputChannel; - title: string; - iconColor?: int; - iconEmojiId?: long; - randomId: long; - sendAs?: Api.TypeInputPeer; - }, Api.TypeUpdates> { - // flags: Api.Type; - channel: Api.TypeInputChannel; - title: string; - iconColor?: int; - iconEmojiId?: long; - randomId: long; - sendAs?: Api.TypeInputPeer; - } - export class GetForumTopics extends Request<{ - // flags: Api.Type; - channel: Api.TypeInputChannel; - q?: string; - offsetDate: int; - offsetId: int; - offsetTopic: int; - limit: int; - }, messages.TypeForumTopics> { - // flags: Api.Type; - channel: Api.TypeInputChannel; - q?: string; - offsetDate: int; - offsetId: int; - offsetTopic: int; - limit: int; - } - export class GetForumTopicsByID extends Request<{ - channel: Api.TypeInputChannel; - topics: int[]; - }, messages.TypeForumTopics> { - channel: Api.TypeInputChannel; - topics: int[]; - } - export class EditForumTopic extends Request<{ - // flags: Api.Type; - channel: Api.TypeInputChannel; - topicId: int; - title?: string; - iconEmojiId?: long; - closed?: Bool; - hidden?: Bool; - }, Api.TypeUpdates> { - // flags: Api.Type; - channel: Api.TypeInputChannel; - topicId: int; - title?: string; - iconEmojiId?: long; - closed?: Bool; - hidden?: Bool; - } - export class UpdatePinnedForumTopic extends Request<{ - channel: Api.TypeInputChannel; - topicId: int; - pinned: Bool; - }, Api.TypeUpdates> { - channel: Api.TypeInputChannel; - topicId: int; - pinned: Bool; - } - export class DeleteTopicHistory extends Request<{ - channel: Api.TypeInputChannel; - topMsgId: int; - }, messages.TypeAffectedHistory> { - channel: Api.TypeInputChannel; - topMsgId: int; - } - export class ReorderPinnedForumTopics extends Request<{ - // flags: Api.Type; - force?: true; - channel: Api.TypeInputChannel; - order: int[]; - }, Api.TypeUpdates> { - // flags: Api.Type; - force?: true; - channel: Api.TypeInputChannel; - order: int[]; - } export class ToggleAntiSpam extends Request<{ channel: Api.TypeInputChannel; enabled: Bool; @@ -27556,6 +27840,8 @@ namespace Api { sortByValue?: true; excludeUpgradable?: true; excludeUnupgradable?: true; + peerColorAvailable?: true; + excludeHosted?: true; peer: Api.TypeInputPeer; collectionId?: int; offset: string; @@ -27569,6 +27855,8 @@ namespace Api { sortByValue?: true; excludeUpgradable?: true; excludeUnupgradable?: true; + peerColorAvailable?: true; + excludeHosted?: true; peer: Api.TypeInputPeer; collectionId?: int; offset: string; @@ -27934,11 +28222,13 @@ namespace Api { resetInviteHash?: true; call: Api.TypeInputGroupCall; joinMuted?: Bool; + messagesEnabled?: Bool; }, Api.TypeUpdates> { // flags: Api.Type; resetInviteHash?: true; call: Api.TypeInputGroupCall; joinMuted?: Bool; + messagesEnabled?: Bool; } export class GetGroupCall extends Request<{ call: Api.TypeInputGroupCall; @@ -28142,6 +28432,22 @@ namespace Api { offset: int; limit: int; } + export class SendGroupCallMessage extends Request<{ + call: Api.TypeInputGroupCall; + randomId: long; + message: Api.TypeTextWithEntities; + }, Bool> { + call: Api.TypeInputGroupCall; + randomId: long; + message: Api.TypeTextWithEntities; + } + export class SendGroupCallEncryptedMessage extends Request<{ + call: Api.TypeInputGroupCall; + encryptedMessage: bytes; + }, Bool> { + call: Api.TypeInputGroupCall; + encryptedMessage: bytes; + } } export namespace langpack { @@ -28734,20 +29040,20 @@ namespace Api { } export type AnyRequest = InvokeAfterMsg | InvokeAfterMsgs | InitConnection | InvokeWithLayer | InvokeWithoutUpdates | InvokeWithMessagesRange | InvokeWithTakeout | InvokeWithBusinessConnection | InvokeWithGooglePlayIntegrity | InvokeWithApnsSecret | InvokeWithReCaptcha | ReqPq | ReqPqMulti | ReqPqMultiNew | ReqDHParams | SetClientDHParams | DestroyAuthKey | RpcDropAnswer | GetFutureSalts | Ping | PingDelayDisconnect | DestroySession - | auth.SendCode | auth.SignUp | auth.SignIn | auth.LogOut | auth.ResetAuthorizations | auth.ExportAuthorization | auth.ImportAuthorization | auth.BindTempAuthKey | auth.ImportBotAuthorization | auth.CheckPassword | auth.RequestPasswordRecovery | auth.RecoverPassword | auth.ResendCode | auth.CancelCode | auth.DropTempAuthKeys | auth.ExportLoginToken | auth.ImportLoginToken | auth.AcceptLoginToken | auth.CheckRecoveryPassword | auth.ImportWebTokenAuthorization | auth.RequestFirebaseSms | auth.ResetLoginEmail | auth.ReportMissingCode - | account.RegisterDevice | account.UnregisterDevice | account.UpdateNotifySettings | account.GetNotifySettings | account.ResetNotifySettings | account.UpdateProfile | account.UpdateStatus | account.GetWallPapers | account.ReportPeer | account.CheckUsername | account.UpdateUsername | account.GetPrivacy | account.SetPrivacy | account.DeleteAccount | account.GetAccountTTL | account.SetAccountTTL | account.SendChangePhoneCode | account.ChangePhone | account.UpdateDeviceLocked | account.GetAuthorizations | account.ResetAuthorization | account.GetPassword | account.GetPasswordSettings | account.UpdatePasswordSettings | account.SendConfirmPhoneCode | account.ConfirmPhone | account.GetTmpPassword | account.GetWebAuthorizations | account.ResetWebAuthorization | account.ResetWebAuthorizations | account.GetAllSecureValues | account.GetSecureValue | account.SaveSecureValue | account.DeleteSecureValue | account.GetAuthorizationForm | account.AcceptAuthorization | account.SendVerifyPhoneCode | account.VerifyPhone | account.SendVerifyEmailCode | account.VerifyEmail | account.InitTakeoutSession | account.FinishTakeoutSession | account.ConfirmPasswordEmail | account.ResendPasswordEmail | account.CancelPasswordEmail | account.GetContactSignUpNotification | account.SetContactSignUpNotification | account.GetNotifyExceptions | account.GetWallPaper | account.UploadWallPaper | account.SaveWallPaper | account.InstallWallPaper | account.ResetWallPapers | account.GetAutoDownloadSettings | account.SaveAutoDownloadSettings | account.UploadTheme | account.CreateTheme | account.UpdateTheme | account.SaveTheme | account.InstallTheme | account.GetTheme | account.GetThemes | account.SetContentSettings | account.GetContentSettings | account.GetMultiWallPapers | account.GetGlobalPrivacySettings | account.SetGlobalPrivacySettings | account.ReportProfilePhoto | account.ResetPassword | account.DeclinePasswordReset | account.GetChatThemes | account.SetAuthorizationTTL | account.ChangeAuthorizationSettings | account.GetSavedRingtones | account.SaveRingtone | account.UploadRingtone | account.UpdateEmojiStatus | account.GetDefaultEmojiStatuses | account.GetRecentEmojiStatuses | account.ClearRecentEmojiStatuses | account.ReorderUsernames | account.ToggleUsername | account.GetDefaultProfilePhotoEmojis | account.GetDefaultGroupPhotoEmojis | account.GetAutoSaveSettings | account.SaveAutoSaveSettings | account.DeleteAutoSaveExceptions | account.InvalidateSignInCodes | account.UpdateColor | account.GetDefaultBackgroundEmojis | account.GetChannelDefaultEmojiStatuses | account.GetChannelRestrictedStatusEmojis | account.UpdateBusinessWorkHours | account.UpdateBusinessLocation | account.UpdateBusinessGreetingMessage | account.UpdateBusinessAwayMessage | account.UpdateConnectedBot | account.GetConnectedBots | account.GetBotBusinessConnection | account.UpdateBusinessIntro | account.ToggleConnectedBotPaused | account.DisablePeerConnectedBot | account.UpdateBirthday | account.CreateBusinessChatLink | account.EditBusinessChatLink | account.DeleteBusinessChatLink | account.GetBusinessChatLinks | account.ResolveBusinessChatLink | account.UpdatePersonalChannel | account.ToggleSponsoredMessages | account.GetReactionsNotifySettings | account.SetReactionsNotifySettings | account.GetCollectibleEmojiStatuses | account.GetPaidMessagesRevenue | account.ToggleNoPaidMessagesException | account.SetMainProfileTab | account.SaveMusic | account.GetSavedMusicIds - | users.GetUsers | users.GetFullUser | users.SetSecureValueErrors | users.GetRequirementsToContact | users.GetSavedMusic | users.GetSavedMusicByID - | contacts.GetContactIDs | contacts.GetStatuses | contacts.GetContacts | contacts.ImportContacts | contacts.DeleteContacts | contacts.DeleteByPhones | contacts.Block | contacts.Unblock | contacts.GetBlocked | contacts.Search | contacts.ResolveUsername | contacts.GetTopPeers | contacts.ResetTopPeerRating | contacts.ResetSaved | contacts.GetSaved | contacts.ToggleTopPeers | contacts.AddContact | contacts.AcceptContact | contacts.GetLocated | contacts.BlockFromReplies | contacts.ResolvePhone | contacts.ExportContactToken | contacts.ImportContactToken | contacts.EditCloseFriends | contacts.SetBlocked | contacts.GetBirthdays | contacts.GetSponsoredPeers - | messages.GetMessages | messages.GetDialogs | messages.GetHistory | messages.Search | messages.ReadHistory | messages.DeleteHistory | messages.DeleteMessages | messages.ReceivedMessages | messages.SetTyping | messages.SendMessage | messages.SendMedia | messages.ForwardMessages | messages.ReportSpam | messages.GetPeerSettings | messages.Report | messages.GetChats | messages.GetFullChat | messages.EditChatTitle | messages.EditChatPhoto | messages.AddChatUser | messages.DeleteChatUser | messages.CreateChat | messages.GetDhConfig | messages.RequestEncryption | messages.AcceptEncryption | messages.DiscardEncryption | messages.SetEncryptedTyping | messages.ReadEncryptedHistory | messages.SendEncrypted | messages.SendEncryptedFile | messages.SendEncryptedService | messages.ReceivedQueue | messages.ReportEncryptedSpam | messages.ReadMessageContents | messages.GetStickers | messages.GetAllStickers | messages.GetWebPagePreview | messages.ExportChatInvite | messages.CheckChatInvite | messages.ImportChatInvite | messages.GetStickerSet | messages.InstallStickerSet | messages.UninstallStickerSet | messages.StartBot | messages.GetMessagesViews | messages.EditChatAdmin | messages.MigrateChat | messages.SearchGlobal | messages.ReorderStickerSets | messages.GetDocumentByHash | messages.GetSavedGifs | messages.SaveGif | messages.GetInlineBotResults | messages.SetInlineBotResults | messages.SendInlineBotResult | messages.GetMessageEditData | messages.EditMessage | messages.EditInlineBotMessage | messages.GetBotCallbackAnswer | messages.SetBotCallbackAnswer | messages.GetPeerDialogs | messages.SaveDraft | messages.GetAllDrafts | messages.GetFeaturedStickers | messages.ReadFeaturedStickers | messages.GetRecentStickers | messages.SaveRecentSticker | messages.ClearRecentStickers | messages.GetArchivedStickers | messages.GetMaskStickers | messages.GetAttachedStickers | messages.SetGameScore | messages.SetInlineGameScore | messages.GetGameHighScores | messages.GetInlineGameHighScores | messages.GetCommonChats | messages.GetWebPage | messages.ToggleDialogPin | messages.ReorderPinnedDialogs | messages.GetPinnedDialogs | messages.SetBotShippingResults | messages.SetBotPrecheckoutResults | messages.UploadMedia | messages.SendScreenshotNotification | messages.GetFavedStickers | messages.FaveSticker | messages.GetUnreadMentions | messages.ReadMentions | messages.GetRecentLocations | messages.SendMultiMedia | messages.UploadEncryptedFile | messages.SearchStickerSets | messages.GetSplitRanges | messages.MarkDialogUnread | messages.GetDialogUnreadMarks | messages.ClearAllDrafts | messages.UpdatePinnedMessage | messages.SendVote | messages.GetPollResults | messages.GetOnlines | messages.EditChatAbout | messages.EditChatDefaultBannedRights | messages.GetEmojiKeywords | messages.GetEmojiKeywordsDifference | messages.GetEmojiKeywordsLanguages | messages.GetEmojiURL | messages.GetSearchCounters | messages.RequestUrlAuth | messages.AcceptUrlAuth | messages.HidePeerSettingsBar | messages.GetScheduledHistory | messages.GetScheduledMessages | messages.SendScheduledMessages | messages.DeleteScheduledMessages | messages.GetPollVotes | messages.ToggleStickerSets | messages.GetDialogFilters | messages.GetSuggestedDialogFilters | messages.UpdateDialogFilter | messages.UpdateDialogFiltersOrder | messages.GetOldFeaturedStickers | messages.GetReplies | messages.GetDiscussionMessage | messages.ReadDiscussion | messages.UnpinAllMessages | messages.DeleteChat | messages.DeletePhoneCallHistory | messages.CheckHistoryImport | messages.InitHistoryImport | messages.UploadImportedMedia | messages.StartHistoryImport | messages.GetExportedChatInvites | messages.GetExportedChatInvite | messages.EditExportedChatInvite | messages.DeleteRevokedExportedChatInvites | messages.DeleteExportedChatInvite | messages.GetAdminsWithInvites | messages.GetChatInviteImporters | messages.SetHistoryTTL | messages.CheckHistoryImportPeer | messages.SetChatTheme | messages.GetMessageReadParticipants | messages.GetSearchResultsCalendar | messages.GetSearchResultsPositions | messages.HideChatJoinRequest | messages.HideAllChatJoinRequests | messages.ToggleNoForwards | messages.SaveDefaultSendAs | messages.SendReaction | messages.GetMessagesReactions | messages.GetMessageReactionsList | messages.SetChatAvailableReactions | messages.GetAvailableReactions | messages.SetDefaultReaction | messages.TranslateText | messages.GetUnreadReactions | messages.ReadReactions | messages.SearchSentMedia | messages.GetAttachMenuBots | messages.GetAttachMenuBot | messages.ToggleBotInAttachMenu | messages.RequestWebView | messages.ProlongWebView | messages.RequestSimpleWebView | messages.SendWebViewResultMessage | messages.SendWebViewData | messages.TranscribeAudio | messages.RateTranscribedAudio | messages.GetCustomEmojiDocuments | messages.GetEmojiStickers | messages.GetFeaturedEmojiStickers | messages.ReportReaction | messages.GetTopReactions | messages.GetRecentReactions | messages.ClearRecentReactions | messages.GetExtendedMedia | messages.SetDefaultHistoryTTL | messages.GetDefaultHistoryTTL | messages.SendBotRequestedPeer | messages.GetEmojiGroups | messages.GetEmojiStatusGroups | messages.GetEmojiProfilePhotoGroups | messages.SearchCustomEmoji | messages.TogglePeerTranslations | messages.GetBotApp | messages.RequestAppWebView | messages.SetChatWallPaper | messages.SearchEmojiStickerSets | messages.GetSavedDialogs | messages.GetSavedHistory | messages.DeleteSavedHistory | messages.GetPinnedSavedDialogs | messages.ToggleSavedDialogPin | messages.ReorderPinnedSavedDialogs | messages.GetSavedReactionTags | messages.UpdateSavedReactionTag | messages.GetDefaultTagReactions | messages.GetOutboxReadDate | messages.GetQuickReplies | messages.ReorderQuickReplies | messages.CheckQuickReplyShortcut | messages.EditQuickReplyShortcut | messages.DeleteQuickReplyShortcut | messages.GetQuickReplyMessages | messages.SendQuickReplyMessages | messages.DeleteQuickReplyMessages | messages.ToggleDialogFilterTags | messages.GetMyStickers | messages.GetEmojiStickerGroups | messages.GetAvailableEffects | messages.EditFactCheck | messages.DeleteFactCheck | messages.GetFactCheck | messages.RequestMainWebView | messages.SendPaidReaction | messages.TogglePaidReactionPrivacy | messages.GetPaidReactionPrivacy | messages.ViewSponsoredMessage | messages.ClickSponsoredMessage | messages.ReportSponsoredMessage | messages.GetSponsoredMessages | messages.SavePreparedInlineMessage | messages.GetPreparedInlineMessage | messages.SearchStickers | messages.ReportMessagesDelivery | messages.GetSavedDialogsByID | messages.ReadSavedHistory | messages.ToggleTodoCompleted | messages.AppendTodoList | messages.ToggleSuggestedPostApproval + | auth.SendCode | auth.SignUp | auth.SignIn | auth.LogOut | auth.ResetAuthorizations | auth.ExportAuthorization | auth.ImportAuthorization | auth.BindTempAuthKey | auth.ImportBotAuthorization | auth.CheckPassword | auth.RequestPasswordRecovery | auth.RecoverPassword | auth.ResendCode | auth.CancelCode | auth.DropTempAuthKeys | auth.ExportLoginToken | auth.ImportLoginToken | auth.AcceptLoginToken | auth.CheckRecoveryPassword | auth.ImportWebTokenAuthorization | auth.RequestFirebaseSms | auth.ResetLoginEmail | auth.ReportMissingCode | auth.CheckPaidAuth + | account.RegisterDevice | account.UnregisterDevice | account.UpdateNotifySettings | account.GetNotifySettings | account.ResetNotifySettings | account.UpdateProfile | account.UpdateStatus | account.GetWallPapers | account.ReportPeer | account.CheckUsername | account.UpdateUsername | account.GetPrivacy | account.SetPrivacy | account.DeleteAccount | account.GetAccountTTL | account.SetAccountTTL | account.SendChangePhoneCode | account.ChangePhone | account.UpdateDeviceLocked | account.GetAuthorizations | account.ResetAuthorization | account.GetPassword | account.GetPasswordSettings | account.UpdatePasswordSettings | account.SendConfirmPhoneCode | account.ConfirmPhone | account.GetTmpPassword | account.GetWebAuthorizations | account.ResetWebAuthorization | account.ResetWebAuthorizations | account.GetAllSecureValues | account.GetSecureValue | account.SaveSecureValue | account.DeleteSecureValue | account.GetAuthorizationForm | account.AcceptAuthorization | account.SendVerifyPhoneCode | account.VerifyPhone | account.SendVerifyEmailCode | account.VerifyEmail | account.InitTakeoutSession | account.FinishTakeoutSession | account.ConfirmPasswordEmail | account.ResendPasswordEmail | account.CancelPasswordEmail | account.GetContactSignUpNotification | account.SetContactSignUpNotification | account.GetNotifyExceptions | account.GetWallPaper | account.UploadWallPaper | account.SaveWallPaper | account.InstallWallPaper | account.ResetWallPapers | account.GetAutoDownloadSettings | account.SaveAutoDownloadSettings | account.UploadTheme | account.CreateTheme | account.UpdateTheme | account.SaveTheme | account.InstallTheme | account.GetTheme | account.GetThemes | account.SetContentSettings | account.GetContentSettings | account.GetMultiWallPapers | account.GetGlobalPrivacySettings | account.SetGlobalPrivacySettings | account.ReportProfilePhoto | account.ResetPassword | account.DeclinePasswordReset | account.GetChatThemes | account.SetAuthorizationTTL | account.ChangeAuthorizationSettings | account.GetSavedRingtones | account.SaveRingtone | account.UploadRingtone | account.UpdateEmojiStatus | account.GetDefaultEmojiStatuses | account.GetRecentEmojiStatuses | account.ClearRecentEmojiStatuses | account.ReorderUsernames | account.ToggleUsername | account.GetDefaultProfilePhotoEmojis | account.GetDefaultGroupPhotoEmojis | account.GetAutoSaveSettings | account.SaveAutoSaveSettings | account.DeleteAutoSaveExceptions | account.InvalidateSignInCodes | account.UpdateColor | account.GetDefaultBackgroundEmojis | account.GetChannelDefaultEmojiStatuses | account.GetChannelRestrictedStatusEmojis | account.UpdateBusinessWorkHours | account.UpdateBusinessLocation | account.UpdateBusinessGreetingMessage | account.UpdateBusinessAwayMessage | account.UpdateConnectedBot | account.GetConnectedBots | account.GetBotBusinessConnection | account.UpdateBusinessIntro | account.ToggleConnectedBotPaused | account.DisablePeerConnectedBot | account.UpdateBirthday | account.CreateBusinessChatLink | account.EditBusinessChatLink | account.DeleteBusinessChatLink | account.GetBusinessChatLinks | account.ResolveBusinessChatLink | account.UpdatePersonalChannel | account.ToggleSponsoredMessages | account.GetReactionsNotifySettings | account.SetReactionsNotifySettings | account.GetCollectibleEmojiStatuses | account.GetPaidMessagesRevenue | account.ToggleNoPaidMessagesException | account.SetMainProfileTab | account.SaveMusic | account.GetSavedMusicIds | account.GetUniqueGiftChatThemes + | users.GetUsers | users.GetFullUser | users.SetSecureValueErrors | users.GetRequirementsToContact | users.GetSavedMusic | users.GetSavedMusicByID | users.SuggestBirthday + | contacts.GetContactIDs | contacts.GetStatuses | contacts.GetContacts | contacts.ImportContacts | contacts.DeleteContacts | contacts.DeleteByPhones | contacts.Block | contacts.Unblock | contacts.GetBlocked | contacts.Search | contacts.ResolveUsername | contacts.GetTopPeers | contacts.ResetTopPeerRating | contacts.ResetSaved | contacts.GetSaved | contacts.ToggleTopPeers | contacts.AddContact | contacts.AcceptContact | contacts.GetLocated | contacts.BlockFromReplies | contacts.ResolvePhone | contacts.ExportContactToken | contacts.ImportContactToken | contacts.EditCloseFriends | contacts.SetBlocked | contacts.GetBirthdays | contacts.GetSponsoredPeers | contacts.UpdateContactNote + | messages.GetMessages | messages.GetDialogs | messages.GetHistory | messages.Search | messages.ReadHistory | messages.DeleteHistory | messages.DeleteMessages | messages.ReceivedMessages | messages.SetTyping | messages.SendMessage | messages.SendMedia | messages.ForwardMessages | messages.ReportSpam | messages.GetPeerSettings | messages.Report | messages.GetChats | messages.GetFullChat | messages.EditChatTitle | messages.EditChatPhoto | messages.AddChatUser | messages.DeleteChatUser | messages.CreateChat | messages.GetDhConfig | messages.RequestEncryption | messages.AcceptEncryption | messages.DiscardEncryption | messages.SetEncryptedTyping | messages.ReadEncryptedHistory | messages.SendEncrypted | messages.SendEncryptedFile | messages.SendEncryptedService | messages.ReceivedQueue | messages.ReportEncryptedSpam | messages.ReadMessageContents | messages.GetStickers | messages.GetAllStickers | messages.GetWebPagePreview | messages.ExportChatInvite | messages.CheckChatInvite | messages.ImportChatInvite | messages.GetStickerSet | messages.InstallStickerSet | messages.UninstallStickerSet | messages.StartBot | messages.GetMessagesViews | messages.EditChatAdmin | messages.MigrateChat | messages.SearchGlobal | messages.ReorderStickerSets | messages.GetDocumentByHash | messages.GetSavedGifs | messages.SaveGif | messages.GetInlineBotResults | messages.SetInlineBotResults | messages.SendInlineBotResult | messages.GetMessageEditData | messages.EditMessage | messages.EditInlineBotMessage | messages.GetBotCallbackAnswer | messages.SetBotCallbackAnswer | messages.GetPeerDialogs | messages.SaveDraft | messages.GetAllDrafts | messages.GetFeaturedStickers | messages.ReadFeaturedStickers | messages.GetRecentStickers | messages.SaveRecentSticker | messages.ClearRecentStickers | messages.GetArchivedStickers | messages.GetMaskStickers | messages.GetAttachedStickers | messages.SetGameScore | messages.SetInlineGameScore | messages.GetGameHighScores | messages.GetInlineGameHighScores | messages.GetCommonChats | messages.GetWebPage | messages.ToggleDialogPin | messages.ReorderPinnedDialogs | messages.GetPinnedDialogs | messages.SetBotShippingResults | messages.SetBotPrecheckoutResults | messages.UploadMedia | messages.SendScreenshotNotification | messages.GetFavedStickers | messages.FaveSticker | messages.GetUnreadMentions | messages.ReadMentions | messages.GetRecentLocations | messages.SendMultiMedia | messages.UploadEncryptedFile | messages.SearchStickerSets | messages.GetSplitRanges | messages.MarkDialogUnread | messages.GetDialogUnreadMarks | messages.ClearAllDrafts | messages.UpdatePinnedMessage | messages.SendVote | messages.GetPollResults | messages.GetOnlines | messages.EditChatAbout | messages.EditChatDefaultBannedRights | messages.GetEmojiKeywords | messages.GetEmojiKeywordsDifference | messages.GetEmojiKeywordsLanguages | messages.GetEmojiURL | messages.GetSearchCounters | messages.RequestUrlAuth | messages.AcceptUrlAuth | messages.HidePeerSettingsBar | messages.GetScheduledHistory | messages.GetScheduledMessages | messages.SendScheduledMessages | messages.DeleteScheduledMessages | messages.GetPollVotes | messages.ToggleStickerSets | messages.GetDialogFilters | messages.GetSuggestedDialogFilters | messages.UpdateDialogFilter | messages.UpdateDialogFiltersOrder | messages.GetOldFeaturedStickers | messages.GetReplies | messages.GetDiscussionMessage | messages.ReadDiscussion | messages.UnpinAllMessages | messages.DeleteChat | messages.DeletePhoneCallHistory | messages.CheckHistoryImport | messages.InitHistoryImport | messages.UploadImportedMedia | messages.StartHistoryImport | messages.GetExportedChatInvites | messages.GetExportedChatInvite | messages.EditExportedChatInvite | messages.DeleteRevokedExportedChatInvites | messages.DeleteExportedChatInvite | messages.GetAdminsWithInvites | messages.GetChatInviteImporters | messages.SetHistoryTTL | messages.CheckHistoryImportPeer | messages.SetChatTheme | messages.GetMessageReadParticipants | messages.GetSearchResultsCalendar | messages.GetSearchResultsPositions | messages.HideChatJoinRequest | messages.HideAllChatJoinRequests | messages.ToggleNoForwards | messages.SaveDefaultSendAs | messages.SendReaction | messages.GetMessagesReactions | messages.GetMessageReactionsList | messages.SetChatAvailableReactions | messages.GetAvailableReactions | messages.SetDefaultReaction | messages.TranslateText | messages.GetUnreadReactions | messages.ReadReactions | messages.SearchSentMedia | messages.GetAttachMenuBots | messages.GetAttachMenuBot | messages.ToggleBotInAttachMenu | messages.RequestWebView | messages.ProlongWebView | messages.RequestSimpleWebView | messages.SendWebViewResultMessage | messages.SendWebViewData | messages.TranscribeAudio | messages.RateTranscribedAudio | messages.GetCustomEmojiDocuments | messages.GetEmojiStickers | messages.GetFeaturedEmojiStickers | messages.ReportReaction | messages.GetTopReactions | messages.GetRecentReactions | messages.ClearRecentReactions | messages.GetExtendedMedia | messages.SetDefaultHistoryTTL | messages.GetDefaultHistoryTTL | messages.SendBotRequestedPeer | messages.GetEmojiGroups | messages.GetEmojiStatusGroups | messages.GetEmojiProfilePhotoGroups | messages.SearchCustomEmoji | messages.TogglePeerTranslations | messages.GetBotApp | messages.RequestAppWebView | messages.SetChatWallPaper | messages.SearchEmojiStickerSets | messages.GetSavedDialogs | messages.GetSavedHistory | messages.DeleteSavedHistory | messages.GetPinnedSavedDialogs | messages.ToggleSavedDialogPin | messages.ReorderPinnedSavedDialogs | messages.GetSavedReactionTags | messages.UpdateSavedReactionTag | messages.GetDefaultTagReactions | messages.GetOutboxReadDate | messages.GetQuickReplies | messages.ReorderQuickReplies | messages.CheckQuickReplyShortcut | messages.EditQuickReplyShortcut | messages.DeleteQuickReplyShortcut | messages.GetQuickReplyMessages | messages.SendQuickReplyMessages | messages.DeleteQuickReplyMessages | messages.ToggleDialogFilterTags | messages.GetMyStickers | messages.GetEmojiStickerGroups | messages.GetAvailableEffects | messages.EditFactCheck | messages.DeleteFactCheck | messages.GetFactCheck | messages.RequestMainWebView | messages.SendPaidReaction | messages.TogglePaidReactionPrivacy | messages.GetPaidReactionPrivacy | messages.ViewSponsoredMessage | messages.ClickSponsoredMessage | messages.ReportSponsoredMessage | messages.GetSponsoredMessages | messages.SavePreparedInlineMessage | messages.GetPreparedInlineMessage | messages.SearchStickers | messages.ReportMessagesDelivery | messages.GetSavedDialogsByID | messages.ReadSavedHistory | messages.ToggleTodoCompleted | messages.AppendTodoList | messages.ToggleSuggestedPostApproval | messages.GetForumTopics | messages.GetForumTopicsByID | messages.EditForumTopic | messages.UpdatePinnedForumTopic | messages.ReorderPinnedForumTopics | messages.CreateForumTopic | messages.DeleteTopicHistory | updates.GetState | updates.GetDifference | updates.GetChannelDifference | photos.UpdateProfilePhoto | photos.UploadProfilePhoto | photos.DeletePhotos | photos.GetUserPhotos | photos.UploadContactProfilePhoto | upload.SaveFilePart | upload.GetFile | upload.SaveBigFilePart | upload.GetWebFile | upload.GetCdnFile | upload.ReuploadCdnFile | upload.GetCdnFileHashes | upload.GetFileHashes | help.GetConfig | help.GetNearestDc | help.GetAppUpdate | help.GetInviteText | help.GetSupport | help.SetBotUpdatesStatus | help.GetCdnConfig | help.GetRecentMeUrls | help.GetTermsOfServiceUpdate | help.AcceptTermsOfService | help.GetDeepLinkInfo | help.GetAppConfig | help.SaveAppLog | help.GetPassportConfig | help.GetSupportName | help.GetUserInfo | help.EditUserInfo | help.GetPromoData | help.HidePromoData | help.DismissSuggestion | help.GetCountriesList | help.GetPremiumPromo | help.GetPeerColors | help.GetPeerProfileColors | help.GetTimezonesList - | channels.ReadHistory | channels.DeleteMessages | channels.ReportSpam | channels.GetMessages | channels.GetParticipants | channels.GetParticipant | channels.GetChannels | channels.GetFullChannel | channels.CreateChannel | channels.EditAdmin | channels.EditTitle | channels.EditPhoto | channels.CheckUsername | channels.UpdateUsername | channels.JoinChannel | channels.LeaveChannel | channels.InviteToChannel | channels.DeleteChannel | channels.ExportMessageLink | channels.ToggleSignatures | channels.GetAdminedPublicChannels | channels.EditBanned | channels.GetAdminLog | channels.SetStickers | channels.ReadMessageContents | channels.DeleteHistory | channels.TogglePreHistoryHidden | channels.GetLeftChannels | channels.GetGroupsForDiscussion | channels.SetDiscussionGroup | channels.EditCreator | channels.EditLocation | channels.ToggleSlowMode | channels.GetInactiveChannels | channels.ConvertToGigagroup | channels.GetSendAs | channels.DeleteParticipantHistory | channels.ToggleJoinToSend | channels.ToggleJoinRequest | channels.ReorderUsernames | channels.ToggleUsername | channels.DeactivateAllUsernames | channels.ToggleForum | channels.CreateForumTopic | channels.GetForumTopics | channels.GetForumTopicsByID | channels.EditForumTopic | channels.UpdatePinnedForumTopic | channels.DeleteTopicHistory | channels.ReorderPinnedForumTopics | channels.ToggleAntiSpam | channels.ReportAntiSpamFalsePositive | channels.ToggleParticipantsHidden | channels.UpdateColor | channels.ToggleViewForumAsMessages | channels.GetChannelRecommendations | channels.UpdateEmojiStatus | channels.SetBoostsToUnblockRestrictions | channels.SetEmojiStickers | channels.RestrictSponsoredMessages | channels.SearchPosts | channels.UpdatePaidMessagesPrice | channels.ToggleAutotranslation | channels.GetMessageAuthor | channels.CheckSearchPostsFlood | channels.SetMainProfileTab + | channels.ReadHistory | channels.DeleteMessages | channels.ReportSpam | channels.GetMessages | channels.GetParticipants | channels.GetParticipant | channels.GetChannels | channels.GetFullChannel | channels.CreateChannel | channels.EditAdmin | channels.EditTitle | channels.EditPhoto | channels.CheckUsername | channels.UpdateUsername | channels.JoinChannel | channels.LeaveChannel | channels.InviteToChannel | channels.DeleteChannel | channels.ExportMessageLink | channels.ToggleSignatures | channels.GetAdminedPublicChannels | channels.EditBanned | channels.GetAdminLog | channels.SetStickers | channels.ReadMessageContents | channels.DeleteHistory | channels.TogglePreHistoryHidden | channels.GetLeftChannels | channels.GetGroupsForDiscussion | channels.SetDiscussionGroup | channels.EditCreator | channels.EditLocation | channels.ToggleSlowMode | channels.GetInactiveChannels | channels.ConvertToGigagroup | channels.GetSendAs | channels.DeleteParticipantHistory | channels.ToggleJoinToSend | channels.ToggleJoinRequest | channels.ReorderUsernames | channels.ToggleUsername | channels.DeactivateAllUsernames | channels.ToggleForum | channels.ToggleAntiSpam | channels.ReportAntiSpamFalsePositive | channels.ToggleParticipantsHidden | channels.UpdateColor | channels.ToggleViewForumAsMessages | channels.GetChannelRecommendations | channels.UpdateEmojiStatus | channels.SetBoostsToUnblockRestrictions | channels.SetEmojiStickers | channels.RestrictSponsoredMessages | channels.SearchPosts | channels.UpdatePaidMessagesPrice | channels.ToggleAutotranslation | channels.GetMessageAuthor | channels.CheckSearchPostsFlood | channels.SetMainProfileTab | bots.SendCustomRequest | bots.AnswerWebhookJSONQuery | bots.SetBotCommands | bots.ResetBotCommands | bots.GetBotCommands | bots.SetBotMenuButton | bots.GetBotMenuButton | bots.SetBotBroadcastDefaultAdminRights | bots.SetBotGroupDefaultAdminRights | bots.SetBotInfo | bots.GetBotInfo | bots.ReorderUsernames | bots.ToggleUsername | bots.CanSendMessage | bots.AllowSendMessage | bots.InvokeWebViewCustomMethod | bots.GetPopularAppBots | bots.AddPreviewMedia | bots.EditPreviewMedia | bots.DeletePreviewMedia | bots.ReorderPreviewMedias | bots.GetPreviewInfo | bots.GetPreviewMedias | bots.UpdateUserEmojiStatus | bots.ToggleUserEmojiStatusPermission | bots.CheckDownloadFileParams | bots.GetAdminedBots | bots.UpdateStarRefProgram | bots.SetCustomVerification | bots.GetBotRecommendations | payments.GetPaymentForm | payments.GetPaymentReceipt | payments.ValidateRequestedInfo | payments.SendPaymentForm | payments.GetSavedInfo | payments.ClearSavedInfo | payments.GetBankCardData | payments.ExportInvoice | payments.AssignAppStoreTransaction | payments.AssignPlayMarketTransaction | payments.GetPremiumGiftCodeOptions | payments.CheckGiftCode | payments.ApplyGiftCode | payments.GetGiveawayInfo | payments.LaunchPrepaidGiveaway | payments.GetStarsTopupOptions | payments.GetStarsStatus | payments.GetStarsTransactions | payments.SendStarsForm | payments.RefundStarsCharge | payments.GetStarsRevenueStats | payments.GetStarsRevenueWithdrawalUrl | payments.GetStarsRevenueAdsAccountUrl | payments.GetStarsTransactionsByID | payments.GetStarsGiftOptions | payments.GetStarsSubscriptions | payments.ChangeStarsSubscription | payments.FulfillStarsSubscription | payments.GetStarsGiveawayOptions | payments.GetStarGifts | payments.SaveStarGift | payments.ConvertStarGift | payments.BotCancelStarsSubscription | payments.GetConnectedStarRefBots | payments.GetConnectedStarRefBot | payments.GetSuggestedStarRefBots | payments.ConnectStarRefBot | payments.EditConnectedStarRefBot | payments.GetStarGiftUpgradePreview | payments.UpgradeStarGift | payments.TransferStarGift | payments.GetUniqueStarGift | payments.GetSavedStarGifts | payments.GetSavedStarGift | payments.GetStarGiftWithdrawalUrl | payments.ToggleChatStarGiftNotifications | payments.ToggleStarGiftsPinnedToTop | payments.CanPurchaseStore | payments.GetResaleStarGifts | payments.UpdateStarGiftPrice | payments.CreateStarGiftCollection | payments.UpdateStarGiftCollection | payments.ReorderStarGiftCollections | payments.DeleteStarGiftCollection | payments.GetStarGiftCollections | payments.GetUniqueStarGiftValueInfo | payments.CheckCanSendGift | stickers.CreateStickerSet | stickers.RemoveStickerFromSet | stickers.ChangeStickerPosition | stickers.AddStickerToSet | stickers.SetStickerSetThumb | stickers.CheckShortName | stickers.SuggestShortName | stickers.ChangeSticker | stickers.RenameStickerSet | stickers.DeleteStickerSet | stickers.ReplaceSticker - | phone.GetCallConfig | phone.RequestCall | phone.AcceptCall | phone.ConfirmCall | phone.ReceivedCall | phone.DiscardCall | phone.SetCallRating | phone.SaveCallDebug | phone.SendSignalingData | phone.CreateGroupCall | phone.JoinGroupCall | phone.LeaveGroupCall | phone.InviteToGroupCall | phone.DiscardGroupCall | phone.ToggleGroupCallSettings | phone.GetGroupCall | phone.GetGroupParticipants | phone.CheckGroupCall | phone.ToggleGroupCallRecord | phone.EditGroupCallParticipant | phone.EditGroupCallTitle | phone.GetGroupCallJoinAs | phone.ExportGroupCallInvite | phone.ToggleGroupCallStartSubscription | phone.StartScheduledGroupCall | phone.SaveDefaultGroupCallJoinAs | phone.JoinGroupCallPresentation | phone.LeaveGroupCallPresentation | phone.GetGroupCallStreamChannels | phone.GetGroupCallStreamRtmpUrl | phone.SaveCallLog | phone.CreateConferenceCall | phone.DeleteConferenceCallParticipants | phone.SendConferenceCallBroadcast | phone.InviteConferenceCallParticipant | phone.DeclineConferenceCallInvite | phone.GetGroupCallChainBlocks + | phone.GetCallConfig | phone.RequestCall | phone.AcceptCall | phone.ConfirmCall | phone.ReceivedCall | phone.DiscardCall | phone.SetCallRating | phone.SaveCallDebug | phone.SendSignalingData | phone.CreateGroupCall | phone.JoinGroupCall | phone.LeaveGroupCall | phone.InviteToGroupCall | phone.DiscardGroupCall | phone.ToggleGroupCallSettings | phone.GetGroupCall | phone.GetGroupParticipants | phone.CheckGroupCall | phone.ToggleGroupCallRecord | phone.EditGroupCallParticipant | phone.EditGroupCallTitle | phone.GetGroupCallJoinAs | phone.ExportGroupCallInvite | phone.ToggleGroupCallStartSubscription | phone.StartScheduledGroupCall | phone.SaveDefaultGroupCallJoinAs | phone.JoinGroupCallPresentation | phone.LeaveGroupCallPresentation | phone.GetGroupCallStreamChannels | phone.GetGroupCallStreamRtmpUrl | phone.SaveCallLog | phone.CreateConferenceCall | phone.DeleteConferenceCallParticipants | phone.SendConferenceCallBroadcast | phone.InviteConferenceCallParticipant | phone.DeclineConferenceCallInvite | phone.GetGroupCallChainBlocks | phone.SendGroupCallMessage | phone.SendGroupCallEncryptedMessage | langpack.GetLangPack | langpack.GetStrings | langpack.GetDifference | langpack.GetLanguages | langpack.GetLanguage | folders.EditPeerFolders | stats.GetBroadcastStats | stats.LoadAsyncGraph | stats.GetMegagroupStats | stats.GetMessagePublicForwards | stats.GetMessageStats | stats.GetStoryStats | stats.GetStoryPublicForwards diff --git a/src/lib/gramjs/tl/apiTl.ts b/src/lib/gramjs/tl/apiTl.ts index 0b8eeea30..b448cfacb 100644 --- a/src/lib/gramjs/tl/apiTl.ts +++ b/src/lib/gramjs/tl/apiTl.ts @@ -69,7 +69,7 @@ storage.fileMov#4b09ebbc = storage.FileType; storage.fileMp4#b3cea0e4 = storage.FileType; storage.fileWebp#1081464c = storage.FileType; userEmpty#d3bc4b7a id:long = User; -user#20b1422 flags:# self:flags.10?true contact:flags.11?true mutual_contact:flags.12?true deleted:flags.13?true bot:flags.14?true bot_chat_history:flags.15?true bot_nochats:flags.16?true verified:flags.17?true restricted:flags.18?true min:flags.20?true bot_inline_geo:flags.21?true support:flags.23?true scam:flags.24?true apply_min_photo:flags.25?true fake:flags.26?true bot_attach_menu:flags.27?true premium:flags.28?true attach_menu_enabled:flags.29?true flags2:# bot_can_edit:flags2.1?true close_friend:flags2.2?true stories_hidden:flags2.3?true stories_unavailable:flags2.4?true contact_require_premium:flags2.10?true bot_business:flags2.11?true bot_has_main_app:flags2.13?true id:long access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int restriction_reason:flags.18?Vector bot_inline_placeholder:flags.19?string lang_code:flags.22?string emoji_status:flags.30?EmojiStatus usernames:flags2.0?Vector stories_max_id:flags2.5?int color:flags2.8?PeerColor profile_color:flags2.9?PeerColor bot_active_users:flags2.12?int bot_verification_icon:flags2.14?long send_paid_messages_stars:flags2.15?long = User; +user#20b1422 flags:# self:flags.10?true contact:flags.11?true mutual_contact:flags.12?true deleted:flags.13?true bot:flags.14?true bot_chat_history:flags.15?true bot_nochats:flags.16?true verified:flags.17?true restricted:flags.18?true min:flags.20?true bot_inline_geo:flags.21?true support:flags.23?true scam:flags.24?true apply_min_photo:flags.25?true fake:flags.26?true bot_attach_menu:flags.27?true premium:flags.28?true attach_menu_enabled:flags.29?true flags2:# bot_can_edit:flags2.1?true close_friend:flags2.2?true stories_hidden:flags2.3?true stories_unavailable:flags2.4?true contact_require_premium:flags2.10?true bot_business:flags2.11?true bot_has_main_app:flags2.13?true bot_forum_view:flags2.16?true id:long access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int restriction_reason:flags.18?Vector bot_inline_placeholder:flags.19?string lang_code:flags.22?string emoji_status:flags.30?EmojiStatus usernames:flags2.0?Vector stories_max_id:flags2.5?int color:flags2.8?PeerColor profile_color:flags2.9?PeerColor bot_active_users:flags2.12?int bot_verification_icon:flags2.14?long send_paid_messages_stars:flags2.15?long = User; userProfilePhotoEmpty#4f11bae1 = UserProfilePhoto; userProfilePhoto#82d1f706 flags:# has_video:flags.0?true personal:flags.2?true photo_id:long stripped_thumb:flags.1?bytes dc_id:int = UserProfilePhoto; userStatusEmpty#9d05049 = UserStatus; @@ -141,12 +141,12 @@ messageActionGroupCall#7a0d7f42 flags:# call:InputGroupCall duration:flags.0?int messageActionInviteToGroupCall#502f92f7 call:InputGroupCall users:Vector = MessageAction; messageActionSetMessagesTTL#3c134d7b flags:# period:int auto_setting_from:flags.0?long = MessageAction; messageActionGroupCallScheduled#b3a07661 call:InputGroupCall schedule_date:int = MessageAction; -messageActionSetChatTheme#aa786345 emoticon:string = MessageAction; +messageActionSetChatTheme#b91bbd3a theme:ChatTheme = MessageAction; messageActionChatJoinedByRequest#ebbca3cb = MessageAction; messageActionWebViewDataSentMe#47dd8079 text:string data:string = MessageAction; messageActionWebViewDataSent#b4c38cb5 text:string = MessageAction; messageActionGiftPremium#6c6274fa flags:# currency:string amount:long months:int crypto_currency:flags.0?string crypto_amount:flags.0?long message:flags.1?TextWithEntities = MessageAction; -messageActionTopicCreate#d999256 flags:# title:string icon_color:int icon_emoji_id:flags.0?long = MessageAction; +messageActionTopicCreate#d999256 flags:# title_missing:flags.1?true title:string icon_color:int icon_emoji_id:flags.0?long = MessageAction; messageActionTopicEdit#c0944820 flags:# title:flags.0?string icon_emoji_id:flags.1?long closed:flags.2?Bool hidden:flags.3?Bool = MessageAction; messageActionSuggestProfilePhoto#57de635e photo:Photo = MessageAction; messageActionRequestedPeer#31518e9b button_id:int peers:Vector = MessageAction; @@ -160,7 +160,7 @@ messageActionPaymentRefunded#41b3e202 flags:# peer:Peer currency:string total_am messageActionGiftStars#45d5b021 flags:# currency:string amount:long stars:long crypto_currency:flags.0?string crypto_amount:flags.0?long transaction_id:flags.1?string = MessageAction; messageActionPrizeStars#b00c47a2 flags:# unclaimed:flags.0?true stars:long transaction_id:string boost_peer:Peer giveaway_msg_id:int = MessageAction; messageActionStarGift#f24de7fa flags:# name_hidden:flags.0?true saved:flags.2?true converted:flags.3?true upgraded:flags.5?true refunded:flags.9?true can_upgrade:flags.10?true prepaid_upgrade:flags.13?true upgrade_separate:flags.16?true gift:StarGift message:flags.1?TextWithEntities convert_stars:flags.4?long upgrade_msg_id:flags.5?int upgrade_stars:flags.8?long from_id:flags.11?Peer peer:flags.12?Peer saved_id:flags.12?long prepaid_upgrade_hash:flags.14?string gift_msg_id:flags.15?int = MessageAction; -messageActionStarGiftUnique#34f762f3 flags:# upgrade:flags.0?true transferred:flags.1?true saved:flags.2?true refunded:flags.5?true prepaid_upgrade:flags.11?true gift:StarGift can_export_at:flags.3?int transfer_stars:flags.4?long from_id:flags.6?Peer peer:flags.7?Peer saved_id:flags.7?long resale_amount:flags.8?StarsAmount can_transfer_at:flags.9?int can_resell_at:flags.10?int = MessageAction; +messageActionStarGiftUnique#95728543 flags:# upgrade:flags.0?true transferred:flags.1?true saved:flags.2?true refunded:flags.5?true prepaid_upgrade:flags.11?true assigned:flags.13?true gift:StarGift can_export_at:flags.3?int transfer_stars:flags.4?long from_id:flags.6?Peer peer:flags.7?Peer saved_id:flags.7?long resale_amount:flags.8?StarsAmount can_transfer_at:flags.9?int can_resell_at:flags.10?int drop_original_details_stars:flags.12?long = MessageAction; messageActionPaidMessagesRefunded#ac1f1fcd count:int stars:long = MessageAction; messageActionPaidMessagesPrice#84b88578 flags:# broadcast_messages_allowed:flags.0?true stars:long = MessageAction; messageActionConferenceCall#2ffe2f7a flags:# missed:flags.0?true active:flags.1?true video:flags.4?true call_id:long duration:flags.2?int other_participants:flags.3?Vector = MessageAction; @@ -170,6 +170,7 @@ messageActionSuggestedPostApproval#ee7a1596 flags:# rejected:flags.0?true balanc messageActionSuggestedPostSuccess#95ddcf69 price:StarsAmount = MessageAction; messageActionSuggestedPostRefund#69f916f8 flags:# payer_initiated:flags.0?true = MessageAction; messageActionGiftTon#a8a3c699 flags:# currency:string amount:long crypto_currency:string crypto_amount:long transaction_id:flags.0?string = MessageAction; +messageActionSuggestBirthday#2c8f2a25 birthday:Birthday = MessageAction; dialog#d58a08c6 flags:# pinned:flags.2?true unread_mark:flags.3?true view_forum_as_messages:flags.6?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int unread_reactions_count:int notify_settings:PeerNotifySettings pts:flags.0?int draft:flags.1?DraftMessage folder_id:flags.4?int ttl_period:flags.5?int = Dialog; dialogFolder#71bd134c flags:# pinned:flags.2?true folder:Folder peer:Peer top_message:int unread_muted_peers_count:int unread_unmuted_peers_count:int unread_muted_messages_count:int unread_unmuted_messages_count:int = Dialog; photoEmpty#2331b22d id:long = Photo; @@ -184,7 +185,7 @@ geoPointEmpty#1117dd5f = GeoPoint; geoPoint#b2a2f663 flags:# long:double lat:double access_hash:long accuracy_radius:flags.0?int = GeoPoint; auth.sentCode#5e002502 flags:# type:auth.SentCodeType phone_code_hash:string next_type:flags.1?auth.CodeType timeout:flags.2?int = auth.SentCode; auth.sentCodeSuccess#2390fe44 authorization:auth.Authorization = auth.SentCode; -auth.sentCodePaymentRequired#d7a2fcf9 store_product:string phone_code_hash:string support_email_address:string support_email_subject:string = auth.SentCode; +auth.sentCodePaymentRequired#e0955a3c store_product:string phone_code_hash:string support_email_address:string support_email_subject:string currency:string amount:long = auth.SentCode; auth.authorization#2ea2c0d4 flags:# setup_password_required:flags.1?true otherwise_relogin_days:flags.1?int tmp_sessions:flags.0?int future_auth_token:flags.2?bytes user:User = auth.Authorization; auth.authorizationSignUpRequired#44747e9a flags:# terms_of_service:flags.0?help.TermsOfService = auth.Authorization; auth.exportedAuthorization#b434e2b8 id:long bytes:bytes = auth.ExportedAuthorization; @@ -208,7 +209,7 @@ inputReportReasonGeoIrrelevant#dbd4feed = ReportReason; inputReportReasonFake#f5ddd6e7 = ReportReason; inputReportReasonIllegalDrugs#a8eb2be = ReportReason; inputReportReasonPersonalDetails#9ec7863d = ReportReason; -userFull#3fd81e28 flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true has_scheduled:flags.12?true video_calls_available:flags.13?true voice_messages_forbidden:flags.20?true translations_disabled:flags.23?true stories_pinned_available:flags.26?true blocked_my_stories_from:flags.27?true wallpaper_overridden:flags.28?true contact_require_premium:flags.29?true read_dates_private:flags.30?true flags2:# sponsored_enabled:flags2.7?true can_view_revenue:flags2.9?true bot_can_manage_emoji_status:flags2.10?true display_gifts_button:flags2.16?true id:long about:flags.1?string settings:PeerSettings personal_photo:flags.21?Photo profile_photo:flags.2?Photo fallback_photo:flags.22?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int ttl_period:flags.14?int theme_emoticon:flags.15?string private_forward_name:flags.16?string bot_group_admin_rights:flags.17?ChatAdminRights bot_broadcast_admin_rights:flags.18?ChatAdminRights wallpaper:flags.24?WallPaper stories:flags.25?PeerStories business_work_hours:flags2.0?BusinessWorkHours business_location:flags2.1?BusinessLocation business_greeting_message:flags2.2?BusinessGreetingMessage business_away_message:flags2.3?BusinessAwayMessage business_intro:flags2.4?BusinessIntro birthday:flags2.5?Birthday personal_channel_id:flags2.6?long personal_channel_message:flags2.6?int stargifts_count:flags2.8?int starref_program:flags2.11?StarRefProgram bot_verification:flags2.12?BotVerification send_paid_messages_stars:flags2.14?long disallowed_gifts:flags2.15?DisallowedGiftsSettings stars_rating:flags2.17?StarsRating stars_my_pending_rating:flags2.18?StarsRating stars_my_pending_rating_date:flags2.18?int main_tab:flags2.20?ProfileTab saved_music:flags2.21?Document = UserFull; +userFull#a02bc13e flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true has_scheduled:flags.12?true video_calls_available:flags.13?true voice_messages_forbidden:flags.20?true translations_disabled:flags.23?true stories_pinned_available:flags.26?true blocked_my_stories_from:flags.27?true wallpaper_overridden:flags.28?true contact_require_premium:flags.29?true read_dates_private:flags.30?true flags2:# sponsored_enabled:flags2.7?true can_view_revenue:flags2.9?true bot_can_manage_emoji_status:flags2.10?true display_gifts_button:flags2.16?true id:long about:flags.1?string settings:PeerSettings personal_photo:flags.21?Photo profile_photo:flags.2?Photo fallback_photo:flags.22?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int ttl_period:flags.14?int theme:flags.15?ChatTheme private_forward_name:flags.16?string bot_group_admin_rights:flags.17?ChatAdminRights bot_broadcast_admin_rights:flags.18?ChatAdminRights wallpaper:flags.24?WallPaper stories:flags.25?PeerStories business_work_hours:flags2.0?BusinessWorkHours business_location:flags2.1?BusinessLocation business_greeting_message:flags2.2?BusinessGreetingMessage business_away_message:flags2.3?BusinessAwayMessage business_intro:flags2.4?BusinessIntro birthday:flags2.5?Birthday personal_channel_id:flags2.6?long personal_channel_message:flags2.6?int stargifts_count:flags2.8?int starref_program:flags2.11?StarRefProgram bot_verification:flags2.12?BotVerification send_paid_messages_stars:flags2.14?long disallowed_gifts:flags2.15?DisallowedGiftsSettings stars_rating:flags2.17?StarsRating stars_my_pending_rating:flags2.18?StarsRating stars_my_pending_rating_date:flags2.18?int main_tab:flags2.20?ProfileTab saved_music:flags2.21?Document note:flags2.22?TextWithEntities = UserFull; contact#145ade0b user_id:long mutual:Bool = Contact; importedContact#c13e3c50 user_id:long client_id:long = ImportedContact; contactStatus#16d9703b user_id:long status:UserStatus = ContactStatus; @@ -220,8 +221,8 @@ contacts.blockedSlice#e1664194 count:int blocked:Vector chats:Vecto messages.dialogs#15ba6c40 dialogs:Vector messages:Vector chats:Vector users:Vector = messages.Dialogs; messages.dialogsSlice#71e094f3 count:int dialogs:Vector messages:Vector chats:Vector users:Vector = messages.Dialogs; messages.dialogsNotModified#f0e3e596 count:int = messages.Dialogs; -messages.messages#8c718e87 messages:Vector chats:Vector users:Vector = messages.Messages; -messages.messagesSlice#762b263d flags:# inexact:flags.1?true count:int next_rate:flags.0?int offset_id_offset:flags.2?int search_flood:flags.3?SearchPostsFlood messages:Vector chats:Vector users:Vector = messages.Messages; +messages.messages#1d73e7ea messages:Vector topics:Vector chats:Vector users:Vector = messages.Messages; +messages.messagesSlice#5f206716 flags:# inexact:flags.1?true count:int next_rate:flags.0?int offset_id_offset:flags.2?int search_flood:flags.3?SearchPostsFlood messages:Vector topics:Vector chats:Vector users:Vector = messages.Messages; messages.channelMessages#c776ba4e flags:# inexact:flags.1?true pts:int count:int offset_id_offset:flags.2?int messages:Vector topics:Vector chats:Vector users:Vector = messages.Messages; messages.messagesNotModified#74535f21 count:int = messages.Messages; messages.chats#64ff9fd5 chats:Vector = messages.Chats; @@ -248,7 +249,7 @@ inputMessagesFilterPinned#1bb00451 = MessagesFilter; updateNewMessage#1f2b0afd message:Message pts:int pts_count:int = Update; updateMessageID#4e90bfd6 id:int random_id:long = Update; updateDeleteMessages#a20db0e5 messages:Vector pts:int pts_count:int = Update; -updateUserTyping#c01e857f user_id:long action:SendMessageAction = Update; +updateUserTyping#2a17bf5c flags:# user_id:long top_msg_id:flags.0?int action:SendMessageAction = Update; updateChatUserTyping#83487af0 chat_id:long from_id:Peer action:SendMessageAction = Update; updateChatParticipants#7761198 participants:ChatParticipants = Update; updateUserStatus#e5bdf8de user_id:long status:UserStatus = Update; @@ -265,7 +266,7 @@ updateNotifySettings#bec268ef peer:NotifyPeer notify_settings:PeerNotifySettings updateServiceNotification#ebe46819 flags:# popup:flags.0?true invert_media:flags.2?true inbox_date:flags.1?int type:string message:string media:MessageMedia entities:Vector = Update; updatePrivacy#ee3b272a key:PrivacyKey rules:Vector = Update; updateUserPhone#5492a13 user_id:long phone:string = Update; -updateReadHistoryInbox#9c974fdf flags:# folder_id:flags.0?int peer:Peer max_id:int still_unread_count:int pts:int pts_count:int = Update; +updateReadHistoryInbox#9e84bc99 flags:# folder_id:flags.0?int peer:Peer top_msg_id:flags.1?int max_id:int still_unread_count:int pts:int pts_count:int = Update; updateReadHistoryOutbox#2f2f21bf peer:Peer max_id:int pts:int pts_count:int = Update; updateWebPage#7f891213 webpage:WebPage pts:int pts_count:int = Update; updateReadMessagesContents#f8227181 flags:# messages:Vector pts:int pts_count:int date:flags.0?int = Update; @@ -352,8 +353,6 @@ updateRecentEmojiStatuses#30f443db = Update; updateRecentReactions#6f7863f4 = Update; updateMoveStickerSetToTop#86fccf85 flags:# masks:flags.0?true emojis:flags.1?true stickerset:long = Update; updateMessageExtendedMedia#d5a41724 peer:Peer msg_id:int extended_media:Vector = Update; -updateChannelPinnedTopic#192efbe3 flags:# pinned:flags.0?true channel_id:long topic_id:int = Update; -updateChannelPinnedTopics#fe198602 flags:# channel_id:long order:flags.0?Vector = Update; updateUser#20529438 user_id:long = Update; updateAutoSaveSettings#ec05b097 = Update; updateStory#75b3b798 peer:Peer story:StoryItem = Update; @@ -390,6 +389,10 @@ updateGroupCallChainBlocks#a477288f call:InputGroupCall sub_chain_id:int blocks: updateReadMonoForumInbox#77b0e372 channel_id:long saved_peer_id:Peer read_max_id:int = Update; updateReadMonoForumOutbox#a4a79376 channel_id:long saved_peer_id:Peer read_max_id:int = Update; updateMonoForumNoPaidException#9f812b08 flags:# exception:flags.0?true channel_id:long saved_peer_id:Peer = Update; +updateGroupCallMessage#78c314e0 call:InputGroupCall from_id:Peer random_id:long message:TextWithEntities = Update; +updateGroupCallEncryptedMessage#c957a766 call:InputGroupCall from_id:Peer encrypted_message:bytes = Update; +updatePinnedForumTopic#683b2c52 flags:# pinned:flags.0?true peer:Peer topic_id:int = Update; +updatePinnedForumTopics#def143d0 flags:# peer:Peer order:flags.0?Vector = Update; updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State; updates.differenceEmpty#5d75a138 date:int seq:int = updates.Difference; updates.difference#f49ca0 new_messages:Vector new_encrypted_messages:Vector other_updates:Vector chats:Vector users:Vector state:updates.State = updates.Difference; @@ -459,6 +462,7 @@ sendMessageHistoryImportAction#dbda9246 progress:int = SendMessageAction; sendMessageChooseStickerAction#b05ac6b1 = SendMessageAction; sendMessageEmojiInteraction#25972bcb emoticon:string msg_id:int interaction:DataJSON = SendMessageAction; sendMessageEmojiInteractionSeen#b665902e emoticon:string = SendMessageAction; +sendMessageTextDraftAction#376d975c random_id:long text:TextWithEntities = SendMessageAction; contacts.found#b3134d9d my_results:Vector results:Vector chats:Vector users:Vector = contacts.Found; inputPrivacyKeyStatusTimestamp#4f96cb18 = InputPrivacyKey; inputPrivacyKeyChatInvite#bdfb0426 = InputPrivacyKey; @@ -1058,7 +1062,7 @@ messageReplies#83d60fc2 flags:# comments:flags.0?true replies:int replies_pts:in peerBlocked#e8fd8014 peer_id:Peer date:int = PeerBlocked; stats.messageStats#7fe91c14 views_graph:StatsGraph reactions_by_emotion_graph:StatsGraph = stats.MessageStats; groupCallDiscarded#7780bcb4 id:long access_hash:long duration:int = GroupCall; -groupCall#553b0ba1 flags:# join_muted:flags.1?true can_change_join_muted:flags.2?true join_date_asc:flags.6?true schedule_start_subscribed:flags.8?true can_start_video:flags.9?true record_video_active:flags.11?true rtmp_stream:flags.12?true listeners_hidden:flags.13?true conference:flags.14?true creator:flags.15?true id:long access_hash:long participants_count:int title:flags.3?string stream_dc_id:flags.4?int record_start_date:flags.5?int schedule_date:flags.7?int unmuted_video_count:flags.10?int unmuted_video_limit:int version:int invite_link:flags.16?string = GroupCall; +groupCall#553b0ba1 flags:# join_muted:flags.1?true can_change_join_muted:flags.2?true join_date_asc:flags.6?true schedule_start_subscribed:flags.8?true can_start_video:flags.9?true record_video_active:flags.11?true rtmp_stream:flags.12?true listeners_hidden:flags.13?true conference:flags.14?true creator:flags.15?true messages_enabled:flags.17?true can_change_messages_enabled:flags.18?true min:flags.19?true id:long access_hash:long participants_count:int title:flags.3?string stream_dc_id:flags.4?int record_start_date:flags.5?int schedule_date:flags.7?int unmuted_video_count:flags.10?int unmuted_video_limit:int version:int invite_link:flags.16?string = GroupCall; inputGroupCall#d8aa840f id:long access_hash:long = InputGroupCall; inputGroupCallSlug#fe06823f slug:string = InputGroupCall; inputGroupCallInviteMessage#8c10603f msg_id:int = InputGroupCall; @@ -1097,6 +1101,10 @@ botCommandScopePeerUser#a1321f3 peer:InputPeer user_id:InputUser = BotCommandSco account.resetPasswordFailedWait#e3779861 retry_date:int = account.ResetPasswordResult; account.resetPasswordRequestedWait#e9effc7d until_date:int = account.ResetPasswordResult; account.resetPasswordOk#e926d63e = account.ResetPasswordResult; +chatTheme#c3dffc04 emoticon:string = ChatTheme; +chatThemeUniqueGift#3458f9c8 gift:StarGift theme_settings:Vector = ChatTheme; +account.chatThemesNotModified#e011e1c4 = account.ChatThemes; +account.chatThemes#be098173 flags:# hash:long themes:Vector chats:Vector users:Vector next_offset:flags.0?string = account.ChatThemes; sponsoredMessage#7dbf8673 flags:# recommended:flags.5?true can_report:flags.12?true random_id:bytes url:string title:string message:string entities:flags.1?Vector photo:flags.6?Photo media:flags.14?MessageMedia color:flags.13?PeerColor button_text:string sponsor_info:flags.7?string additional_info:flags.8?string min_display_duration:flags.15?int max_display_duration:flags.15?int = SponsoredMessage; messages.sponsoredMessages#ffda656d flags:# posts_between:flags.0?int start_delay:flags.1?int between_delay:flags.2?int messages:Vector chats:Vector users:Vector = messages.SponsoredMessages; messages.sponsoredMessagesEmpty#1839490f = messages.SponsoredMessages; @@ -1154,6 +1162,8 @@ inputInvoicePremiumGiftStars#dabab2ef flags:# user_id:InputUser months:int messa inputInvoiceBusinessBotTransferStars#f4997e42 bot:InputUser stars:long = InputInvoice; inputInvoiceStarGiftResale#c39f5324 flags:# ton:flags.0?true slug:string to_id:InputPeer = InputInvoice; inputInvoiceStarGiftPrepaidUpgrade#9a0b48b8 peer:InputPeer hash:string = InputInvoice; +inputInvoicePremiumAuthCode#3e77f614 purpose:InputStorePaymentPurpose = InputInvoice; +inputInvoiceStarGiftDropOriginalDetails#923d8d1 stargift:InputSavedStarGift = InputInvoice; payments.exportedInvoice#aed0cbd9 url:string = payments.ExportedInvoice; messages.transcribedAudio#cfb9d957 flags:# pending:flags.0?true transcription_id:long text:string trial_remains_num:flags.1?int trial_remains_until_date:flags.1?int = messages.TranscribedAudio; help.premiumPromo#5334759c status_text:string status_entities:Vector video_sections:Vector videos:Vector period_options:Vector users:Vector = help.PremiumPromo; @@ -1196,7 +1206,7 @@ messageExtendedMedia#ee479c64 media:MessageMedia = MessageExtendedMedia; stickerKeyword#fcfeb29c document_id:long keyword:Vector = StickerKeyword; username#b4073647 flags:# editable:flags.0?true active:flags.1?true username:string = Username; forumTopicDeleted#23f109b id:int = ForumTopic; -forumTopic#71701da9 flags:# my:flags.1?true closed:flags.2?true pinned:flags.3?true short:flags.5?true hidden:flags.6?true id:int date:int title:string icon_color:int icon_emoji_id:flags.0?long top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int unread_reactions_count:int from_id:Peer notify_settings:PeerNotifySettings draft:flags.4?DraftMessage = ForumTopic; +forumTopic#cdff0eca flags:# my:flags.1?true closed:flags.2?true pinned:flags.3?true short:flags.5?true hidden:flags.6?true title_missing:flags.7?true id:int date:int peer:Peer title:string icon_color:int icon_emoji_id:flags.0?long top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int unread_reactions_count:int from_id:Peer notify_settings:PeerNotifySettings draft:flags.4?DraftMessage = ForumTopic; messages.forumTopics#367617d3 flags:# order_by_create_date:flags.0?true count:int topics:Vector messages:Vector chats:Vector users:Vector pts:int = messages.ForumTopics; defaultHistoryTTL#43b46b20 period:int = DefaultHistoryTTL; exportedContactToken#41bf109b url:string expires:int = ExportedContactToken; @@ -1284,6 +1294,8 @@ publicForwardMessage#1f2bf4a message:Message = PublicForward; publicForwardStory#edf3add0 peer:Peer story:StoryItem = PublicForward; stats.publicForwards#93037e20 flags:# count:int forwards:Vector next_offset:flags.0?string chats:Vector users:Vector = stats.PublicForwards; peerColor#b54b5acf flags:# color:flags.0?int background_emoji_id:flags.1?long = PeerColor; +peerColorCollectible#b9c0639a flags:# collectible_id:long gift_emoji_id:long background_emoji_id:long accent_color:int colors:Vector dark_accent_color:flags.0?int dark_colors:flags.1?Vector = PeerColor; +inputPeerColorCollectible#b8ea86a9 collectible_id:long = PeerColor; help.peerColorSet#26219a58 colors:Vector = help.PeerColorSet; help.peerColorProfileSet#767d61eb palette_colors:Vector bg_colors:Vector story_colors:Vector = help.PeerColorSet; help.peerColorOption#adec6ebe flags:# hidden:flags.0?true color_id:int colors:flags.1?help.PeerColorSet dark_colors:flags.2?help.PeerColorSet channel_min_level:flags.3?int group_min_level:flags.4?int = help.PeerColorOption; @@ -1369,7 +1381,7 @@ starsTransactionPeer#d80da15d peer:Peer = StarsTransactionPeer; starsTransactionPeerAds#60682812 = StarsTransactionPeer; starsTransactionPeerAPI#f9677aad = StarsTransactionPeer; starsTopupOption#bd915c0 flags:# extended:flags.1?true stars:long store_product:flags.0?string currency:string amount:long = StarsTopupOption; -starsTransaction#13659eb0 flags:# refund:flags.3?true pending:flags.4?true failed:flags.6?true gift:flags.10?true reaction:flags.11?true stargift_upgrade:flags.18?true business_transfer:flags.21?true stargift_resale:flags.22?true posts_search:flags.24?true stargift_prepaid_upgrade:flags.25?true id:string amount:StarsAmount date:int peer:StarsTransactionPeer title:flags.0?string description:flags.1?string photo:flags.2?WebDocument transaction_date:flags.5?int transaction_url:flags.5?string bot_payload:flags.7?bytes msg_id:flags.8?int extended_media:flags.9?Vector subscription_period:flags.12?int giveaway_post_id:flags.13?int stargift:flags.14?StarGift floodskip_number:flags.15?int starref_commission_permille:flags.16?int starref_peer:flags.17?Peer starref_amount:flags.17?StarsAmount paid_messages:flags.19?int premium_gift_months:flags.20?int ads_proceeds_from_date:flags.23?int ads_proceeds_to_date:flags.23?int = StarsTransaction; +starsTransaction#13659eb0 flags:# refund:flags.3?true pending:flags.4?true failed:flags.6?true gift:flags.10?true reaction:flags.11?true stargift_upgrade:flags.18?true business_transfer:flags.21?true stargift_resale:flags.22?true posts_search:flags.24?true stargift_prepaid_upgrade:flags.25?true stargift_drop_original_details:flags.26?true id:string amount:StarsAmount date:int peer:StarsTransactionPeer title:flags.0?string description:flags.1?string photo:flags.2?WebDocument transaction_date:flags.5?int transaction_url:flags.5?string bot_payload:flags.7?bytes msg_id:flags.8?int extended_media:flags.9?Vector subscription_period:flags.12?int giveaway_post_id:flags.13?int stargift:flags.14?StarGift floodskip_number:flags.15?int starref_commission_permille:flags.16?int starref_peer:flags.17?Peer starref_amount:flags.17?StarsAmount paid_messages:flags.19?int premium_gift_months:flags.20?int ads_proceeds_from_date:flags.23?int ads_proceeds_to_date:flags.23?int = StarsTransaction; payments.starsStatus#6c9ce8ed flags:# balance:StarsAmount subscriptions:flags.1?Vector subscriptions_next_offset:flags.2?string subscriptions_missing_balance:flags.4?long history:flags.3?Vector next_offset:flags.0?string chats:Vector users:Vector = payments.StarsStatus; foundStory#e87acbc0 peer:Peer story:StoryItem = FoundStory; stories.foundStories#e2de7737 flags:# count:int stories:Vector next_offset:flags.0?string chats:Vector users:Vector = stories.FoundStories; @@ -1388,8 +1400,8 @@ starsSubscription#2e6eab1a flags:# canceled:flags.0?true can_refulfill:flags.1?t messageReactor#4ba3a95a flags:# top:flags.0?true my:flags.1?true anonymous:flags.2?true peer_id:flags.3?Peer count:int = MessageReactor; starsGiveawayOption#94ce852a flags:# extended:flags.0?true default:flags.1?true stars:long yearly_boosts:int store_product:flags.2?string currency:string amount:long winners:Vector = StarsGiveawayOption; starsGiveawayWinnersOption#54236209 flags:# default:flags.0?true users:int per_user_stars:long = StarsGiveawayWinnersOption; -starGift#80ac53c3 flags:# limited:flags.0?true sold_out:flags.1?true birthday:flags.2?true require_premium:flags.7?true limited_per_user:flags.8?true id:long sticker:Document stars:long availability_remains:flags.0?int availability_total:flags.0?int availability_resale:flags.4?long convert_stars:long first_sale_date:flags.1?int last_sale_date:flags.1?int upgrade_stars:flags.3?long resell_min_stars:flags.4?long title:flags.5?string released_by:flags.6?Peer per_user_total:flags.8?int per_user_remains:flags.8?int locked_until_date:flags.9?int = StarGift; -starGiftUnique#26a5553e flags:# require_premium:flags.6?true resale_ton_only:flags.7?true id:long gift_id:long title:string slug:string num:int owner_id:flags.0?Peer owner_name:flags.1?string owner_address:flags.2?string attributes:Vector availability_issued:int availability_total:int gift_address:flags.3?string resell_amount:flags.4?Vector released_by:flags.5?Peer value_amount:flags.8?long value_currency:flags.8?string = StarGift; +starGift#80ac53c3 flags:# limited:flags.0?true sold_out:flags.1?true birthday:flags.2?true require_premium:flags.7?true limited_per_user:flags.8?true peer_color_available:flags.10?true id:long sticker:Document stars:long availability_remains:flags.0?int availability_total:flags.0?int availability_resale:flags.4?long convert_stars:long first_sale_date:flags.1?int last_sale_date:flags.1?int upgrade_stars:flags.3?long resell_min_stars:flags.4?long title:flags.5?string released_by:flags.6?Peer per_user_total:flags.8?int per_user_remains:flags.8?int locked_until_date:flags.9?int = StarGift; +starGiftUnique#b0bf741b flags:# require_premium:flags.6?true resale_ton_only:flags.7?true theme_available:flags.9?true id:long gift_id:long title:string slug:string num:int owner_id:flags.0?Peer owner_name:flags.1?string owner_address:flags.2?string attributes:Vector availability_issued:int availability_total:int gift_address:flags.3?string resell_amount:flags.4?Vector released_by:flags.5?Peer value_amount:flags.8?long value_currency:flags.8?string theme_peer:flags.10?Peer peer_color:flags.11?PeerColor host_id:flags.12?Peer = StarGift; payments.starGiftsNotModified#a388a368 = payments.StarGifts; payments.starGifts#2ed82995 hash:int gifts:Vector chats:Vector users:Vector = payments.StarGifts; messageReportOption#7903e3d9 text:string option:bytes = MessageReportOption; @@ -1413,12 +1425,12 @@ starGiftAttributeModel#39d99013 name:string document:Document rarity_permille:in starGiftAttributePattern#13acff19 name:string document:Document rarity_permille:int = StarGiftAttribute; starGiftAttributeBackdrop#d93d859c name:string backdrop_id:int center_color:int edge_color:int pattern_color:int text_color:int rarity_permille:int = StarGiftAttribute; starGiftAttributeOriginalDetails#e0bff26c flags:# sender_id:flags.0?Peer recipient_id:Peer date:int message:flags.1?TextWithEntities = StarGiftAttribute; -payments.starGiftUpgradePreview#167bd90b sample_attributes:Vector = payments.StarGiftUpgradePreview; +payments.starGiftUpgradePreview#3de1dfed sample_attributes:Vector prices:Vector next_prices:Vector = payments.StarGiftUpgradePreview; users.users#62d706b8 users:Vector = users.Users; users.usersSlice#315a4974 count:int users:Vector = users.Users; payments.uniqueStarGift#416c56e8 gift:StarGift chats:Vector users:Vector = payments.UniqueStarGift; messages.webPagePreview#8c9a88ac media:MessageMedia chats:Vector users:Vector = messages.WebPagePreview; -savedStarGift#19a9b572 flags:# name_hidden:flags.0?true unsaved:flags.5?true refunded:flags.9?true can_upgrade:flags.10?true pinned_to_top:flags.12?true upgrade_separate:flags.17?true from_id:flags.1?Peer date:int gift:StarGift message:flags.2?TextWithEntities msg_id:flags.3?int saved_id:flags.11?long convert_stars:flags.4?long upgrade_stars:flags.6?long can_export_at:flags.7?int transfer_stars:flags.8?long can_transfer_at:flags.13?int can_resell_at:flags.14?int collection_id:flags.15?Vector prepaid_upgrade_hash:flags.16?string = SavedStarGift; +savedStarGift#8983a452 flags:# name_hidden:flags.0?true unsaved:flags.5?true refunded:flags.9?true can_upgrade:flags.10?true pinned_to_top:flags.12?true upgrade_separate:flags.17?true from_id:flags.1?Peer date:int gift:StarGift message:flags.2?TextWithEntities msg_id:flags.3?int saved_id:flags.11?long convert_stars:flags.4?long upgrade_stars:flags.6?long can_export_at:flags.7?int transfer_stars:flags.8?long can_transfer_at:flags.13?int can_resell_at:flags.14?int collection_id:flags.15?Vector prepaid_upgrade_hash:flags.16?string drop_original_details_stars:flags.18?long = SavedStarGift; payments.savedStarGifts#95f389b1 flags:# count:int chat_notifications_enabled:flags.1?Bool gifts:Vector next_offset:flags.0?string chats:Vector users:Vector = payments.SavedStarGifts; inputSavedStarGiftUser#69279795 msg_id:int = InputSavedStarGift; inputSavedStarGiftChat#f101aa7f peer:InputPeer saved_id:long = InputSavedStarGift; @@ -1470,6 +1482,10 @@ account.savedMusicIdsNotModified#4fc81d6e = account.SavedMusicIds; account.savedMusicIds#998d6636 ids:Vector = account.SavedMusicIds; payments.checkCanSendGiftResultOk#374fa7ad = payments.CheckCanSendGiftResult; payments.checkCanSendGiftResultFail#d5e58274 reason:TextWithEntities = payments.CheckCanSendGiftResult; +inputChatThemeEmpty#83268483 = InputChatTheme; +inputChatTheme#c93de95c emoticon:string = InputChatTheme; +inputChatThemeUniqueGift#87e5dfe4 slug:string = InputChatTheme; +starGiftUpgradePrice#99ea331d date:int upgrade_stars:long = StarGiftUpgradePrice; ---functions--- invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X; initConnection#c1cd5ea9 {X:Type} flags:# api_id:int device_model:string system_version:string app_version:string system_lang_code:string lang_pack:string lang_code:string proxy:flags.0?InputClientProxy params:flags.1?JSONValue query:!X = X; @@ -1549,7 +1565,7 @@ contacts.getBlocked#9a868f80 flags:# my_stories_from:flags.0?true offset:int lim contacts.search#11f812d8 q:string limit:int = contacts.Found; contacts.resolveUsername#725afbbc flags:# username:string referer:flags.0?string = contacts.ResolvedPeer; contacts.getTopPeers#973478b6 flags:# correspondents:flags.0?true bots_pm:flags.1?true bots_inline:flags.2?true phone_calls:flags.3?true forward_users:flags.4?true forward_chats:flags.5?true groups:flags.10?true channels:flags.15?true bots_app:flags.16?true offset:int limit:int hash:long = contacts.TopPeers; -contacts.addContact#e8f463d0 flags:# add_phone_privacy_exception:flags.0?true id:InputUser first_name:string last_name:string phone:string = Updates; +contacts.addContact#d9ba2e54 flags:# add_phone_privacy_exception:flags.0?true id:InputUser first_name:string last_name:string phone:string note:flags.1?TextWithEntities = Updates; contacts.resolvePhone#8af94344 phone:string = contacts.ResolvedPeer; contacts.editCloseFriends#ba6705f0 id:Vector = Bool; contacts.getSponsoredPeers#b6c8c393 q:string = contacts.SponsoredPeers; @@ -1703,6 +1719,12 @@ messages.reportMessagesDelivery#5a6d7395 flags:# push:flags.0?true peer:InputPee messages.toggleTodoCompleted#d3e03124 peer:InputPeer msg_id:int completed:Vector incompleted:Vector = Updates; messages.appendTodoList#21a61057 peer:InputPeer msg_id:int list:Vector = Updates; messages.toggleSuggestedPostApproval#8107455c flags:# reject:flags.1?true peer:InputPeer msg_id:int schedule_date:flags.0?int reject_comment:flags.2?string = Updates; +messages.getForumTopics#3ba47bff flags:# peer:InputPeer q:flags.0?string offset_date:int offset_id:int offset_topic:int limit:int = messages.ForumTopics; +messages.getForumTopicsByID#af0a4a08 peer:InputPeer topics:Vector = messages.ForumTopics; +messages.editForumTopic#cecc1134 flags:# peer:InputPeer topic_id:int title:flags.0?string icon_emoji_id:flags.1?long closed:flags.2?Bool hidden:flags.3?Bool = Updates; +messages.updatePinnedForumTopic#175df251 peer:InputPeer topic_id:int pinned:Bool = Updates; +messages.createForumTopic#2f98c3d5 flags:# title_missing:flags.4?true peer:InputPeer title:string icon_color:flags.0?int icon_emoji_id:flags.3?long random_id:long send_as:flags.2?InputPeer = Updates; +messages.deleteTopicHistory#d2816f10 peer:InputPeer top_msg_id:int = messages.AffectedHistory; updates.getState#edd4882a = updates.State; updates.getDifference#19c2f763 flags:# pts:int pts_limit:flags.1?int pts_total_limit:flags.0?int date:int qts:int qts_limit:flags.2?int = updates.Difference; updates.getChannelDifference#3173d78 flags:# force:flags.0?true channel:InputChannel filter:ChannelMessagesFilter pts:int limit:int = updates.ChannelDifference; @@ -1758,12 +1780,6 @@ channels.reorderUsernames#b45ced1d channel:InputChannel order:Vector = B channels.toggleUsername#50f24105 channel:InputChannel username:string active:Bool = Bool; channels.deactivateAllUsernames#a245dd3 channel:InputChannel = Bool; channels.toggleForum#3ff75734 channel:InputChannel enabled:Bool tabs:Bool = Updates; -channels.createForumTopic#f40c0224 flags:# channel:InputChannel title:string icon_color:flags.0?int icon_emoji_id:flags.3?long random_id:long send_as:flags.2?InputPeer = Updates; -channels.getForumTopics#de560d1 flags:# channel:InputChannel q:flags.0?string offset_date:int offset_id:int offset_topic:int limit:int = messages.ForumTopics; -channels.getForumTopicsByID#b0831eb9 channel:InputChannel topics:Vector = messages.ForumTopics; -channels.editForumTopic#f4dfa185 flags:# channel:InputChannel topic_id:int title:flags.0?string icon_emoji_id:flags.1?long closed:flags.2?Bool hidden:flags.3?Bool = Updates; -channels.updatePinnedForumTopic#6c2d9026 channel:InputChannel topic_id:int pinned:Bool = Updates; -channels.deleteTopicHistory#34435f2d channel:InputChannel top_msg_id:int = messages.AffectedHistory; channels.toggleParticipantsHidden#6a6e7854 channel:InputChannel enabled:Bool = Updates; channels.toggleViewForumAsMessages#9738bb15 channel:InputChannel enabled:Bool = Updates; channels.getChannelRecommendations#25a71742 flags:# channel:flags.0?InputChannel = messages.Chats; @@ -1809,7 +1825,7 @@ payments.getStarGiftUpgradePreview#9c9abcb1 gift_id:long = payments.StarGiftUpgr payments.upgradeStarGift#aed6e4f5 flags:# keep_original_details:flags.0?true stargift:InputSavedStarGift = Updates; payments.transferStarGift#7f18176a stargift:InputSavedStarGift to_id:InputPeer = Updates; payments.getUniqueStarGift#a1974d72 slug:string = payments.UniqueStarGift; -payments.getSavedStarGifts#a319e569 flags:# exclude_unsaved:flags.0?true exclude_saved:flags.1?true exclude_unlimited:flags.2?true exclude_unique:flags.4?true sort_by_value:flags.5?true exclude_upgradable:flags.7?true exclude_unupgradable:flags.8?true peer:InputPeer collection_id:flags.6?int offset:string limit:int = payments.SavedStarGifts; +payments.getSavedStarGifts#a319e569 flags:# exclude_unsaved:flags.0?true exclude_saved:flags.1?true exclude_unlimited:flags.2?true exclude_unique:flags.4?true sort_by_value:flags.5?true exclude_upgradable:flags.7?true exclude_unupgradable:flags.8?true peer_color_available:flags.9?true exclude_hosted:flags.10?true peer:InputPeer collection_id:flags.6?int offset:string limit:int = payments.SavedStarGifts; payments.getStarGiftWithdrawalUrl#d06e93a8 stargift:InputSavedStarGift password:InputCheckPasswordSRP = payments.StarGiftWithdrawalUrl; payments.toggleStarGiftsPinnedToTop#1513e7b0 peer:InputPeer stargift:Vector = Bool; payments.getResaleStarGifts#7a5fa236 flags:# sort_by_price:flags.1?true sort_by_num:flags.2?true attributes_hash:flags.0?long gift_id:long attributes:flags.3?Vector offset:string limit:int = payments.ResaleStarGifts; diff --git a/src/lib/gramjs/tl/static/api.json b/src/lib/gramjs/tl/static/api.json index f9e2d8517..58a0d5f8a 100644 --- a/src/lib/gramjs/tl/static/api.json +++ b/src/lib/gramjs/tl/static/api.json @@ -229,6 +229,12 @@ "messages.reportMessagesDelivery", "messages.getPreparedInlineMessage", "messages.toggleSuggestedPostApproval", + "messages.createForumTopic", + "messages.getForumTopics", + "messages.getForumTopicsByID", + "messages.editForumTopic", + "messages.updatePinnedForumTopic", + "messages.deleteTopicHistory", "messages.toggleTodoCompleted", "messages.appendTodoList", "updates.getState", @@ -372,12 +378,6 @@ "stats.getBroadcastRevenueWithdrawalUrl", "channels.deactivateAllUsernames", "channels.toggleForum", - "channels.createForumTopic", - "channels.getForumTopics", - "channels.getForumTopicsByID", - "channels.editForumTopic", - "channels.updatePinnedForumTopic", - "channels.deleteTopicHistory", "channels.toggleParticipantsHidden", "channels.toggleViewForumAsMessages", "photos.uploadContactProfilePhoto", diff --git a/src/lib/gramjs/tl/static/api.tl b/src/lib/gramjs/tl/static/api.tl index 4ebda3ace..29e7c374a 100644 --- a/src/lib/gramjs/tl/static/api.tl +++ b/src/lib/gramjs/tl/static/api.tl @@ -85,7 +85,7 @@ storage.fileMp4#b3cea0e4 = storage.FileType; storage.fileWebp#1081464c = storage.FileType; userEmpty#d3bc4b7a id:long = User; -user#20b1422 flags:# self:flags.10?true contact:flags.11?true mutual_contact:flags.12?true deleted:flags.13?true bot:flags.14?true bot_chat_history:flags.15?true bot_nochats:flags.16?true verified:flags.17?true restricted:flags.18?true min:flags.20?true bot_inline_geo:flags.21?true support:flags.23?true scam:flags.24?true apply_min_photo:flags.25?true fake:flags.26?true bot_attach_menu:flags.27?true premium:flags.28?true attach_menu_enabled:flags.29?true flags2:# bot_can_edit:flags2.1?true close_friend:flags2.2?true stories_hidden:flags2.3?true stories_unavailable:flags2.4?true contact_require_premium:flags2.10?true bot_business:flags2.11?true bot_has_main_app:flags2.13?true id:long access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int restriction_reason:flags.18?Vector bot_inline_placeholder:flags.19?string lang_code:flags.22?string emoji_status:flags.30?EmojiStatus usernames:flags2.0?Vector stories_max_id:flags2.5?int color:flags2.8?PeerColor profile_color:flags2.9?PeerColor bot_active_users:flags2.12?int bot_verification_icon:flags2.14?long send_paid_messages_stars:flags2.15?long = User; +user#20b1422 flags:# self:flags.10?true contact:flags.11?true mutual_contact:flags.12?true deleted:flags.13?true bot:flags.14?true bot_chat_history:flags.15?true bot_nochats:flags.16?true verified:flags.17?true restricted:flags.18?true min:flags.20?true bot_inline_geo:flags.21?true support:flags.23?true scam:flags.24?true apply_min_photo:flags.25?true fake:flags.26?true bot_attach_menu:flags.27?true premium:flags.28?true attach_menu_enabled:flags.29?true flags2:# bot_can_edit:flags2.1?true close_friend:flags2.2?true stories_hidden:flags2.3?true stories_unavailable:flags2.4?true contact_require_premium:flags2.10?true bot_business:flags2.11?true bot_has_main_app:flags2.13?true bot_forum_view:flags2.16?true id:long access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int restriction_reason:flags.18?Vector bot_inline_placeholder:flags.19?string lang_code:flags.22?string emoji_status:flags.30?EmojiStatus usernames:flags2.0?Vector stories_max_id:flags2.5?int color:flags2.8?PeerColor profile_color:flags2.9?PeerColor bot_active_users:flags2.12?int bot_verification_icon:flags2.14?long send_paid_messages_stars:flags2.15?long = User; userProfilePhotoEmpty#4f11bae1 = UserProfilePhoto; userProfilePhoto#82d1f706 flags:# has_video:flags.0?true personal:flags.2?true photo_id:long stripped_thumb:flags.1?bytes dc_id:int = UserProfilePhoto; @@ -167,12 +167,12 @@ messageActionGroupCall#7a0d7f42 flags:# call:InputGroupCall duration:flags.0?int messageActionInviteToGroupCall#502f92f7 call:InputGroupCall users:Vector = MessageAction; messageActionSetMessagesTTL#3c134d7b flags:# period:int auto_setting_from:flags.0?long = MessageAction; messageActionGroupCallScheduled#b3a07661 call:InputGroupCall schedule_date:int = MessageAction; -messageActionSetChatTheme#aa786345 emoticon:string = MessageAction; +messageActionSetChatTheme#b91bbd3a theme:ChatTheme = MessageAction; messageActionChatJoinedByRequest#ebbca3cb = MessageAction; messageActionWebViewDataSentMe#47dd8079 text:string data:string = MessageAction; messageActionWebViewDataSent#b4c38cb5 text:string = MessageAction; messageActionGiftPremium#6c6274fa flags:# currency:string amount:long months:int crypto_currency:flags.0?string crypto_amount:flags.0?long message:flags.1?TextWithEntities = MessageAction; -messageActionTopicCreate#d999256 flags:# title:string icon_color:int icon_emoji_id:flags.0?long = MessageAction; +messageActionTopicCreate#d999256 flags:# title_missing:flags.1?true title:string icon_color:int icon_emoji_id:flags.0?long = MessageAction; messageActionTopicEdit#c0944820 flags:# title:flags.0?string icon_emoji_id:flags.1?long closed:flags.2?Bool hidden:flags.3?Bool = MessageAction; messageActionSuggestProfilePhoto#57de635e photo:Photo = MessageAction; messageActionRequestedPeer#31518e9b button_id:int peers:Vector = MessageAction; @@ -186,7 +186,7 @@ messageActionPaymentRefunded#41b3e202 flags:# peer:Peer currency:string total_am messageActionGiftStars#45d5b021 flags:# currency:string amount:long stars:long crypto_currency:flags.0?string crypto_amount:flags.0?long transaction_id:flags.1?string = MessageAction; messageActionPrizeStars#b00c47a2 flags:# unclaimed:flags.0?true stars:long transaction_id:string boost_peer:Peer giveaway_msg_id:int = MessageAction; messageActionStarGift#f24de7fa flags:# name_hidden:flags.0?true saved:flags.2?true converted:flags.3?true upgraded:flags.5?true refunded:flags.9?true can_upgrade:flags.10?true prepaid_upgrade:flags.13?true upgrade_separate:flags.16?true gift:StarGift message:flags.1?TextWithEntities convert_stars:flags.4?long upgrade_msg_id:flags.5?int upgrade_stars:flags.8?long from_id:flags.11?Peer peer:flags.12?Peer saved_id:flags.12?long prepaid_upgrade_hash:flags.14?string gift_msg_id:flags.15?int = MessageAction; -messageActionStarGiftUnique#34f762f3 flags:# upgrade:flags.0?true transferred:flags.1?true saved:flags.2?true refunded:flags.5?true prepaid_upgrade:flags.11?true gift:StarGift can_export_at:flags.3?int transfer_stars:flags.4?long from_id:flags.6?Peer peer:flags.7?Peer saved_id:flags.7?long resale_amount:flags.8?StarsAmount can_transfer_at:flags.9?int can_resell_at:flags.10?int = MessageAction; +messageActionStarGiftUnique#95728543 flags:# upgrade:flags.0?true transferred:flags.1?true saved:flags.2?true refunded:flags.5?true prepaid_upgrade:flags.11?true assigned:flags.13?true gift:StarGift can_export_at:flags.3?int transfer_stars:flags.4?long from_id:flags.6?Peer peer:flags.7?Peer saved_id:flags.7?long resale_amount:flags.8?StarsAmount can_transfer_at:flags.9?int can_resell_at:flags.10?int drop_original_details_stars:flags.12?long = MessageAction; messageActionPaidMessagesRefunded#ac1f1fcd count:int stars:long = MessageAction; messageActionPaidMessagesPrice#84b88578 flags:# broadcast_messages_allowed:flags.0?true stars:long = MessageAction; messageActionConferenceCall#2ffe2f7a flags:# missed:flags.0?true active:flags.1?true video:flags.4?true call_id:long duration:flags.2?int other_participants:flags.3?Vector = MessageAction; @@ -196,6 +196,7 @@ messageActionSuggestedPostApproval#ee7a1596 flags:# rejected:flags.0?true balanc messageActionSuggestedPostSuccess#95ddcf69 price:StarsAmount = MessageAction; messageActionSuggestedPostRefund#69f916f8 flags:# payer_initiated:flags.0?true = MessageAction; messageActionGiftTon#a8a3c699 flags:# currency:string amount:long crypto_currency:string crypto_amount:long transaction_id:flags.0?string = MessageAction; +messageActionSuggestBirthday#2c8f2a25 birthday:Birthday = MessageAction; dialog#d58a08c6 flags:# pinned:flags.2?true unread_mark:flags.3?true view_forum_as_messages:flags.6?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int unread_reactions_count:int notify_settings:PeerNotifySettings pts:flags.0?int draft:flags.1?DraftMessage folder_id:flags.4?int ttl_period:flags.5?int = Dialog; dialogFolder#71bd134c flags:# pinned:flags.2?true folder:Folder peer:Peer top_message:int unread_muted_peers_count:int unread_unmuted_peers_count:int unread_muted_messages_count:int unread_unmuted_messages_count:int = Dialog; @@ -215,7 +216,7 @@ geoPoint#b2a2f663 flags:# long:double lat:double access_hash:long accuracy_radiu auth.sentCode#5e002502 flags:# type:auth.SentCodeType phone_code_hash:string next_type:flags.1?auth.CodeType timeout:flags.2?int = auth.SentCode; auth.sentCodeSuccess#2390fe44 authorization:auth.Authorization = auth.SentCode; -auth.sentCodePaymentRequired#d7a2fcf9 store_product:string phone_code_hash:string support_email_address:string support_email_subject:string = auth.SentCode; +auth.sentCodePaymentRequired#e0955a3c store_product:string phone_code_hash:string support_email_address:string support_email_subject:string currency:string amount:long = auth.SentCode; auth.authorization#2ea2c0d4 flags:# setup_password_required:flags.1?true otherwise_relogin_days:flags.1?int tmp_sessions:flags.0?int future_auth_token:flags.2?bytes user:User = auth.Authorization; auth.authorizationSignUpRequired#44747e9a flags:# terms_of_service:flags.0?help.TermsOfService = auth.Authorization; @@ -248,7 +249,7 @@ inputReportReasonFake#f5ddd6e7 = ReportReason; inputReportReasonIllegalDrugs#a8eb2be = ReportReason; inputReportReasonPersonalDetails#9ec7863d = ReportReason; -userFull#3fd81e28 flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true has_scheduled:flags.12?true video_calls_available:flags.13?true voice_messages_forbidden:flags.20?true translations_disabled:flags.23?true stories_pinned_available:flags.26?true blocked_my_stories_from:flags.27?true wallpaper_overridden:flags.28?true contact_require_premium:flags.29?true read_dates_private:flags.30?true flags2:# sponsored_enabled:flags2.7?true can_view_revenue:flags2.9?true bot_can_manage_emoji_status:flags2.10?true display_gifts_button:flags2.16?true id:long about:flags.1?string settings:PeerSettings personal_photo:flags.21?Photo profile_photo:flags.2?Photo fallback_photo:flags.22?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int ttl_period:flags.14?int theme_emoticon:flags.15?string private_forward_name:flags.16?string bot_group_admin_rights:flags.17?ChatAdminRights bot_broadcast_admin_rights:flags.18?ChatAdminRights wallpaper:flags.24?WallPaper stories:flags.25?PeerStories business_work_hours:flags2.0?BusinessWorkHours business_location:flags2.1?BusinessLocation business_greeting_message:flags2.2?BusinessGreetingMessage business_away_message:flags2.3?BusinessAwayMessage business_intro:flags2.4?BusinessIntro birthday:flags2.5?Birthday personal_channel_id:flags2.6?long personal_channel_message:flags2.6?int stargifts_count:flags2.8?int starref_program:flags2.11?StarRefProgram bot_verification:flags2.12?BotVerification send_paid_messages_stars:flags2.14?long disallowed_gifts:flags2.15?DisallowedGiftsSettings stars_rating:flags2.17?StarsRating stars_my_pending_rating:flags2.18?StarsRating stars_my_pending_rating_date:flags2.18?int main_tab:flags2.20?ProfileTab saved_music:flags2.21?Document = UserFull; +userFull#a02bc13e flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true has_scheduled:flags.12?true video_calls_available:flags.13?true voice_messages_forbidden:flags.20?true translations_disabled:flags.23?true stories_pinned_available:flags.26?true blocked_my_stories_from:flags.27?true wallpaper_overridden:flags.28?true contact_require_premium:flags.29?true read_dates_private:flags.30?true flags2:# sponsored_enabled:flags2.7?true can_view_revenue:flags2.9?true bot_can_manage_emoji_status:flags2.10?true display_gifts_button:flags2.16?true id:long about:flags.1?string settings:PeerSettings personal_photo:flags.21?Photo profile_photo:flags.2?Photo fallback_photo:flags.22?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int ttl_period:flags.14?int theme:flags.15?ChatTheme private_forward_name:flags.16?string bot_group_admin_rights:flags.17?ChatAdminRights bot_broadcast_admin_rights:flags.18?ChatAdminRights wallpaper:flags.24?WallPaper stories:flags.25?PeerStories business_work_hours:flags2.0?BusinessWorkHours business_location:flags2.1?BusinessLocation business_greeting_message:flags2.2?BusinessGreetingMessage business_away_message:flags2.3?BusinessAwayMessage business_intro:flags2.4?BusinessIntro birthday:flags2.5?Birthday personal_channel_id:flags2.6?long personal_channel_message:flags2.6?int stargifts_count:flags2.8?int starref_program:flags2.11?StarRefProgram bot_verification:flags2.12?BotVerification send_paid_messages_stars:flags2.14?long disallowed_gifts:flags2.15?DisallowedGiftsSettings stars_rating:flags2.17?StarsRating stars_my_pending_rating:flags2.18?StarsRating stars_my_pending_rating_date:flags2.18?int main_tab:flags2.20?ProfileTab saved_music:flags2.21?Document note:flags2.22?TextWithEntities = UserFull; contact#145ade0b user_id:long mutual:Bool = Contact; @@ -268,8 +269,8 @@ messages.dialogs#15ba6c40 dialogs:Vector messages:Vector chats: messages.dialogsSlice#71e094f3 count:int dialogs:Vector messages:Vector chats:Vector users:Vector = messages.Dialogs; messages.dialogsNotModified#f0e3e596 count:int = messages.Dialogs; -messages.messages#8c718e87 messages:Vector chats:Vector users:Vector = messages.Messages; -messages.messagesSlice#762b263d flags:# inexact:flags.1?true count:int next_rate:flags.0?int offset_id_offset:flags.2?int search_flood:flags.3?SearchPostsFlood messages:Vector chats:Vector users:Vector = messages.Messages; +messages.messages#1d73e7ea messages:Vector topics:Vector chats:Vector users:Vector = messages.Messages; +messages.messagesSlice#5f206716 flags:# inexact:flags.1?true count:int next_rate:flags.0?int offset_id_offset:flags.2?int search_flood:flags.3?SearchPostsFlood messages:Vector topics:Vector chats:Vector users:Vector = messages.Messages; messages.channelMessages#c776ba4e flags:# inexact:flags.1?true pts:int count:int offset_id_offset:flags.2?int messages:Vector topics:Vector chats:Vector users:Vector = messages.Messages; messages.messagesNotModified#74535f21 count:int = messages.Messages; @@ -301,7 +302,7 @@ inputMessagesFilterPinned#1bb00451 = MessagesFilter; updateNewMessage#1f2b0afd message:Message pts:int pts_count:int = Update; updateMessageID#4e90bfd6 id:int random_id:long = Update; updateDeleteMessages#a20db0e5 messages:Vector pts:int pts_count:int = Update; -updateUserTyping#c01e857f user_id:long action:SendMessageAction = Update; +updateUserTyping#2a17bf5c flags:# user_id:long top_msg_id:flags.0?int action:SendMessageAction = Update; updateChatUserTyping#83487af0 chat_id:long from_id:Peer action:SendMessageAction = Update; updateChatParticipants#7761198 participants:ChatParticipants = Update; updateUserStatus#e5bdf8de user_id:long status:UserStatus = Update; @@ -318,7 +319,7 @@ updateNotifySettings#bec268ef peer:NotifyPeer notify_settings:PeerNotifySettings updateServiceNotification#ebe46819 flags:# popup:flags.0?true invert_media:flags.2?true inbox_date:flags.1?int type:string message:string media:MessageMedia entities:Vector = Update; updatePrivacy#ee3b272a key:PrivacyKey rules:Vector = Update; updateUserPhone#5492a13 user_id:long phone:string = Update; -updateReadHistoryInbox#9c974fdf flags:# folder_id:flags.0?int peer:Peer max_id:int still_unread_count:int pts:int pts_count:int = Update; +updateReadHistoryInbox#9e84bc99 flags:# folder_id:flags.0?int peer:Peer top_msg_id:flags.1?int max_id:int still_unread_count:int pts:int pts_count:int = Update; updateReadHistoryOutbox#2f2f21bf peer:Peer max_id:int pts:int pts_count:int = Update; updateWebPage#7f891213 webpage:WebPage pts:int pts_count:int = Update; updateReadMessagesContents#f8227181 flags:# messages:Vector pts:int pts_count:int date:flags.0?int = Update; @@ -405,8 +406,6 @@ updateRecentEmojiStatuses#30f443db = Update; updateRecentReactions#6f7863f4 = Update; updateMoveStickerSetToTop#86fccf85 flags:# masks:flags.0?true emojis:flags.1?true stickerset:long = Update; updateMessageExtendedMedia#d5a41724 peer:Peer msg_id:int extended_media:Vector = Update; -updateChannelPinnedTopic#192efbe3 flags:# pinned:flags.0?true channel_id:long topic_id:int = Update; -updateChannelPinnedTopics#fe198602 flags:# channel_id:long order:flags.0?Vector = Update; updateUser#20529438 user_id:long = Update; updateAutoSaveSettings#ec05b097 = Update; updateStory#75b3b798 peer:Peer story:StoryItem = Update; @@ -443,6 +442,10 @@ updateGroupCallChainBlocks#a477288f call:InputGroupCall sub_chain_id:int blocks: updateReadMonoForumInbox#77b0e372 channel_id:long saved_peer_id:Peer read_max_id:int = Update; updateReadMonoForumOutbox#a4a79376 channel_id:long saved_peer_id:Peer read_max_id:int = Update; updateMonoForumNoPaidException#9f812b08 flags:# exception:flags.0?true channel_id:long saved_peer_id:Peer = Update; +updateGroupCallMessage#78c314e0 call:InputGroupCall from_id:Peer random_id:long message:TextWithEntities = Update; +updateGroupCallEncryptedMessage#c957a766 call:InputGroupCall from_id:Peer encrypted_message:bytes = Update; +updatePinnedForumTopic#683b2c52 flags:# pinned:flags.0?true peer:Peer topic_id:int = Update; +updatePinnedForumTopics#def143d0 flags:# peer:Peer order:flags.0?Vector = Update; updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State; @@ -535,6 +538,7 @@ sendMessageHistoryImportAction#dbda9246 progress:int = SendMessageAction; sendMessageChooseStickerAction#b05ac6b1 = SendMessageAction; sendMessageEmojiInteraction#25972bcb emoticon:string msg_id:int interaction:DataJSON = SendMessageAction; sendMessageEmojiInteractionSeen#b665902e emoticon:string = SendMessageAction; +sendMessageTextDraftAction#376d975c random_id:long text:TextWithEntities = SendMessageAction; contacts.found#b3134d9d my_results:Vector results:Vector chats:Vector users:Vector = contacts.Found; @@ -1355,7 +1359,7 @@ peerBlocked#e8fd8014 peer_id:Peer date:int = PeerBlocked; stats.messageStats#7fe91c14 views_graph:StatsGraph reactions_by_emotion_graph:StatsGraph = stats.MessageStats; groupCallDiscarded#7780bcb4 id:long access_hash:long duration:int = GroupCall; -groupCall#553b0ba1 flags:# join_muted:flags.1?true can_change_join_muted:flags.2?true join_date_asc:flags.6?true schedule_start_subscribed:flags.8?true can_start_video:flags.9?true record_video_active:flags.11?true rtmp_stream:flags.12?true listeners_hidden:flags.13?true conference:flags.14?true creator:flags.15?true id:long access_hash:long participants_count:int title:flags.3?string stream_dc_id:flags.4?int record_start_date:flags.5?int schedule_date:flags.7?int unmuted_video_count:flags.10?int unmuted_video_limit:int version:int invite_link:flags.16?string = GroupCall; +groupCall#553b0ba1 flags:# join_muted:flags.1?true can_change_join_muted:flags.2?true join_date_asc:flags.6?true schedule_start_subscribed:flags.8?true can_start_video:flags.9?true record_video_active:flags.11?true rtmp_stream:flags.12?true listeners_hidden:flags.13?true conference:flags.14?true creator:flags.15?true messages_enabled:flags.17?true can_change_messages_enabled:flags.18?true min:flags.19?true id:long access_hash:long participants_count:int title:flags.3?string stream_dc_id:flags.4?int record_start_date:flags.5?int schedule_date:flags.7?int unmuted_video_count:flags.10?int unmuted_video_limit:int version:int invite_link:flags.16?string = GroupCall; inputGroupCall#d8aa840f id:long access_hash:long = InputGroupCall; inputGroupCallSlug#fe06823f slug:string = InputGroupCall; @@ -1417,6 +1421,12 @@ account.resetPasswordFailedWait#e3779861 retry_date:int = account.ResetPasswordR account.resetPasswordRequestedWait#e9effc7d until_date:int = account.ResetPasswordResult; account.resetPasswordOk#e926d63e = account.ResetPasswordResult; +chatTheme#c3dffc04 emoticon:string = ChatTheme; +chatThemeUniqueGift#3458f9c8 gift:StarGift theme_settings:Vector = ChatTheme; + +account.chatThemesNotModified#e011e1c4 = account.ChatThemes; +account.chatThemes#be098173 flags:# hash:long themes:Vector chats:Vector users:Vector next_offset:flags.0?string = account.ChatThemes; + sponsoredMessage#7dbf8673 flags:# recommended:flags.5?true can_report:flags.12?true random_id:bytes url:string title:string message:string entities:flags.1?Vector photo:flags.6?Photo media:flags.14?MessageMedia color:flags.13?PeerColor button_text:string sponsor_info:flags.7?string additional_info:flags.8?string min_display_duration:flags.15?int max_display_duration:flags.15?int = SponsoredMessage; messages.sponsoredMessages#ffda656d flags:# posts_between:flags.0?int start_delay:flags.1?int between_delay:flags.2?int messages:Vector chats:Vector users:Vector = messages.SponsoredMessages; @@ -1505,6 +1515,8 @@ inputInvoicePremiumGiftStars#dabab2ef flags:# user_id:InputUser months:int messa inputInvoiceBusinessBotTransferStars#f4997e42 bot:InputUser stars:long = InputInvoice; inputInvoiceStarGiftResale#c39f5324 flags:# ton:flags.0?true slug:string to_id:InputPeer = InputInvoice; inputInvoiceStarGiftPrepaidUpgrade#9a0b48b8 peer:InputPeer hash:string = InputInvoice; +inputInvoicePremiumAuthCode#3e77f614 purpose:InputStorePaymentPurpose = InputInvoice; +inputInvoiceStarGiftDropOriginalDetails#923d8d1 stargift:InputSavedStarGift = InputInvoice; payments.exportedInvoice#aed0cbd9 url:string = payments.ExportedInvoice; @@ -1566,7 +1578,7 @@ stickerKeyword#fcfeb29c document_id:long keyword:Vector = StickerKeyword username#b4073647 flags:# editable:flags.0?true active:flags.1?true username:string = Username; forumTopicDeleted#23f109b id:int = ForumTopic; -forumTopic#71701da9 flags:# my:flags.1?true closed:flags.2?true pinned:flags.3?true short:flags.5?true hidden:flags.6?true id:int date:int title:string icon_color:int icon_emoji_id:flags.0?long top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int unread_reactions_count:int from_id:Peer notify_settings:PeerNotifySettings draft:flags.4?DraftMessage = ForumTopic; +forumTopic#cdff0eca flags:# my:flags.1?true closed:flags.2?true pinned:flags.3?true short:flags.5?true hidden:flags.6?true title_missing:flags.7?true id:int date:int peer:Peer title:string icon_color:int icon_emoji_id:flags.0?long top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int unread_reactions_count:int from_id:Peer notify_settings:PeerNotifySettings draft:flags.4?DraftMessage = ForumTopic; messages.forumTopics#367617d3 flags:# order_by_create_date:flags.0?true count:int topics:Vector messages:Vector chats:Vector users:Vector pts:int = messages.ForumTopics; @@ -1710,6 +1722,8 @@ publicForwardStory#edf3add0 peer:Peer story:StoryItem = PublicForward; stats.publicForwards#93037e20 flags:# count:int forwards:Vector next_offset:flags.0?string chats:Vector users:Vector = stats.PublicForwards; peerColor#b54b5acf flags:# color:flags.0?int background_emoji_id:flags.1?long = PeerColor; +peerColorCollectible#b9c0639a flags:# collectible_id:long gift_emoji_id:long background_emoji_id:long accent_color:int colors:Vector dark_accent_color:flags.0?int dark_colors:flags.1?Vector = PeerColor; +inputPeerColorCollectible#b8ea86a9 collectible_id:long = PeerColor; help.peerColorSet#26219a58 colors:Vector = help.PeerColorSet; help.peerColorProfileSet#767d61eb palette_colors:Vector bg_colors:Vector story_colors:Vector = help.PeerColorSet; @@ -1854,7 +1868,7 @@ starsTransactionPeerAPI#f9677aad = StarsTransactionPeer; starsTopupOption#bd915c0 flags:# extended:flags.1?true stars:long store_product:flags.0?string currency:string amount:long = StarsTopupOption; -starsTransaction#13659eb0 flags:# refund:flags.3?true pending:flags.4?true failed:flags.6?true gift:flags.10?true reaction:flags.11?true stargift_upgrade:flags.18?true business_transfer:flags.21?true stargift_resale:flags.22?true posts_search:flags.24?true stargift_prepaid_upgrade:flags.25?true id:string amount:StarsAmount date:int peer:StarsTransactionPeer title:flags.0?string description:flags.1?string photo:flags.2?WebDocument transaction_date:flags.5?int transaction_url:flags.5?string bot_payload:flags.7?bytes msg_id:flags.8?int extended_media:flags.9?Vector subscription_period:flags.12?int giveaway_post_id:flags.13?int stargift:flags.14?StarGift floodskip_number:flags.15?int starref_commission_permille:flags.16?int starref_peer:flags.17?Peer starref_amount:flags.17?StarsAmount paid_messages:flags.19?int premium_gift_months:flags.20?int ads_proceeds_from_date:flags.23?int ads_proceeds_to_date:flags.23?int = StarsTransaction; +starsTransaction#13659eb0 flags:# refund:flags.3?true pending:flags.4?true failed:flags.6?true gift:flags.10?true reaction:flags.11?true stargift_upgrade:flags.18?true business_transfer:flags.21?true stargift_resale:flags.22?true posts_search:flags.24?true stargift_prepaid_upgrade:flags.25?true stargift_drop_original_details:flags.26?true id:string amount:StarsAmount date:int peer:StarsTransactionPeer title:flags.0?string description:flags.1?string photo:flags.2?WebDocument transaction_date:flags.5?int transaction_url:flags.5?string bot_payload:flags.7?bytes msg_id:flags.8?int extended_media:flags.9?Vector subscription_period:flags.12?int giveaway_post_id:flags.13?int stargift:flags.14?StarGift floodskip_number:flags.15?int starref_commission_permille:flags.16?int starref_peer:flags.17?Peer starref_amount:flags.17?StarsAmount paid_messages:flags.19?int premium_gift_months:flags.20?int ads_proceeds_from_date:flags.23?int ads_proceeds_to_date:flags.23?int = StarsTransaction; payments.starsStatus#6c9ce8ed flags:# balance:StarsAmount subscriptions:flags.1?Vector subscriptions_next_offset:flags.2?string subscriptions_missing_balance:flags.4?long history:flags.3?Vector next_offset:flags.0?string chats:Vector users:Vector = payments.StarsStatus; @@ -1892,8 +1906,8 @@ starsGiveawayOption#94ce852a flags:# extended:flags.0?true default:flags.1?true starsGiveawayWinnersOption#54236209 flags:# default:flags.0?true users:int per_user_stars:long = StarsGiveawayWinnersOption; -starGift#80ac53c3 flags:# limited:flags.0?true sold_out:flags.1?true birthday:flags.2?true require_premium:flags.7?true limited_per_user:flags.8?true id:long sticker:Document stars:long availability_remains:flags.0?int availability_total:flags.0?int availability_resale:flags.4?long convert_stars:long first_sale_date:flags.1?int last_sale_date:flags.1?int upgrade_stars:flags.3?long resell_min_stars:flags.4?long title:flags.5?string released_by:flags.6?Peer per_user_total:flags.8?int per_user_remains:flags.8?int locked_until_date:flags.9?int = StarGift; -starGiftUnique#26a5553e flags:# require_premium:flags.6?true resale_ton_only:flags.7?true id:long gift_id:long title:string slug:string num:int owner_id:flags.0?Peer owner_name:flags.1?string owner_address:flags.2?string attributes:Vector availability_issued:int availability_total:int gift_address:flags.3?string resell_amount:flags.4?Vector released_by:flags.5?Peer value_amount:flags.8?long value_currency:flags.8?string = StarGift; +starGift#80ac53c3 flags:# limited:flags.0?true sold_out:flags.1?true birthday:flags.2?true require_premium:flags.7?true limited_per_user:flags.8?true peer_color_available:flags.10?true id:long sticker:Document stars:long availability_remains:flags.0?int availability_total:flags.0?int availability_resale:flags.4?long convert_stars:long first_sale_date:flags.1?int last_sale_date:flags.1?int upgrade_stars:flags.3?long resell_min_stars:flags.4?long title:flags.5?string released_by:flags.6?Peer per_user_total:flags.8?int per_user_remains:flags.8?int locked_until_date:flags.9?int = StarGift; +starGiftUnique#b0bf741b flags:# require_premium:flags.6?true resale_ton_only:flags.7?true theme_available:flags.9?true id:long gift_id:long title:string slug:string num:int owner_id:flags.0?Peer owner_name:flags.1?string owner_address:flags.2?string attributes:Vector availability_issued:int availability_total:int gift_address:flags.3?string resell_amount:flags.4?Vector released_by:flags.5?Peer value_amount:flags.8?long value_currency:flags.8?string theme_peer:flags.10?Peer peer_color:flags.11?PeerColor host_id:flags.12?Peer = StarGift; payments.starGiftsNotModified#a388a368 = payments.StarGifts; payments.starGifts#2ed82995 hash:int gifts:Vector chats:Vector users:Vector = payments.StarGifts; @@ -1933,7 +1947,7 @@ starGiftAttributePattern#13acff19 name:string document:Document rarity_permille: starGiftAttributeBackdrop#d93d859c name:string backdrop_id:int center_color:int edge_color:int pattern_color:int text_color:int rarity_permille:int = StarGiftAttribute; starGiftAttributeOriginalDetails#e0bff26c flags:# sender_id:flags.0?Peer recipient_id:Peer date:int message:flags.1?TextWithEntities = StarGiftAttribute; -payments.starGiftUpgradePreview#167bd90b sample_attributes:Vector = payments.StarGiftUpgradePreview; +payments.starGiftUpgradePreview#3de1dfed sample_attributes:Vector prices:Vector next_prices:Vector = payments.StarGiftUpgradePreview; users.users#62d706b8 users:Vector = users.Users; users.usersSlice#315a4974 count:int users:Vector = users.Users; @@ -1942,7 +1956,7 @@ payments.uniqueStarGift#416c56e8 gift:StarGift chats:Vector users:Vector users:Vector = messages.WebPagePreview; -savedStarGift#19a9b572 flags:# name_hidden:flags.0?true unsaved:flags.5?true refunded:flags.9?true can_upgrade:flags.10?true pinned_to_top:flags.12?true upgrade_separate:flags.17?true from_id:flags.1?Peer date:int gift:StarGift message:flags.2?TextWithEntities msg_id:flags.3?int saved_id:flags.11?long convert_stars:flags.4?long upgrade_stars:flags.6?long can_export_at:flags.7?int transfer_stars:flags.8?long can_transfer_at:flags.13?int can_resell_at:flags.14?int collection_id:flags.15?Vector prepaid_upgrade_hash:flags.16?string = SavedStarGift; +savedStarGift#8983a452 flags:# name_hidden:flags.0?true unsaved:flags.5?true refunded:flags.9?true can_upgrade:flags.10?true pinned_to_top:flags.12?true upgrade_separate:flags.17?true from_id:flags.1?Peer date:int gift:StarGift message:flags.2?TextWithEntities msg_id:flags.3?int saved_id:flags.11?long convert_stars:flags.4?long upgrade_stars:flags.6?long can_export_at:flags.7?int transfer_stars:flags.8?long can_transfer_at:flags.13?int can_resell_at:flags.14?int collection_id:flags.15?Vector prepaid_upgrade_hash:flags.16?string drop_original_details_stars:flags.18?long = SavedStarGift; payments.savedStarGifts#95f389b1 flags:# count:int chat_notifications_enabled:flags.1?Bool gifts:Vector next_offset:flags.0?string chats:Vector users:Vector = payments.SavedStarGifts; @@ -2025,6 +2039,12 @@ account.savedMusicIds#998d6636 ids:Vector = account.SavedMusicIds; payments.checkCanSendGiftResultOk#374fa7ad = payments.CheckCanSendGiftResult; payments.checkCanSendGiftResultFail#d5e58274 reason:TextWithEntities = payments.CheckCanSendGiftResult; +inputChatThemeEmpty#83268483 = InputChatTheme; +inputChatTheme#c93de95c emoticon:string = InputChatTheme; +inputChatThemeUniqueGift#87e5dfe4 slug:string = InputChatTheme; + +starGiftUpgradePrice#99ea331d date:int upgrade_stars:long = StarGiftUpgradePrice; + ---functions--- invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X; @@ -2062,6 +2082,7 @@ auth.importWebTokenAuthorization#2db873a9 api_id:int api_hash:string web_auth_to auth.requestFirebaseSms#8e39261e flags:# phone_number:string phone_code_hash:string safety_net_token:flags.0?string play_integrity_token:flags.2?string ios_push_secret:flags.1?string = Bool; auth.resetLoginEmail#7e960193 phone_number:string phone_code_hash:string = auth.SentCode; auth.reportMissingCode#cb9deff6 phone_number:string phone_code_hash:string mnc:string = Bool; +auth.checkPaidAuth#56e59f9c phone_number:string phone_code_hash:string form_id:long = auth.SentCode; account.registerDevice#ec86017a flags:# no_muted:flags.0?true token_type:int token:string app_sandbox:Bool secret:bytes other_uids:Vector = Bool; account.unregisterDevice#6a0d3206 token_type:int token:string other_uids:Vector = Bool; @@ -2151,7 +2172,7 @@ account.getAutoSaveSettings#adcbbcda = account.AutoSaveSettings; account.saveAutoSaveSettings#d69b8361 flags:# users:flags.0?true chats:flags.1?true broadcasts:flags.2?true peer:flags.3?InputPeer settings:AutoSaveSettings = Bool; account.deleteAutoSaveExceptions#53bc0020 = Bool; account.invalidateSignInCodes#ca8ae8ba codes:Vector = Bool; -account.updateColor#7cefa15d flags:# for_profile:flags.1?true color:flags.2?int background_emoji_id:flags.0?long = Bool; +account.updateColor#684d214e flags:# for_profile:flags.1?true color:flags.2?PeerColor = Bool; account.getDefaultBackgroundEmojis#a60ab9ce hash:long = EmojiList; account.getChannelDefaultEmojiStatuses#7727a7d5 hash:long = account.EmojiStatuses; account.getChannelRestrictedStatusEmojis#35a9e0d5 hash:long = EmojiList; @@ -2181,6 +2202,7 @@ account.toggleNoPaidMessagesException#fe2eda76 flags:# refund_charged:flags.0?tr account.setMainProfileTab#5dee78b0 tab:ProfileTab = Bool; account.saveMusic#b26732a9 flags:# unsave:flags.0?true id:InputDocument after_id:flags.1?InputDocument = Bool; account.getSavedMusicIds#e09d5faf hash:long = account.SavedMusicIds; +account.getUniqueGiftChatThemes#e42ce9c9 offset:string limit:int hash:long = account.ChatThemes; users.getUsers#d91a548 id:Vector = Vector; users.getFullUser#b60f5918 id:InputUser = users.UserFull; @@ -2188,6 +2210,7 @@ users.setSecureValueErrors#90c894b5 id:InputUser errors:Vector users.getRequirementsToContact#d89a83a3 id:Vector = Vector; users.getSavedMusic#788d7fe3 id:InputUser offset:int limit:int hash:long = users.SavedMusic; users.getSavedMusicByID#7573a4e9 id:InputUser documents:Vector = users.SavedMusic; +users.suggestBirthday#fc533372 id:InputUser birthday:Birthday = Updates; contacts.getContactIDs#7adc669d hash:long = Vector; contacts.getStatuses#c4a353ee = Vector; @@ -2205,7 +2228,7 @@ contacts.resetTopPeerRating#1ae373ac category:TopPeerCategory peer:InputPeer = B contacts.resetSaved#879537f1 = Bool; contacts.getSaved#82f1e39f = Vector; contacts.toggleTopPeers#8514bdda enabled:Bool = Bool; -contacts.addContact#e8f463d0 flags:# add_phone_privacy_exception:flags.0?true id:InputUser first_name:string last_name:string phone:string = Updates; +contacts.addContact#d9ba2e54 flags:# add_phone_privacy_exception:flags.0?true id:InputUser first_name:string last_name:string phone:string note:flags.1?TextWithEntities = Updates; contacts.acceptContact#f831a20f id:InputUser = Updates; contacts.getLocated#d348bc44 flags:# background:flags.1?true geo_point:InputGeoPoint self_expires:flags.0?int = Updates; contacts.blockFromReplies#29a8962c flags:# delete_message:flags.0?true delete_history:flags.1?true report_spam:flags.2?true msg_id:int = Updates; @@ -2216,6 +2239,7 @@ contacts.editCloseFriends#ba6705f0 id:Vector = Bool; contacts.setBlocked#94c65c76 flags:# my_stories_from:flags.0?true id:Vector limit:int = Bool; contacts.getBirthdays#daeda864 = contacts.ContactBirthdays; contacts.getSponsoredPeers#b6c8c393 q:string = contacts.SponsoredPeers; +contacts.updateContactNote#139f63fb id:InputUser note:TextWithEntities = Bool; messages.getMessages#63c66506 id:Vector = messages.Messages; messages.getDialogs#a0f4cb4f flags:# exclude_pinned:flags.0?true folder_id:flags.1?int offset_date:int offset_id:int offset_peer:InputPeer limit:int hash:long = messages.Dialogs; @@ -2357,7 +2381,7 @@ messages.getAdminsWithInvites#3920e6ef peer:InputPeer = messages.ChatAdminsWithI messages.getChatInviteImporters#df04dd4e flags:# requested:flags.0?true subscription_expired:flags.3?true peer:InputPeer link:flags.1?string q:flags.2?string offset_date:int offset_user:InputUser limit:int = messages.ChatInviteImporters; messages.setHistoryTTL#b80e5fe4 peer:InputPeer period:int = Updates; messages.checkHistoryImportPeer#5dc60f03 peer:InputPeer = messages.CheckedHistoryImportPeer; -messages.setChatTheme#e63be13f peer:InputPeer emoticon:string = Updates; +messages.setChatTheme#81202c9 peer:InputPeer theme:InputChatTheme = Updates; messages.getMessageReadParticipants#31c1c44f peer:InputPeer msg_id:int = Vector; messages.getSearchResultsCalendar#6aa3f6bd flags:# peer:InputPeer saved_peer_id:flags.2?InputPeer filter:MessagesFilter offset_id:int offset_date:int = messages.SearchResultsCalendar; messages.getSearchResultsPositions#9c7f2f10 flags:# peer:InputPeer saved_peer_id:flags.2?InputPeer filter:MessagesFilter offset_id:int limit:int = messages.SearchResultsPositions; @@ -2447,6 +2471,13 @@ messages.readSavedHistory#ba4a3b5b parent_peer:InputPeer peer:InputPeer max_id:i messages.toggleTodoCompleted#d3e03124 peer:InputPeer msg_id:int completed:Vector incompleted:Vector = Updates; messages.appendTodoList#21a61057 peer:InputPeer msg_id:int list:Vector = Updates; messages.toggleSuggestedPostApproval#8107455c flags:# reject:flags.1?true peer:InputPeer msg_id:int schedule_date:flags.0?int reject_comment:flags.2?string = Updates; +messages.getForumTopics#3ba47bff flags:# peer:InputPeer q:flags.0?string offset_date:int offset_id:int offset_topic:int limit:int = messages.ForumTopics; +messages.getForumTopicsByID#af0a4a08 peer:InputPeer topics:Vector = messages.ForumTopics; +messages.editForumTopic#cecc1134 flags:# peer:InputPeer topic_id:int title:flags.0?string icon_emoji_id:flags.1?long closed:flags.2?Bool hidden:flags.3?Bool = Updates; +messages.updatePinnedForumTopic#175df251 peer:InputPeer topic_id:int pinned:Bool = Updates; +messages.reorderPinnedForumTopics#e7841f0 flags:# force:flags.0?true peer:InputPeer order:Vector = Updates; +messages.createForumTopic#2f98c3d5 flags:# title_missing:flags.4?true peer:InputPeer title:string icon_color:flags.0?int icon_emoji_id:flags.3?long random_id:long send_as:flags.2?InputPeer = Updates; +messages.deleteTopicHistory#d2816f10 peer:InputPeer top_msg_id:int = messages.AffectedHistory; updates.getState#edd4882a = updates.State; updates.getDifference#19c2f763 flags:# pts:int pts_limit:flags.1?int pts_total_limit:flags.0?int date:int qts:int qts_limit:flags.2?int = updates.Difference; @@ -2536,13 +2567,6 @@ channels.reorderUsernames#b45ced1d channel:InputChannel order:Vector = B channels.toggleUsername#50f24105 channel:InputChannel username:string active:Bool = Bool; channels.deactivateAllUsernames#a245dd3 channel:InputChannel = Bool; channels.toggleForum#3ff75734 channel:InputChannel enabled:Bool tabs:Bool = Updates; -channels.createForumTopic#f40c0224 flags:# channel:InputChannel title:string icon_color:flags.0?int icon_emoji_id:flags.3?long random_id:long send_as:flags.2?InputPeer = Updates; -channels.getForumTopics#de560d1 flags:# channel:InputChannel q:flags.0?string offset_date:int offset_id:int offset_topic:int limit:int = messages.ForumTopics; -channels.getForumTopicsByID#b0831eb9 channel:InputChannel topics:Vector = messages.ForumTopics; -channels.editForumTopic#f4dfa185 flags:# channel:InputChannel topic_id:int title:flags.0?string icon_emoji_id:flags.1?long closed:flags.2?Bool hidden:flags.3?Bool = Updates; -channels.updatePinnedForumTopic#6c2d9026 channel:InputChannel topic_id:int pinned:Bool = Updates; -channels.deleteTopicHistory#34435f2d channel:InputChannel top_msg_id:int = messages.AffectedHistory; -channels.reorderPinnedForumTopics#2950a18f flags:# force:flags.0?true channel:InputChannel order:Vector = Updates; channels.toggleAntiSpam#68f3e4eb channel:InputChannel enabled:Bool = Updates; channels.reportAntiSpamFalsePositive#a850a693 channel:InputChannel msg_id:int = Bool; channels.toggleParticipantsHidden#6a6e7854 channel:InputChannel enabled:Bool = Updates; @@ -2633,7 +2657,7 @@ payments.getStarGiftUpgradePreview#9c9abcb1 gift_id:long = payments.StarGiftUpgr payments.upgradeStarGift#aed6e4f5 flags:# keep_original_details:flags.0?true stargift:InputSavedStarGift = Updates; payments.transferStarGift#7f18176a stargift:InputSavedStarGift to_id:InputPeer = Updates; payments.getUniqueStarGift#a1974d72 slug:string = payments.UniqueStarGift; -payments.getSavedStarGifts#a319e569 flags:# exclude_unsaved:flags.0?true exclude_saved:flags.1?true exclude_unlimited:flags.2?true exclude_unique:flags.4?true sort_by_value:flags.5?true exclude_upgradable:flags.7?true exclude_unupgradable:flags.8?true peer:InputPeer collection_id:flags.6?int offset:string limit:int = payments.SavedStarGifts; +payments.getSavedStarGifts#a319e569 flags:# exclude_unsaved:flags.0?true exclude_saved:flags.1?true exclude_unlimited:flags.2?true exclude_unique:flags.4?true sort_by_value:flags.5?true exclude_upgradable:flags.7?true exclude_unupgradable:flags.8?true peer_color_available:flags.9?true exclude_hosted:flags.10?true peer:InputPeer collection_id:flags.6?int offset:string limit:int = payments.SavedStarGifts; payments.getSavedStarGift#b455a106 stargift:Vector = payments.SavedStarGifts; payments.getStarGiftWithdrawalUrl#d06e93a8 stargift:InputSavedStarGift password:InputCheckPasswordSRP = payments.StarGiftWithdrawalUrl; payments.toggleChatStarGiftNotifications#60eaefa1 flags:# enabled:flags.0?true peer:InputPeer = Bool; @@ -2675,7 +2699,7 @@ phone.joinGroupCall#8fb53057 flags:# muted:flags.0?true video_stopped:flags.2?tr phone.leaveGroupCall#500377f9 call:InputGroupCall source:int = Updates; phone.inviteToGroupCall#7b393160 call:InputGroupCall users:Vector = Updates; phone.discardGroupCall#7a777135 call:InputGroupCall = Updates; -phone.toggleGroupCallSettings#74bbb43d flags:# reset_invite_hash:flags.1?true call:InputGroupCall join_muted:flags.0?Bool = Updates; +phone.toggleGroupCallSettings#e9723804 flags:# reset_invite_hash:flags.1?true call:InputGroupCall join_muted:flags.0?Bool messages_enabled:flags.2?Bool = Updates; phone.getGroupCall#41845db call:InputGroupCall limit:int = phone.GroupCall; phone.getGroupParticipants#c558d8ab call:InputGroupCall ids:Vector sources:Vector offset:string limit:int = phone.GroupParticipants; phone.checkGroupCall#b59cf977 call:InputGroupCall sources:Vector = Vector; @@ -2698,6 +2722,8 @@ phone.sendConferenceCallBroadcast#c6701900 call:InputGroupCall block:bytes = Upd phone.inviteConferenceCallParticipant#bcf22685 flags:# video:flags.0?true call:InputGroupCall user_id:InputUser = Updates; phone.declineConferenceCallInvite#3c479971 msg_id:int = Updates; phone.getGroupCallChainBlocks#ee9f88a6 call:InputGroupCall sub_chain_id:int offset:int limit:int = Updates; +phone.sendGroupCallMessage#87893014 call:InputGroupCall random_id:long message:TextWithEntities = Bool; +phone.sendGroupCallEncryptedMessage#e5afa56d call:InputGroupCall encrypted_message:bytes = Bool; langpack.getLangPack#f2f2330a lang_pack:string lang_code:string = LangPackDifference; langpack.getStrings#efea3803 lang_pack:string lang_code:string keys:Vector = Vector; diff --git a/src/styles/_mixins.scss b/src/styles/_mixins.scss index 898384871..d7bbe8426 100644 --- a/src/styles/_mixins.scss +++ b/src/styles/_mixins.scss @@ -138,6 +138,7 @@ transition: transform var(--slide-transition); &::before { + pointer-events: none; content: ""; position: absolute; diff --git a/src/util/theme.ts b/src/util/theme.ts index adab1f7cf..ba23daa7d 100644 --- a/src/util/theme.ts +++ b/src/util/theme.ts @@ -79,28 +79,34 @@ function setPeerColor(n: string, colors: string[], darkColors?: string[]) { const mainDarkColor = darkColors?.[0]; if (!mainLightColor) return; - const lightBgColor = `${mainLightColor}${PEER_COLOR_BG_OPACITY}`; - const darkBgColor = mainDarkColor ? `${mainDarkColor}${PEER_COLOR_BG_OPACITY}` : undefined; - - const lightBgActiveColor = `${mainLightColor}${PEER_COLOR_BG_ACTIVE_OPACITY}`; - const darkBgActiveColor = mainDarkColor ? `${mainDarkColor}${PEER_COLOR_BG_ACTIVE_OPACITY}` : undefined; + const { bg: lightBgColor, bgActive: lightBgActiveColor } = generateColorVariations(mainLightColor); + const { bg: darkBgColor, bgActive: darkBgActiveColor } = mainDarkColor + ? generateColorVariations(mainDarkColor) : { bg: undefined, bgActive: undefined }; setVariable(`color-peer-${n}`, mainLightColor, mainDarkColor); setVariable(`color-peer-bg-${n}`, lightBgColor, darkBgColor); setVariable(`color-peer-bg-active-${n}`, lightBgActiveColor, darkBgActiveColor); if (colors.length > 1) { - const lightGradientColors = colors.map((color, i) => ( - `${color} ${i * PEER_COLOR_GRADIENT_STEP}px, ${color} ${(i + 1) * PEER_COLOR_GRADIENT_STEP}px` - )); - const darkGradientColors = darkColors?.map((color, i) => ( - `${color} ${i * PEER_COLOR_GRADIENT_STEP}px, ${color} ${(i + 1) * PEER_COLOR_GRADIENT_STEP}px` - )); - - const lightGradient = `repeating-linear-gradient(-45deg, ${lightGradientColors.join(', ')})`; - const darkGradient = darkGradientColors - ? `repeating-linear-gradient(-45deg, ${darkGradientColors.join(', ')})` - : undefined; + const lightGradient = generatePeerColorGradient(colors); + const darkGradient = darkColors ? generatePeerColorGradient(darkColors) : undefined; setVariable(`color-peer-gradient-${n}`, lightGradient, darkGradient); } } + +export function generateColorVariations(baseColor: string) { + return { + bg: `${baseColor}${PEER_COLOR_BG_OPACITY}`, + bgActive: `${baseColor}${PEER_COLOR_BG_ACTIVE_OPACITY}`, + }; +} + +export function generatePeerColorGradient(colors: string[]) { + if (colors.length === 1) return colors[0]; + + const gradientColors = colors.map((color, i) => ( + `${color} ${i * PEER_COLOR_GRADIENT_STEP}px, ${color} ${(i + 1) * PEER_COLOR_GRADIENT_STEP}px` + )); + + return `repeating-linear-gradient(-45deg, ${gradientColors.join(', ')})`; +}