diff --git a/src/api/gramjs/apiBuilders/users.ts b/src/api/gramjs/apiBuilders/users.ts index ecd992ecb..623a08a6d 100644 --- a/src/api/gramjs/apiBuilders/users.ts +++ b/src/api/gramjs/apiBuilders/users.ts @@ -3,9 +3,8 @@ import { ApiUser, ApiUserStatus, ApiUserType } from '../../types'; export function buildApiUserFromFull(mtpUserFull: GramJs.UserFull): ApiUser { const { - about, commonChatsCount, pinnedMsgId, botInfo, notifySettings: { silent, muteUntil }, + about, commonChatsCount, pinnedMsgId, botInfo, } = mtpUserFull; - const isMuted = silent || (typeof muteUntil === 'number' && Date.now() < muteUntil * 1000); return { ...(buildApiUser(mtpUserFull.user) as ApiUser), @@ -13,7 +12,6 @@ export function buildApiUserFromFull(mtpUserFull: GramJs.UserFull): ApiUser { bio: about, commonChatsCount, pinnedMessageId: pinnedMsgId, - isMuted, ...(botInfo && { botDescription: botInfo.description }), }, }; diff --git a/src/api/gramjs/methods/index.ts b/src/api/gramjs/methods/index.ts index 9456c7e0d..3a08b2d74 100644 --- a/src/api/gramjs/methods/index.ts +++ b/src/api/gramjs/methods/index.ts @@ -45,7 +45,7 @@ export { updateProfile, checkUsername, updateUsername, fetchBlockedContacts, blockContact, unblockContact, updateProfilePhoto, uploadProfilePhoto, fetchWallpapers, uploadWallpaper, fetchAuthorizations, terminateAuthorization, terminateAllAuthorizations, - loadNotificationsSettings, updateContactSignUpNotification, updateNotificationSettings, + fetchNotificationExceptions, fetchNotificationSettings, updateContactSignUpNotification, updateNotificationSettings, fetchLanguages, fetchLangPack, fetchPrivacySettings, setPrivacySettings, registerDevice, unregisterDevice, } from './settings'; diff --git a/src/api/gramjs/methods/settings.ts b/src/api/gramjs/methods/settings.ts index 699564c4d..932a88b87 100644 --- a/src/api/gramjs/methods/settings.ts +++ b/src/api/gramjs/methods/settings.ts @@ -156,7 +156,15 @@ export function terminateAllAuthorizations() { return invokeRequest(new GramJs.auth.ResetAuthorizations()); } -export async function loadNotificationsSettings() { +export async function fetchNotificationExceptions() { + const result = await invokeRequest(new GramJs.account.GetNotifyExceptions({ compareSound: true }), true); + + if (result instanceof GramJs.Updates || result instanceof GramJs.UpdatesCombined) { + updateLocalDb(result); + } +} + +export async function fetchNotificationSettings() { const [ isMutedContactSignUpNotification, privateContactNotificationsSettings, @@ -212,10 +220,10 @@ export function updateContactSignUpNotification(isSilent: boolean) { export function updateNotificationSettings(peerType: 'contact' | 'group' | 'broadcast', { isSilent, - isShowPreviews, + shouldShowPreviews, }: { isSilent: boolean; - isShowPreviews: boolean; + shouldShowPreviews: boolean; }) { let peer: GramJs.TypeInputNotifyPeer; if (peerType === 'contact') { @@ -227,7 +235,7 @@ export function updateNotificationSettings(peerType: 'contact' | 'group' | 'broa } const settings = { - showPreviews: isShowPreviews, + showPreviews: shouldShowPreviews, silent: isSilent, muteUntil: isSilent ? MAX_INT_32 : undefined, }; @@ -358,7 +366,10 @@ export async function setPrivacySettings( return buildPrivacyRules(result.rules); } -function updateLocalDb(result: GramJs.account.PrivacyRules | GramJs.contacts.Blocked | GramJs.contacts.BlockedSlice) { +function updateLocalDb( + result: GramJs.account.PrivacyRules | GramJs.contacts.Blocked | GramJs.contacts.BlockedSlice | + GramJs.Updates | GramJs.UpdatesCombined, +) { result.users.forEach((user) => { if (user instanceof GramJs.User) { localDb.users[user.id] = user; diff --git a/src/api/gramjs/updater.ts b/src/api/gramjs/updater.ts index a1fcd6d36..9a60610cc 100644 --- a/src/api/gramjs/updater.ts +++ b/src/api/gramjs/updater.ts @@ -544,14 +544,18 @@ export function updater(update: Update, originRequest?: GramJs.AnyRequest) { update instanceof GramJs.UpdateNotifySettings && update.peer instanceof GramJs.NotifyPeer ) { - const { silent, muteUntil } = update.notifySettings; + const { + silent, muteUntil, showPreviews, sound, + } = update.notifySettings; + + const isMuted = silent || (typeof muteUntil === 'number' && Date.now() < muteUntil * 1000); onUpdate({ - '@type': 'updateChat', + '@type': 'updateNotifyExceptions', id: getApiChatIdFromMtpPeer(update.peer.peer), - chat: { - isMuted: silent || (typeof muteUntil === 'number' && Date.now() < muteUntil * 1000), - }, + isMuted, + ...(sound === '' && { isSilent: true }), + ...(showPreviews !== undefined && { shouldShowPreviews: Boolean(showPreviews) }), }); } else if ( update instanceof GramJs.UpdateUserTyping @@ -741,7 +745,7 @@ export function updater(update: Update, originRequest?: GramJs.AnyRequest) { '@type': 'updateNotifySettings', peerType, isSilent: Boolean(silent || (typeof muteUntil === 'number' && Date.now() < muteUntil * 1000)), - isShowPreviews: Boolean(showPreviews), + shouldShowPreviews: Boolean(showPreviews), }); } else if (update instanceof GramJs.UpdatePeerBlocked) { onUpdate({ diff --git a/src/api/types/updates.ts b/src/api/types/updates.ts index a223308f8..b1b60432e 100644 --- a/src/api/types/updates.ts +++ b/src/api/types/updates.ts @@ -327,7 +327,15 @@ export type ApiUpdateNotifySettings = { '@type': 'updateNotifySettings'; peerType: 'contact' | 'group' | 'broadcast'; isSilent: boolean; - isShowPreviews: boolean; + shouldShowPreviews: boolean; +}; + +export type ApiUpdateNotifyExceptions = { + '@type': 'updateNotifyExceptions'; + id: number; + isMuted: boolean; + isSilent?: boolean; + shouldShowPreviews?: boolean; }; export type updateTwoFaStateWaitCode = { @@ -369,7 +377,7 @@ export type ApiUpdate = ( ApiUpdateNewScheduledMessage | ApiUpdateScheduledMessageSendSucceeded | ApiUpdateScheduledMessage | ApiUpdateDeleteScheduledMessages | ApiUpdateResetMessages | ApiUpdateTwoFaError | updateTwoFaStateWaitCode | - ApiUpdateNotifySettings | ApiUpdatePeerBlocked | ApiUpdatePrivacy + ApiUpdateNotifySettings | ApiUpdateNotifyExceptions | ApiUpdatePeerBlocked | ApiUpdatePrivacy ); export type OnApiUpdate = (update: ApiUpdate) => void; diff --git a/src/api/types/users.ts b/src/api/types/users.ts index e96ad2aed..223722715 100644 --- a/src/api/types/users.ts +++ b/src/api/types/users.ts @@ -25,7 +25,6 @@ export interface ApiUserFullInfo { commonChatsCount?: number; botDescription?: string; pinnedMessageId?: number; - isMuted?: boolean; } export type ApiUserType = 'userTypeBot' | 'userTypeRegular' | 'userTypeDeleted' | 'userTypeUnknown'; diff --git a/src/components/left/main/Badge.tsx b/src/components/left/main/Badge.tsx index db0301df7..a14104d05 100644 --- a/src/components/left/main/Badge.tsx +++ b/src/components/left/main/Badge.tsx @@ -12,13 +12,14 @@ import './Badge.scss'; type OwnProps = { chat: ApiChat; isPinned?: boolean; + isMuted?: boolean; }; -const Badge: FC = ({ chat, isPinned }) => { +const Badge: FC = ({ chat, isPinned, isMuted }) => { const isShown = Boolean(chat.unreadCount || chat.hasUnreadMark || isPinned); const className = buildClassName( 'Badge', - chat.isMuted && 'muted', + isMuted && 'muted', isPinned && 'pinned', Boolean(chat.unreadCount || chat.hasUnreadMark) && 'unread', ); diff --git a/src/components/left/main/Chat.tsx b/src/components/left/main/Chat.tsx index b4b978c7c..6a3df2a42 100644 --- a/src/components/left/main/Chat.tsx +++ b/src/components/left/main/Chat.tsx @@ -25,9 +25,11 @@ import { getMessageMediaThumbDataUri, getMessageVideo, getMessageSticker, + selectIsChatMuted, } from '../../../modules/helpers'; import { selectChat, selectUser, selectChatMessage, selectOutgoingStatus, selectDraft, selectCurrentMessageList, + selectNotifySettings, selectNotifyExceptions, } from '../../../modules/selectors'; import { renderActionMessageText } from '../../common/helpers/renderActionMessageText'; import renderText from '../../common/helpers/renderText'; @@ -62,6 +64,7 @@ type OwnProps = { type StateProps = { chat?: ApiChat; + isMuted?: boolean; privateChatUser?: ApiUser; actionTargetUser?: ApiUser; actionTargetMessage?: ApiMessage; @@ -87,6 +90,7 @@ const Chat: FC = ({ isSelected, isPinned, chat, + isMuted, privateChatUser, actionTargetUser, lastMessageSender, @@ -255,14 +259,14 @@ const Chat: FC = ({

{renderText(getChatTitle(chat, privateChatUser))}

{chat.isVerified && } - {chat.isMuted && } + {isMuted && } {chat.lastMessage && ( )}
{renderLastMessageOrTyping()} - +
( return { chat, + isMuted: selectIsChatMuted(chat, selectNotifySettings(global), selectNotifyExceptions(global)), lastMessageSender, ...(isOutgoing && { lastMessageOutgoingStatus: selectOutgoingStatus(global, chat.lastMessage) }), ...(privateChatUserId && { privateChatUser: selectUser(global, privateChatUserId) }), diff --git a/src/components/left/main/ChatFolders.tsx b/src/components/left/main/ChatFolders.tsx index df59ccffe..28dcd6023 100644 --- a/src/components/left/main/ChatFolders.tsx +++ b/src/components/left/main/ChatFolders.tsx @@ -5,11 +5,13 @@ import { withGlobal } from '../../../lib/teact/teactn'; import { ApiChat, ApiChatFolder, ApiUser } from '../../../api/types'; import { GlobalActions } from '../../../global/types'; +import { NotifyException, NotifySettings } from '../../../types'; import { IS_TOUCH_ENV } from '../../../util/environment'; import { buildCollectionByKey, pick } from '../../../util/iteratees'; import { captureEvents, SwipeDirection } from '../../../util/captureEvents'; import { getFolderUnreadDialogs } from '../../../modules/helpers'; +import { selectNotifyExceptions, selectNotifySettings } from '../../../modules/selectors'; import useShowTransition from '../../../hooks/useShowTransition'; import buildClassName from '../../../util/buildClassName'; import useThrottledMemo from '../../../hooks/useThrottledMemo'; @@ -24,6 +26,8 @@ type StateProps = { chatsById: Record; usersById: Record; chatFoldersById: Record; + notifySettings: NotifySettings; + notifyExceptions: Record; orderedFolderIds?: number[]; lastSyncTime?: number; }; @@ -36,6 +40,8 @@ const ChatFolders: FC = ({ chatsById, usersById, chatFoldersById, + notifySettings, + notifyExceptions, orderedFolderIds, lastSyncTime, loadChatFolders, @@ -68,7 +74,7 @@ const ChatFolders: FC = ({ const counters = displayedFolders.map((folder) => { const { unreadDialogsCount, hasActiveDialogs, - } = getFolderUnreadDialogs(chatsById, usersById, folder, chatIds) || {}; + } = getFolderUnreadDialogs(chatsById, usersById, folder, notifySettings, notifyExceptions, chatIds) || {}; return { id: folder.id, @@ -78,7 +84,7 @@ const ChatFolders: FC = ({ }); return buildCollectionByKey(counters, 'id'); - }, INFO_THROTTLE, [displayedFolders, chatsById, usersById]); + }, INFO_THROTTLE, [displayedFolders, chatsById, usersById, notifySettings, notifyExceptions]); const folderTabs = useMemo(() => { if (!displayedFolders || !displayedFolders.length) { @@ -185,6 +191,8 @@ export default memo(withGlobal( chatFoldersById, orderedFolderIds, lastSyncTime, + notifySettings: selectNotifySettings(global), + notifyExceptions: selectNotifyExceptions(global), }; }, (setGlobal, actions): DispatchProps => pick(actions, ['loadChatFolders']), diff --git a/src/components/left/main/ChatList.tsx b/src/components/left/main/ChatList.tsx index 9baeef413..77e123513 100644 --- a/src/components/left/main/ChatList.tsx +++ b/src/components/left/main/ChatList.tsx @@ -7,13 +7,16 @@ import { GlobalActions } from '../../../global/types'; import { ApiChat, ApiChatFolder, ApiUser, MAIN_THREAD_ID, } from '../../../api/types'; +import { NotifyException, NotifySettings } from '../../../types'; import { ALL_CHATS_PRELOAD_DISABLED, CHAT_HEIGHT_PX, CHAT_LIST_SLICE } from '../../../config'; import { IS_ANDROID } from '../../../util/environment'; import usePrevious from '../../../hooks/usePrevious'; import { mapValues, pick } from '../../../util/iteratees'; import { getChatOrder, prepareChatList, prepareFolderListIds } from '../../../modules/helpers'; -import { selectChatFolder, selectCurrentMessageList } from '../../../modules/selectors'; +import { + selectChatFolder, selectCurrentMessageList, selectNotifyExceptions, selectNotifySettings, +} from '../../../modules/selectors'; import useInfiniteScroll from '../../../hooks/useInfiniteScroll'; import { useChatAnimationType } from './hooks'; @@ -36,6 +39,8 @@ type StateProps = { orderedPinnedIds?: number[]; lastSyncTime?: number; isInDiscussionThread?: boolean; + notifySettings: NotifySettings; + notifyExceptions: Record; }; type DispatchProps = Pick; @@ -57,14 +62,16 @@ const ChatList: FC = ({ orderedPinnedIds, lastSyncTime, isInDiscussionThread, + notifySettings, + notifyExceptions, loadMoreChats, preloadTopChatMessages, }) => { const [currentListIds, currentPinnedIds] = useMemo(() => { return folderType === 'folder' && chatFolder - ? prepareFolderListIds(chatsById, usersById, chatFolder) + ? prepareFolderListIds(chatsById, usersById, chatFolder, notifySettings, notifyExceptions) : [listIds, orderedPinnedIds]; - }, [folderType, chatsById, usersById, chatFolder, listIds, orderedPinnedIds]); + }, [folderType, chatFolder, chatsById, usersById, notifySettings, notifyExceptions, listIds, orderedPinnedIds]); const [orderById, orderedIds] = useMemo(() => { if (!currentListIds || (folderType === 'folder' && !chatFolder)) { @@ -202,6 +209,8 @@ export default memo(withGlobal( chatFolder, }), isInDiscussionThread: currentThreadId !== MAIN_THREAD_ID, + notifySettings: selectNotifySettings(global), + notifyExceptions: selectNotifyExceptions(global), }; }, (setGlobal, actions): DispatchProps => pick(actions, ['loadMoreChats', 'preloadTopChatMessages']), diff --git a/src/components/left/settings/SettingsNotifications.tsx b/src/components/left/settings/SettingsNotifications.tsx index cf8c4be6a..c2389e199 100644 --- a/src/components/left/settings/SettingsNotifications.tsx +++ b/src/components/left/settings/SettingsNotifications.tsx @@ -22,7 +22,7 @@ type StateProps = { }; type DispatchProps = Pick; const SettingsNotifications: FC = ({ @@ -33,13 +33,13 @@ const SettingsNotifications: FC = ({ hasBroadcastNotifications, hasBroadcastMessagePreview, hasContactJoinedNotifications, - loadNotificationsSettings, + loadNotificationSettings, updateContactSignUpNotification, updateNotificationSettings, }) => { useEffect(() => { - loadNotificationsSettings(); - }, [loadNotificationsSettings]); + loadNotificationSettings(); + }, [loadNotificationSettings]); const handleSettingsChange = useCallback(( e: ChangeEvent, @@ -49,14 +49,14 @@ const SettingsNotifications: FC = ({ const currentIsSilent = peerType === 'contact' ? !hasPrivateChatsNotifications : !(peerType === 'group' ? hasGroupNotifications : hasBroadcastNotifications); - const currentIsShowPreviews = peerType === 'contact' + const currentShouldShowPreviews = peerType === 'contact' ? hasPrivateChatsMessagePreview : (peerType === 'group' ? hasGroupMessagePreview : hasBroadcastMessagePreview); updateNotificationSettings({ peerType, - ...(setting === 'silent' && { isSilent: !e.target.checked, isShowPreviews: currentIsShowPreviews }), - ...(setting === 'showPreviews' && { isShowPreviews: e.target.checked, isSilent: currentIsSilent }), + ...(setting === 'silent' && { isSilent: !e.target.checked, shouldShowPreviews: currentShouldShowPreviews }), + ...(setting === 'showPreviews' && { shouldShowPreviews: e.target.checked, isSilent: currentIsSilent }), }); }, [ hasBroadcastMessagePreview, hasBroadcastNotifications, @@ -151,7 +151,7 @@ export default memo(withGlobal((global): StateProps => { }; }, (setGlobal, actions): DispatchProps => pick(actions, [ - 'loadNotificationsSettings', + 'loadNotificationSettings', 'updateContactSignUpNotification', 'updateNotificationSettings', ]))(SettingsNotifications)); diff --git a/src/components/left/settings/folders/SettingsFoldersMain.tsx b/src/components/left/settings/folders/SettingsFoldersMain.tsx index a3e926f0b..189563e42 100644 --- a/src/components/left/settings/folders/SettingsFoldersMain.tsx +++ b/src/components/left/settings/folders/SettingsFoldersMain.tsx @@ -5,9 +5,11 @@ import { withGlobal } from '../../../../lib/teact/teactn'; import { GlobalActions } from '../../../../global/types'; import { ApiChatFolder, ApiChat, ApiUser } from '../../../../api/types'; +import { NotifyException, NotifySettings } from '../../../../types'; import { STICKER_SIZE_FOLDER_SETTINGS } from '../../../../config'; import { pick } from '../../../../util/iteratees'; +import { selectNotifyExceptions, selectNotifySettings } from '../../../../modules/selectors'; import { throttle } from '../../../../util/schedulers'; import getAnimationData from '../../../common/helpers/animatedAssets'; import { getFolderDescriptionText } from '../../../../modules/helpers'; @@ -29,6 +31,8 @@ type StateProps = { orderedFolderIds?: number[]; foldersById: Record; recommendedChatFolders?: ApiChatFolder[]; + notifySettings: NotifySettings; + notifyExceptions: Record; }; type DispatchProps = Pick; @@ -45,6 +49,8 @@ const SettingsFoldersMain: FC = ({ orderedFolderIds, foldersById, recommendedChatFolders, + notifySettings, + notifyExceptions, loadRecommendedChatFolders, addChatFolder, showError, @@ -96,10 +102,12 @@ const SettingsFoldersMain: FC = ({ return { id: folder.id, title: folder.title, - subtitle: getFolderDescriptionText(chatsById, usersById, folder, chatIds, lang), + subtitle: getFolderDescriptionText( + chatsById, usersById, folder, notifySettings, notifyExceptions, chatIds, lang, + ), }; }); - }, [orderedFolderIds, chatsById, foldersById, usersById, lang]); + }, [orderedFolderIds, chatsById, foldersById, usersById, notifySettings, notifyExceptions, lang]); const handleCreateFolderFromRecommended = useCallback((folder: ApiChatFolder) => { if (Object.keys(foldersById).length >= MAX_ALLOWED_FOLDERS) { @@ -222,6 +230,8 @@ export default memo(withGlobal( orderedFolderIds, foldersById, recommendedChatFolders, + notifySettings: selectNotifySettings(global), + notifyExceptions: selectNotifyExceptions(global), }; }, (setGlobal, actions): DispatchProps => pick(actions, ['loadRecommendedChatFolders', 'addChatFolder', 'showError']), diff --git a/src/global/cache.ts b/src/global/cache.ts index c5b1449c0..89e44ab67 100644 --- a/src/global/cache.ts +++ b/src/global/cache.ts @@ -209,5 +209,6 @@ function reduceSettings(global: GlobalState): GlobalState['settings'] { return { byKey, privacy: {}, + notifyExceptions: {}, }; } diff --git a/src/global/initial.ts b/src/global/initial.ts index f6269c3a7..5b008dcc2 100644 --- a/src/global/initial.ts +++ b/src/global/initial.ts @@ -116,6 +116,7 @@ export const INITIAL_STATE: GlobalState = { language: 'en', }, privacy: {}, + notifyExceptions: {}, }, twoFaSettings: {}, diff --git a/src/global/types.ts b/src/global/types.ts index 8a462f05f..d38977f01 100644 --- a/src/global/types.ts +++ b/src/global/types.ts @@ -34,6 +34,7 @@ import { Receipt, ApiPrivacyKey, ApiPrivacySettings, + NotifyException, } from '../types'; export type MessageListType = 'thread' | 'pinned' | 'scheduled'; @@ -365,6 +366,7 @@ export type GlobalState = { byKey: ISettings; loadedWallpapers?: ApiWallpaper[]; privacy: Partial>; + notifyExceptions: Record; }; twoFaSettings: { @@ -434,8 +436,9 @@ export type ActionTypes = ( 'updatePassword' | 'updateRecoveryEmail' | 'clearPassword' | 'provideTwoFaEmailCode' | 'checkPassword' | 'loadBlockedContacts' | 'blockContact' | 'unblockContact' | 'loadAuthorizations' | 'terminateAuthorization' | 'terminateAllAuthorizations' | - 'loadNotificationsSettings' | 'updateContactSignUpNotification' | 'updateNotificationSettings' | + 'loadNotificationSettings' | 'updateContactSignUpNotification' | 'updateNotificationSettings' | 'loadLanguages' | 'loadPrivacySettings' | 'setPrivacyVisibility' | 'setPrivacySettings' | + 'loadNotificationExceptions' | // Stickers & GIFs 'loadStickerSets' | 'loadAddedStickers' | 'loadRecentStickers' | 'loadFavoriteStickers' | 'loadFeaturedStickers' | 'loadStickers' | 'setStickerSearchQuery' | 'loadSavedGifs' | 'setGifSearchQuery' | 'searchMoreGifs' | diff --git a/src/lib/gramjs/tl/api.d.ts b/src/lib/gramjs/tl/api.d.ts index 0b7563e8e..65c2d9cf7 100644 --- a/src/lib/gramjs/tl/api.d.ts +++ b/src/lib/gramjs/tl/api.d.ts @@ -520,22 +520,22 @@ namespace Api { }; export class InputMediaEmpty extends VirtualClass {}; export class InputMediaUploadedPhoto extends VirtualClass<{ - // flags: null; + // flags: undefined; file: Api.TypeInputFile; stickers?: Api.TypeInputDocument[]; ttlSeconds?: int; }> { - // flags: null; + // flags: undefined; file: Api.TypeInputFile; stickers?: Api.TypeInputDocument[]; ttlSeconds?: int; }; export class InputMediaPhoto extends VirtualClass<{ - // flags: null; + // flags: undefined; id: Api.TypeInputPhoto; ttlSeconds?: int; }> { - // flags: null; + // flags: undefined; id: Api.TypeInputPhoto; ttlSeconds?: int; }; @@ -556,7 +556,7 @@ namespace Api { vcard: string; }; export class InputMediaUploadedDocument extends VirtualClass<{ - // flags: null; + // flags: undefined; nosoundVideo?: true; forceFile?: true; file: Api.TypeInputFile; @@ -566,7 +566,7 @@ namespace Api { stickers?: Api.TypeInputDocument[]; ttlSeconds?: int; }> { - // flags: null; + // flags: undefined; nosoundVideo?: true; forceFile?: true; file: Api.TypeInputFile; @@ -577,12 +577,12 @@ namespace Api { ttlSeconds?: int; }; export class InputMediaDocument extends VirtualClass<{ - // flags: null; + // flags: undefined; id: Api.TypeInputDocument; ttlSeconds?: int; query?: string; }> { - // flags: null; + // flags: undefined; id: Api.TypeInputDocument; ttlSeconds?: int; query?: string; @@ -603,20 +603,20 @@ namespace Api { venueType: string; }; export class InputMediaPhotoExternal extends VirtualClass<{ - // flags: null; + // flags: undefined; url: string; ttlSeconds?: int; }> { - // flags: null; + // flags: undefined; url: string; ttlSeconds?: int; }; export class InputMediaDocumentExternal extends VirtualClass<{ - // flags: null; + // flags: undefined; url: string; ttlSeconds?: int; }> { - // flags: null; + // flags: undefined; url: string; ttlSeconds?: int; }; @@ -626,7 +626,7 @@ namespace Api { id: Api.TypeInputGame; }; export class InputMediaInvoice extends VirtualClass<{ - // flags: null; + // flags: undefined; multipleAllowed?: true; canForward?: true; title: string; @@ -638,7 +638,7 @@ namespace Api { providerData: Api.TypeDataJSON; startParam: string; }> { - // flags: null; + // flags: undefined; multipleAllowed?: true; canForward?: true; title: string; @@ -651,14 +651,14 @@ namespace Api { startParam: string; }; export class InputMediaGeoLive extends VirtualClass<{ - // flags: null; + // flags: undefined; stopped?: true; geoPoint: Api.TypeInputGeoPoint; heading?: int; period?: int; proximityNotificationRadius?: int; }> { - // flags: null; + // flags: undefined; stopped?: true; geoPoint: Api.TypeInputGeoPoint; heading?: int; @@ -666,13 +666,13 @@ namespace Api { proximityNotificationRadius?: int; }; export class InputMediaPoll extends VirtualClass<{ - // flags: null; + // flags: undefined; poll: Api.TypePoll; correctAnswers?: bytes[]; solution?: string; solutionEntities?: Api.TypeMessageEntity[]; }> { - // flags: null; + // flags: undefined; poll: Api.TypePoll; correctAnswers?: bytes[]; solution?: string; @@ -685,12 +685,12 @@ namespace Api { }; export class InputChatPhotoEmpty extends VirtualClass {}; export class InputChatUploadedPhoto extends VirtualClass<{ - // flags: null; + // flags: undefined; file?: Api.TypeInputFile; video?: Api.TypeInputFile; videoStartTs?: double; } | void> { - // flags: null; + // flags: undefined; file?: Api.TypeInputFile; video?: Api.TypeInputFile; videoStartTs?: double; @@ -702,12 +702,12 @@ namespace Api { }; export class InputGeoPointEmpty extends VirtualClass {}; export class InputGeoPoint extends VirtualClass<{ - // flags: null; + // flags: undefined; lat: double; long: double; accuracyRadius?: int; }> { - // flags: null; + // flags: undefined; lat: double; long: double; accuracyRadius?: int; @@ -786,12 +786,12 @@ namespace Api { secret: long; }; export class InputPeerPhotoFileLocation extends VirtualClass<{ - // flags: null; + // flags: undefined; big?: true; peer: Api.TypeInputPeer; photoId: long; }> { - // flags: null; + // flags: undefined; big?: true; peer: Api.TypeInputPeer; photoId: long; @@ -833,7 +833,7 @@ namespace Api { id: int; }; export class User extends VirtualClass<{ - // flags: null; + // flags: undefined; self?: true; contact?: true; mutualContact?: true; @@ -862,7 +862,7 @@ namespace Api { botInlinePlaceholder?: string; langCode?: string; }> { - // flags: null; + // flags: undefined; self?: true; contact?: true; mutualContact?: true; @@ -893,13 +893,13 @@ namespace Api { }; export class UserProfilePhotoEmpty extends VirtualClass {}; export class UserProfilePhoto extends VirtualClass<{ - // flags: null; + // flags: undefined; hasVideo?: true; photoId: long; strippedThumb?: bytes; dcId: int; }> { - // flags: null; + // flags: undefined; hasVideo?: true; photoId: long; strippedThumb?: bytes; @@ -925,7 +925,7 @@ namespace Api { id: int; }; export class Chat extends VirtualClass<{ - // flags: null; + // flags: undefined; creator?: true; kicked?: true; left?: true; @@ -942,7 +942,7 @@ namespace Api { adminRights?: Api.TypeChatAdminRights; defaultBannedRights?: Api.TypeChatBannedRights; }> { - // flags: null; + // flags: undefined; creator?: true; kicked?: true; left?: true; @@ -967,7 +967,7 @@ namespace Api { title: string; }; export class Channel extends VirtualClass<{ - // flags: null; + // flags: undefined; creator?: true; left?: true; broadcast?: true; @@ -997,7 +997,7 @@ namespace Api { defaultBannedRights?: Api.TypeChatBannedRights; participantsCount?: int; }> { - // flags: null; + // flags: undefined; creator?: true; left?: true; broadcast?: true; @@ -1028,7 +1028,7 @@ namespace Api { participantsCount?: int; }; export class ChannelForbidden extends VirtualClass<{ - // flags: null; + // flags: undefined; broadcast?: true; megagroup?: true; id: int; @@ -1036,7 +1036,7 @@ namespace Api { title: string; untilDate?: int; }> { - // flags: null; + // flags: undefined; broadcast?: true; megagroup?: true; id: int; @@ -1045,7 +1045,7 @@ namespace Api { untilDate?: int; }; export class ChatFull extends VirtualClass<{ - // flags: null; + // flags: undefined; canSetUsername?: true; hasScheduled?: true; id: int; @@ -1061,7 +1061,7 @@ namespace Api { ttlPeriod?: int; groupcallDefaultJoinAs?: Api.TypePeer; }> { - // flags: null; + // flags: undefined; canSetUsername?: true; hasScheduled?: true; id: int; @@ -1078,7 +1078,7 @@ namespace Api { groupcallDefaultJoinAs?: Api.TypePeer; }; export class ChannelFull extends VirtualClass<{ - // flags: null; + // flags: undefined; canViewParticipants?: true; canSetUsername?: true; canSetStickers?: true; @@ -1118,7 +1118,7 @@ namespace Api { pendingSuggestions?: string[]; groupcallDefaultJoinAs?: Api.TypePeer; }> { - // flags: null; + // flags: undefined; canViewParticipants?: true; canSetUsername?: true; canSetStickers?: true; @@ -1182,11 +1182,11 @@ namespace Api { date: int; }; export class ChatParticipantsForbidden extends VirtualClass<{ - // flags: null; + // flags: undefined; chatId: int; selfParticipant?: Api.TypeChatParticipant; }> { - // flags: null; + // flags: undefined; chatId: int; selfParticipant?: Api.TypeChatParticipant; }; @@ -1201,29 +1201,29 @@ namespace Api { }; export class ChatPhotoEmpty extends VirtualClass {}; export class ChatPhoto extends VirtualClass<{ - // flags: null; + // flags: undefined; hasVideo?: true; photoId: long; strippedThumb?: bytes; dcId: int; }> { - // flags: null; + // flags: undefined; hasVideo?: true; photoId: long; strippedThumb?: bytes; dcId: int; }; export class MessageEmpty extends VirtualClass<{ - // flags: null; + // flags: undefined; id: int; peerId?: Api.TypePeer; }> { - // flags: null; + // flags: undefined; id: int; peerId?: Api.TypePeer; }; export class Message extends VirtualClass<{ - // flags: null; + // flags: undefined; out?: true; mentioned?: true; mediaUnread?: true; @@ -1253,7 +1253,7 @@ namespace Api { restrictionReason?: Api.TypeRestrictionReason[]; ttlPeriod?: int; }> { - // flags: null; + // flags: undefined; out?: true; mentioned?: true; mediaUnread?: true; @@ -1284,7 +1284,7 @@ namespace Api { ttlPeriod?: int; }; export class MessageService extends VirtualClass<{ - // flags: null; + // flags: undefined; out?: true; mentioned?: true; mediaUnread?: true; @@ -1299,7 +1299,7 @@ namespace Api { action: Api.TypeMessageAction; ttlPeriod?: int; }> { - // flags: null; + // flags: undefined; out?: true; mentioned?: true; mediaUnread?: true; @@ -1316,11 +1316,11 @@ namespace Api { }; export class MessageMediaEmpty extends VirtualClass {}; export class MessageMediaPhoto extends VirtualClass<{ - // flags: null; + // flags: undefined; photo?: Api.TypePhoto; ttlSeconds?: int; } | void> { - // flags: null; + // flags: undefined; photo?: Api.TypePhoto; ttlSeconds?: int; }; @@ -1344,11 +1344,11 @@ namespace Api { }; export class MessageMediaUnsupported extends VirtualClass {}; export class MessageMediaDocument extends VirtualClass<{ - // flags: null; + // flags: undefined; document?: Api.TypeDocument; ttlSeconds?: int; } | void> { - // flags: null; + // flags: undefined; document?: Api.TypeDocument; ttlSeconds?: int; }; @@ -1378,7 +1378,7 @@ namespace Api { game: Api.TypeGame; }; export class MessageMediaInvoice extends VirtualClass<{ - // flags: null; + // flags: undefined; shippingAddressRequested?: true; test?: true; title: string; @@ -1389,7 +1389,7 @@ namespace Api { totalAmount: long; startParam: string; }> { - // flags: null; + // flags: undefined; shippingAddressRequested?: true; test?: true; title: string; @@ -1401,13 +1401,13 @@ namespace Api { startParam: string; }; export class MessageMediaGeoLive extends VirtualClass<{ - // flags: null; + // flags: undefined; geo: Api.TypeGeoPoint; heading?: int; period: int; proximityNotificationRadius?: int; }> { - // flags: null; + // flags: undefined; geo: Api.TypeGeoPoint; heading?: int; period: int; @@ -1488,7 +1488,7 @@ namespace Api { score: int; }; export class MessageActionPaymentSentMe extends VirtualClass<{ - // flags: null; + // flags: undefined; currency: string; totalAmount: long; payload: bytes; @@ -1496,7 +1496,7 @@ namespace Api { shippingOptionId?: string; charge: Api.TypePaymentCharge; }> { - // flags: null; + // flags: undefined; currency: string; totalAmount: long; payload: bytes; @@ -1512,13 +1512,13 @@ namespace Api { totalAmount: long; }; export class MessageActionPhoneCall extends VirtualClass<{ - // flags: null; + // flags: undefined; video?: true; callId: long; reason?: Api.TypePhoneCallDiscardReason; duration?: int; }> { - // flags: null; + // flags: undefined; video?: true; callId: long; reason?: Api.TypePhoneCallDiscardReason; @@ -1558,11 +1558,11 @@ namespace Api { distance: int; }; export class MessageActionGroupCall extends VirtualClass<{ - // flags: null; + // flags: undefined; call: Api.TypeInputGroupCall; duration?: int; }> { - // flags: null; + // flags: undefined; call: Api.TypeInputGroupCall; duration?: int; }; @@ -1586,7 +1586,7 @@ namespace Api { scheduleDate: int; }; export class Dialog extends VirtualClass<{ - // flags: null; + // flags: undefined; pinned?: true; unreadMark?: true; peer: Api.TypePeer; @@ -1600,7 +1600,7 @@ namespace Api { draft?: Api.TypeDraftMessage; folderId?: int; }> { - // flags: null; + // flags: undefined; pinned?: true; unreadMark?: true; peer: Api.TypePeer; @@ -1615,7 +1615,7 @@ namespace Api { folderId?: int; }; export class DialogFolder extends VirtualClass<{ - // flags: null; + // flags: undefined; pinned?: true; folder: Api.TypeFolder; peer: Api.TypePeer; @@ -1625,7 +1625,7 @@ namespace Api { unreadMutedMessagesCount: int; unreadUnmutedMessagesCount: int; }> { - // flags: null; + // flags: undefined; pinned?: true; folder: Api.TypeFolder; peer: Api.TypePeer; @@ -1641,7 +1641,7 @@ namespace Api { id: long; }; export class Photo extends VirtualClass<{ - // flags: null; + // flags: undefined; hasStickers?: true; id: long; accessHash: long; @@ -1651,7 +1651,7 @@ namespace Api { videoSizes?: Api.TypeVideoSize[]; dcId: int; }> { - // flags: null; + // flags: undefined; hasStickers?: true; id: long; accessHash: long; @@ -1715,13 +1715,13 @@ namespace Api { }; export class GeoPointEmpty extends VirtualClass {}; export class GeoPoint extends VirtualClass<{ - // flags: null; + // flags: undefined; long: double; lat: double; accessHash: long; accuracyRadius?: int; }> { - // flags: null; + // flags: undefined; long: double; lat: double; accessHash: long; @@ -1736,33 +1736,33 @@ namespace Api { export class InputNotifyChats extends VirtualClass {}; export class InputNotifyBroadcasts extends VirtualClass {}; export class InputPeerNotifySettings extends VirtualClass<{ - // flags: null; + // flags: undefined; showPreviews?: Bool; silent?: Bool; muteUntil?: int; sound?: string; } | void> { - // flags: null; + // flags: undefined; showPreviews?: Bool; silent?: Bool; muteUntil?: int; sound?: string; }; export class PeerNotifySettings extends VirtualClass<{ - // flags: null; + // flags: undefined; showPreviews?: Bool; silent?: Bool; muteUntil?: int; sound?: string; } | void> { - // flags: null; + // flags: undefined; showPreviews?: Bool; silent?: Bool; muteUntil?: int; sound?: string; }; export class PeerSettings extends VirtualClass<{ - // flags: null; + // flags: undefined; reportSpam?: true; addContact?: true; blockContact?: true; @@ -1773,7 +1773,7 @@ namespace Api { inviteMembers?: true; geoDistance?: int; } | void> { - // flags: null; + // flags: undefined; reportSpam?: true; addContact?: true; blockContact?: true; @@ -1786,7 +1786,7 @@ namespace Api { }; export class WallPaper extends VirtualClass<{ id: long; - // flags: null; + // flags: undefined; creator?: true; default?: true; pattern?: true; @@ -1797,7 +1797,7 @@ namespace Api { settings?: Api.TypeWallPaperSettings; }> { id: long; - // flags: null; + // flags: undefined; creator?: true; default?: true; pattern?: true; @@ -1808,12 +1808,12 @@ namespace Api { settings?: Api.TypeWallPaperSettings; }; export class WallPaperNoFile extends VirtualClass<{ - // flags: null; + // flags: undefined; default?: true; dark?: true; settings?: Api.TypeWallPaperSettings; } | void> { - // flags: null; + // flags: undefined; default?: true; dark?: true; settings?: Api.TypeWallPaperSettings; @@ -1827,7 +1827,7 @@ namespace Api { export class InputReportReasonGeoIrrelevant extends VirtualClass {}; export class InputReportReasonFake extends VirtualClass {}; export class UserFull extends VirtualClass<{ - // flags: null; + // flags: undefined; blocked?: true; phoneCallsAvailable?: true; phoneCallsPrivate?: true; @@ -1845,7 +1845,7 @@ namespace Api { folderId?: int; ttlPeriod?: int; }> { - // flags: null; + // flags: undefined; blocked?: true; phoneCallsAvailable?: true; phoneCallsPrivate?: true; @@ -1895,10 +1895,10 @@ namespace Api { export class InputMessagesFilterMusic extends VirtualClass {}; export class InputMessagesFilterChatPhotos extends VirtualClass {}; export class InputMessagesFilterPhoneCalls extends VirtualClass<{ - // flags: null; + // flags: undefined; missed?: true; } | void> { - // flags: null; + // flags: undefined; missed?: true; }; export class InputMessagesFilterRoundVoice extends VirtualClass {}; @@ -2045,7 +2045,7 @@ namespace Api { notifySettings: Api.TypePeerNotifySettings; }; export class UpdateServiceNotification extends VirtualClass<{ - // flags: null; + // flags: undefined; popup?: true; inboxDate?: int; type: string; @@ -2053,7 +2053,7 @@ namespace Api { media: Api.TypeMessageMedia; entities: Api.TypeMessageEntity[]; }> { - // flags: null; + // flags: undefined; popup?: true; inboxDate?: int; type: string; @@ -2076,7 +2076,7 @@ namespace Api { phone: string; }; export class UpdateReadHistoryInbox extends VirtualClass<{ - // flags: null; + // flags: undefined; folderId?: int; peer: Api.TypePeer; maxId: int; @@ -2084,7 +2084,7 @@ namespace Api { pts: int; ptsCount: int; }> { - // flags: null; + // flags: undefined; folderId?: int; peer: Api.TypePeer; maxId: int; @@ -2122,11 +2122,11 @@ namespace Api { ptsCount: int; }; export class UpdateChannelTooLong extends VirtualClass<{ - // flags: null; + // flags: undefined; channelId: int; pts?: int; }> { - // flags: null; + // flags: undefined; channelId: int; pts?: int; }; @@ -2145,14 +2145,14 @@ namespace Api { ptsCount: int; }; export class UpdateReadChannelInbox extends VirtualClass<{ - // flags: null; + // flags: undefined; folderId?: int; channelId: int; maxId: int; stillUnreadCount: int; pts: int; }> { - // flags: null; + // flags: undefined; folderId?: int; channelId: int; maxId: int; @@ -2196,18 +2196,18 @@ namespace Api { stickerset: messages.TypeStickerSet; }; export class UpdateStickerSetsOrder extends VirtualClass<{ - // flags: null; + // flags: undefined; masks?: true; order: long[]; }> { - // flags: null; + // flags: undefined; masks?: true; order: long[]; }; export class UpdateStickerSets extends VirtualClass {}; export class UpdateSavedGifs extends VirtualClass {}; export class UpdateBotInlineQuery extends VirtualClass<{ - // flags: null; + // flags: undefined; queryId: long; userId: int; query: string; @@ -2215,7 +2215,7 @@ namespace Api { peerType?: Api.TypeInlineQueryPeerType; offset: string; }> { - // flags: null; + // flags: undefined; queryId: long; userId: int; query: string; @@ -2224,14 +2224,14 @@ namespace Api { offset: string; }; export class UpdateBotInlineSend extends VirtualClass<{ - // flags: null; + // flags: undefined; userId: int; query: string; geo?: Api.TypeGeoPoint; id: string; msgId?: Api.TypeInputBotInlineMessageID; }> { - // flags: null; + // flags: undefined; userId: int; query: string; geo?: Api.TypeGeoPoint; @@ -2248,7 +2248,7 @@ namespace Api { ptsCount: int; }; export class UpdateBotCallbackQuery extends VirtualClass<{ - // flags: null; + // flags: undefined; queryId: long; userId: int; peer: Api.TypePeer; @@ -2257,7 +2257,7 @@ namespace Api { data?: bytes; gameShortName?: string; }> { - // flags: null; + // flags: undefined; queryId: long; userId: int; peer: Api.TypePeer; @@ -2276,7 +2276,7 @@ namespace Api { ptsCount: int; }; export class UpdateInlineBotCallbackQuery extends VirtualClass<{ - // flags: null; + // flags: undefined; queryId: long; userId: int; msgId: Api.TypeInputBotInlineMessageID; @@ -2284,7 +2284,7 @@ namespace Api { data?: bytes; gameShortName?: string; }> { - // flags: null; + // flags: undefined; queryId: long; userId: int; msgId: Api.TypeInputBotInlineMessageID; @@ -2322,22 +2322,22 @@ namespace Api { ptsCount: int; }; export class UpdateDialogPinned extends VirtualClass<{ - // flags: null; + // flags: undefined; pinned?: true; folderId?: int; peer: Api.TypeDialogPeer; }> { - // flags: null; + // flags: undefined; pinned?: true; folderId?: int; peer: Api.TypeDialogPeer; }; export class UpdatePinnedDialogs extends VirtualClass<{ - // flags: null; + // flags: undefined; folderId?: int; order?: Api.TypeDialogPeer[]; } | void> { - // flags: null; + // flags: undefined; folderId?: int; order?: Api.TypeDialogPeer[]; }; @@ -2367,7 +2367,7 @@ namespace Api { shippingAddress: Api.TypePostAddress; }; export class UpdateBotPrecheckoutQuery extends VirtualClass<{ - // flags: null; + // flags: undefined; queryId: long; userId: int; payload: bytes; @@ -2376,7 +2376,7 @@ namespace Api { currency: string; totalAmount: long; }> { - // flags: null; + // flags: undefined; queryId: long; userId: int; payload: bytes; @@ -2417,21 +2417,21 @@ namespace Api { availableMinId: int; }; export class UpdateDialogUnreadMark extends VirtualClass<{ - // flags: null; + // flags: undefined; unread?: true; peer: Api.TypeDialogPeer; }> { - // flags: null; + // flags: undefined; unread?: true; peer: Api.TypeDialogPeer; }; export class UpdateMessagePoll extends VirtualClass<{ - // flags: null; + // flags: undefined; pollId: long; poll?: Api.TypePoll; results: Api.TypePollResults; }> { - // flags: null; + // flags: undefined; pollId: long; poll?: Api.TypePoll; results: Api.TypePollResults; @@ -2501,11 +2501,11 @@ namespace Api { options: bytes[]; }; export class UpdateDialogFilter extends VirtualClass<{ - // flags: null; + // flags: undefined; id: int; filter?: Api.TypeDialogFilter; }> { - // flags: null; + // flags: undefined; id: int; filter?: Api.TypeDialogFilter; }; @@ -2532,14 +2532,14 @@ namespace Api { forwards: int; }; export class UpdateReadChannelDiscussionInbox extends VirtualClass<{ - // flags: null; + // flags: undefined; channelId: int; topMsgId: int; readMaxId: int; broadcastId?: int; broadcastPost?: int; }> { - // flags: null; + // flags: undefined; channelId: int; topMsgId: int; readMaxId: int; @@ -2563,27 +2563,27 @@ namespace Api { blocked: Bool; }; export class UpdateChannelUserTyping extends VirtualClass<{ - // flags: null; + // flags: undefined; channelId: int; topMsgId?: int; fromId: Api.TypePeer; action: Api.TypeSendMessageAction; }> { - // flags: null; + // flags: undefined; channelId: int; topMsgId?: int; fromId: Api.TypePeer; action: Api.TypeSendMessageAction; }; export class UpdatePinnedMessages extends VirtualClass<{ - // flags: null; + // flags: undefined; pinned?: true; peer: Api.TypePeer; messages: int[]; pts: int; ptsCount: int; }> { - // flags: null; + // flags: undefined; pinned?: true; peer: Api.TypePeer; messages: int[]; @@ -2591,14 +2591,14 @@ namespace Api { ptsCount: int; }; export class UpdatePinnedChannelMessages extends VirtualClass<{ - // flags: null; + // flags: undefined; pinned?: true; channelId: int; messages: int[]; pts: int; ptsCount: int; }> { - // flags: null; + // flags: undefined; pinned?: true; channelId: int; messages: int[]; @@ -2627,16 +2627,16 @@ namespace Api { call: Api.TypeGroupCall; }; export class UpdatePeerHistoryTTL extends VirtualClass<{ - // flags: null; + // flags: undefined; peer: Api.TypePeer; ttlPeriod?: int; }> { - // flags: null; + // flags: undefined; peer: Api.TypePeer; ttlPeriod?: int; }; export class UpdateChatParticipant extends VirtualClass<{ - // flags: null; + // flags: undefined; chatId: int; date: int; actorId: int; @@ -2646,7 +2646,7 @@ namespace Api { invite?: Api.TypeExportedChatInvite; qts: int; }> { - // flags: null; + // flags: undefined; chatId: int; date: int; actorId: int; @@ -2657,7 +2657,7 @@ namespace Api { qts: int; }; export class UpdateChannelParticipant extends VirtualClass<{ - // flags: null; + // flags: undefined; channelId: int; date: int; actorId: int; @@ -2667,7 +2667,7 @@ namespace Api { invite?: Api.TypeExportedChatInvite; qts: int; }> { - // flags: null; + // flags: undefined; channelId: int; date: int; actorId: int; @@ -2690,7 +2690,7 @@ namespace Api { }; export class UpdatesTooLong extends VirtualClass {}; export class UpdateShortMessage extends VirtualClass<{ - // flags: null; + // flags: undefined; out?: true; mentioned?: true; mediaUnread?: true; @@ -2707,7 +2707,7 @@ namespace Api { entities?: Api.TypeMessageEntity[]; ttlPeriod?: int; }> { - // flags: null; + // flags: undefined; out?: true; mentioned?: true; mediaUnread?: true; @@ -2725,7 +2725,7 @@ namespace Api { ttlPeriod?: int; }; export class UpdateShortChatMessage extends VirtualClass<{ - // flags: null; + // flags: undefined; out?: true; mentioned?: true; mediaUnread?: true; @@ -2743,7 +2743,7 @@ namespace Api { entities?: Api.TypeMessageEntity[]; ttlPeriod?: int; }> { - // flags: null; + // flags: undefined; out?: true; mentioned?: true; mediaUnread?: true; @@ -2797,7 +2797,7 @@ namespace Api { seq: int; }; export class UpdateShortSentMessage extends VirtualClass<{ - // flags: null; + // flags: undefined; out?: true; id: int; pts: int; @@ -2807,7 +2807,7 @@ namespace Api { entities?: Api.TypeMessageEntity[]; ttlPeriod?: int; }> { - // flags: null; + // flags: undefined; out?: true; id: int; pts: int; @@ -2818,7 +2818,7 @@ namespace Api { ttlPeriod?: int; }; export class DcOption extends VirtualClass<{ - // flags: null; + // flags: undefined; ipv6?: true; mediaOnly?: true; tcpoOnly?: true; @@ -2829,7 +2829,7 @@ namespace Api { port: int; secret?: bytes; }> { - // flags: null; + // flags: undefined; ipv6?: true; mediaOnly?: true; tcpoOnly?: true; @@ -2841,7 +2841,7 @@ namespace Api { secret?: bytes; }; export class Config extends VirtualClass<{ - // flags: null; + // flags: undefined; phonecallsEnabled?: true; defaultP2pContacts?: true; preloadFeaturedStickers?: true; @@ -2894,7 +2894,7 @@ namespace Api { langPackVersion?: int; baseLangPackVersion?: int; }> { - // flags: null; + // flags: undefined; phonecallsEnabled?: true; defaultP2pContacts?: true; preloadFeaturedStickers?: true; @@ -2975,7 +2975,7 @@ namespace Api { participantId: int; }; export class EncryptedChatRequested extends VirtualClass<{ - // flags: null; + // flags: undefined; folderId?: int; id: int; accessHash: long; @@ -2984,7 +2984,7 @@ namespace Api { participantId: int; gA: bytes; }> { - // flags: null; + // flags: undefined; folderId?: int; id: int; accessHash: long; @@ -3011,11 +3011,11 @@ namespace Api { keyFingerprint: long; }; export class EncryptedChatDiscarded extends VirtualClass<{ - // flags: null; + // flags: undefined; historyDeleted?: true; id: int; }> { - // flags: null; + // flags: undefined; historyDeleted?: true; id: int; }; @@ -3108,7 +3108,7 @@ namespace Api { id: long; }; export class Document extends VirtualClass<{ - // flags: null; + // flags: undefined; id: long; accessHash: long; fileReference: bytes; @@ -3120,7 +3120,7 @@ namespace Api { dcId: int; attributes: Api.TypeDocumentAttribute[]; }> { - // flags: null; + // flags: undefined; id: long; accessHash: long; fileReference: bytes; @@ -3257,27 +3257,27 @@ namespace Api { }; export class DocumentAttributeAnimated extends VirtualClass {}; export class DocumentAttributeSticker extends VirtualClass<{ - // flags: null; + // flags: undefined; mask?: true; alt: string; stickerset: Api.TypeInputStickerSet; maskCoords?: Api.TypeMaskCoords; }> { - // flags: null; + // flags: undefined; mask?: true; alt: string; stickerset: Api.TypeInputStickerSet; maskCoords?: Api.TypeMaskCoords; }; export class DocumentAttributeVideo extends VirtualClass<{ - // flags: null; + // flags: undefined; roundMessage?: true; supportsStreaming?: true; duration: int; w: int; h: int; }> { - // flags: null; + // flags: undefined; roundMessage?: true; supportsStreaming?: true; duration: int; @@ -3285,14 +3285,14 @@ namespace Api { h: int; }; export class DocumentAttributeAudio extends VirtualClass<{ - // flags: null; + // flags: undefined; voice?: true; duration: int; title?: string; performer?: string; waveform?: bytes; }> { - // flags: null; + // flags: undefined; voice?: true; duration: int; title?: string; @@ -3325,7 +3325,7 @@ namespace Api { date: int; }; export class WebPage extends VirtualClass<{ - // flags: null; + // flags: undefined; id: long; url: string; displayUrl: string; @@ -3345,7 +3345,7 @@ namespace Api { cachedPage?: Api.TypePage; attributes?: Api.TypeWebPageAttribute[]; }> { - // flags: null; + // flags: undefined; id: long; url: string; displayUrl: string; @@ -3366,14 +3366,14 @@ namespace Api { attributes?: Api.TypeWebPageAttribute[]; }; export class WebPageNotModified extends VirtualClass<{ - // flags: null; + // flags: undefined; cachedPageViews?: int; } | void> { - // flags: null; + // flags: undefined; cachedPageViews?: int; }; export class Authorization extends VirtualClass<{ - // flags: null; + // flags: undefined; current?: true; officialApp?: true; passwordPending?: true; @@ -3390,7 +3390,7 @@ namespace Api { country: string; region: string; }> { - // flags: null; + // flags: undefined; current?: true; officialApp?: true; passwordPending?: true; @@ -3415,7 +3415,7 @@ namespace Api { // flags: int; }; export class ChatInviteExported extends VirtualClass<{ - // flags: null; + // flags: undefined; revoked?: true; permanent?: true; link: string; @@ -3426,7 +3426,7 @@ namespace Api { usageLimit?: int; usage?: int; }> { - // flags: null; + // flags: undefined; revoked?: true; permanent?: true; link: string; @@ -3443,7 +3443,7 @@ namespace Api { chat: Api.TypeChat; }; export class ChatInvite extends VirtualClass<{ - // flags: null; + // flags: undefined; channel?: true; broadcast?: true; public?: true; @@ -3453,7 +3453,7 @@ namespace Api { participantsCount: int; participants?: Api.TypeUser[]; }> { - // flags: null; + // flags: undefined; channel?: true; broadcast?: true; public?: true; @@ -3490,7 +3490,7 @@ namespace Api { emoticon: string; }; export class StickerSet extends VirtualClass<{ - // flags: null; + // flags: undefined; archived?: true; official?: true; masks?: true; @@ -3506,7 +3506,7 @@ namespace Api { count: int; hash: int; }> { - // flags: null; + // flags: undefined; archived?: true; official?: true; masks?: true; @@ -3551,12 +3551,12 @@ namespace Api { url: string; }; export class KeyboardButtonCallback extends VirtualClass<{ - // flags: null; + // flags: undefined; requiresPassword?: true; text: string; data: bytes; }> { - // flags: null; + // flags: undefined; requiresPassword?: true; text: string; data: bytes; @@ -3572,12 +3572,12 @@ namespace Api { text: string; }; export class KeyboardButtonSwitchInline extends VirtualClass<{ - // flags: null; + // flags: undefined; samePeer?: true; text: string; query: string; }> { - // flags: null; + // flags: undefined; samePeer?: true; text: string; query: string; @@ -3593,27 +3593,27 @@ namespace Api { text: string; }; export class KeyboardButtonUrlAuth extends VirtualClass<{ - // flags: null; + // flags: undefined; text: string; fwdText?: string; url: string; buttonId: int; }> { - // flags: null; + // flags: undefined; text: string; fwdText?: string; url: string; buttonId: int; }; export class InputKeyboardButtonUrlAuth extends VirtualClass<{ - // flags: null; + // flags: undefined; requestWriteAccess?: true; text: string; fwdText?: string; url: string; bot: Api.TypeInputUser; }> { - // flags: null; + // flags: undefined; requestWriteAccess?: true; text: string; fwdText?: string; @@ -3621,11 +3621,11 @@ namespace Api { bot: Api.TypeInputUser; }; export class KeyboardButtonRequestPoll extends VirtualClass<{ - // flags: null; + // flags: undefined; quiz?: Bool; text: string; }> { - // flags: null; + // flags: undefined; quiz?: Bool; text: string; }; @@ -3635,29 +3635,29 @@ namespace Api { buttons: Api.TypeKeyboardButton[]; }; export class ReplyKeyboardHide extends VirtualClass<{ - // flags: null; + // flags: undefined; selective?: true; } | void> { - // flags: null; + // flags: undefined; selective?: true; }; export class ReplyKeyboardForceReply extends VirtualClass<{ - // flags: null; + // flags: undefined; singleUse?: true; selective?: true; } | void> { - // flags: null; + // flags: undefined; singleUse?: true; selective?: true; }; export class ReplyKeyboardMarkup extends VirtualClass<{ - // flags: null; + // flags: undefined; resize?: true; singleUse?: true; selective?: true; rows: Api.TypeKeyboardButtonRow[]; }> { - // flags: null; + // flags: undefined; resize?: true; singleUse?: true; selective?: true; @@ -3835,11 +3835,11 @@ namespace Api { }; export class ChannelMessagesFilterEmpty extends VirtualClass {}; export class ChannelMessagesFilter extends VirtualClass<{ - // flags: null; + // flags: undefined; excludeNewMessages?: true; ranges: Api.TypeMessageRange[]; }> { - // flags: null; + // flags: undefined; excludeNewMessages?: true; ranges: Api.TypeMessageRange[]; }; @@ -3860,18 +3860,18 @@ namespace Api { date: int; }; export class ChannelParticipantCreator extends VirtualClass<{ - // flags: null; + // flags: undefined; userId: int; adminRights: Api.TypeChatAdminRights; rank?: string; }> { - // flags: null; + // flags: undefined; userId: int; adminRights: Api.TypeChatAdminRights; rank?: string; }; export class ChannelParticipantAdmin extends VirtualClass<{ - // flags: null; + // flags: undefined; canEdit?: true; self?: true; userId: int; @@ -3881,7 +3881,7 @@ namespace Api { adminRights: Api.TypeChatAdminRights; rank?: string; }> { - // flags: null; + // flags: undefined; canEdit?: true; self?: true; userId: int; @@ -3892,14 +3892,14 @@ namespace Api { rank?: string; }; export class ChannelParticipantBanned extends VirtualClass<{ - // flags: null; + // flags: undefined; left?: true; peer: Api.TypePeer; kickedBy: int; date: int; bannedRights: Api.TypeChatBannedRights; }> { - // flags: null; + // flags: undefined; left?: true; peer: Api.TypePeer; kickedBy: int; @@ -3935,47 +3935,47 @@ namespace Api { q: string; }; export class ChannelParticipantsMentions extends VirtualClass<{ - // flags: null; + // flags: undefined; q?: string; topMsgId?: int; } | void> { - // flags: null; + // flags: undefined; q?: string; topMsgId?: int; }; export class InputBotInlineMessageMediaAuto extends VirtualClass<{ - // flags: null; + // flags: undefined; message: string; entities?: Api.TypeMessageEntity[]; replyMarkup?: Api.TypeReplyMarkup; }> { - // flags: null; + // flags: undefined; message: string; entities?: Api.TypeMessageEntity[]; replyMarkup?: Api.TypeReplyMarkup; }; export class InputBotInlineMessageText extends VirtualClass<{ - // flags: null; + // flags: undefined; noWebpage?: true; message: string; entities?: Api.TypeMessageEntity[]; replyMarkup?: Api.TypeReplyMarkup; }> { - // flags: null; + // flags: undefined; noWebpage?: true; message: string; entities?: Api.TypeMessageEntity[]; replyMarkup?: Api.TypeReplyMarkup; }; export class InputBotInlineMessageMediaGeo extends VirtualClass<{ - // flags: null; + // flags: undefined; geoPoint: Api.TypeInputGeoPoint; heading?: int; period?: int; proximityNotificationRadius?: int; replyMarkup?: Api.TypeReplyMarkup; }> { - // flags: null; + // flags: undefined; geoPoint: Api.TypeInputGeoPoint; heading?: int; period?: int; @@ -3983,7 +3983,7 @@ namespace Api { replyMarkup?: Api.TypeReplyMarkup; }; export class InputBotInlineMessageMediaVenue extends VirtualClass<{ - // flags: null; + // flags: undefined; geoPoint: Api.TypeInputGeoPoint; title: string; address: string; @@ -3992,7 +3992,7 @@ namespace Api { venueType: string; replyMarkup?: Api.TypeReplyMarkup; }> { - // flags: null; + // flags: undefined; geoPoint: Api.TypeInputGeoPoint; title: string; address: string; @@ -4002,14 +4002,14 @@ namespace Api { replyMarkup?: Api.TypeReplyMarkup; }; export class InputBotInlineMessageMediaContact extends VirtualClass<{ - // flags: null; + // flags: undefined; phoneNumber: string; firstName: string; lastName: string; vcard: string; replyMarkup?: Api.TypeReplyMarkup; }> { - // flags: null; + // flags: undefined; phoneNumber: string; firstName: string; lastName: string; @@ -4017,14 +4017,14 @@ namespace Api { replyMarkup?: Api.TypeReplyMarkup; }; export class InputBotInlineMessageGame extends VirtualClass<{ - // flags: null; + // flags: undefined; replyMarkup?: Api.TypeReplyMarkup; } | void> { - // flags: null; + // flags: undefined; replyMarkup?: Api.TypeReplyMarkup; }; export class InputBotInlineMessageMediaInvoice extends VirtualClass<{ - // flags: null; + // flags: undefined; multipleAllowed?: true; canForward?: true; title: string; @@ -4037,7 +4037,7 @@ namespace Api { startParam: string; replyMarkup?: Api.TypeReplyMarkup; }> { - // flags: null; + // flags: undefined; multipleAllowed?: true; canForward?: true; title: string; @@ -4051,7 +4051,7 @@ namespace Api { replyMarkup?: Api.TypeReplyMarkup; }; export class InputBotInlineResult extends VirtualClass<{ - // flags: null; + // flags: undefined; id: string; type: string; title?: string; @@ -4061,7 +4061,7 @@ namespace Api { content?: Api.TypeInputWebDocument; sendMessage: Api.TypeInputBotInlineMessage; }> { - // flags: null; + // flags: undefined; id: string; type: string; title?: string; @@ -4083,7 +4083,7 @@ namespace Api { sendMessage: Api.TypeInputBotInlineMessage; }; export class InputBotInlineResultDocument extends VirtualClass<{ - // flags: null; + // flags: undefined; id: string; type: string; title?: string; @@ -4091,7 +4091,7 @@ namespace Api { document: Api.TypeInputDocument; sendMessage: Api.TypeInputBotInlineMessage; }> { - // flags: null; + // flags: undefined; id: string; type: string; title?: string; @@ -4109,38 +4109,38 @@ namespace Api { sendMessage: Api.TypeInputBotInlineMessage; }; export class BotInlineMessageMediaAuto extends VirtualClass<{ - // flags: null; + // flags: undefined; message: string; entities?: Api.TypeMessageEntity[]; replyMarkup?: Api.TypeReplyMarkup; }> { - // flags: null; + // flags: undefined; message: string; entities?: Api.TypeMessageEntity[]; replyMarkup?: Api.TypeReplyMarkup; }; export class BotInlineMessageText extends VirtualClass<{ - // flags: null; + // flags: undefined; noWebpage?: true; message: string; entities?: Api.TypeMessageEntity[]; replyMarkup?: Api.TypeReplyMarkup; }> { - // flags: null; + // flags: undefined; noWebpage?: true; message: string; entities?: Api.TypeMessageEntity[]; replyMarkup?: Api.TypeReplyMarkup; }; export class BotInlineMessageMediaGeo extends VirtualClass<{ - // flags: null; + // flags: undefined; geo: Api.TypeGeoPoint; heading?: int; period?: int; proximityNotificationRadius?: int; replyMarkup?: Api.TypeReplyMarkup; }> { - // flags: null; + // flags: undefined; geo: Api.TypeGeoPoint; heading?: int; period?: int; @@ -4148,7 +4148,7 @@ namespace Api { replyMarkup?: Api.TypeReplyMarkup; }; export class BotInlineMessageMediaVenue extends VirtualClass<{ - // flags: null; + // flags: undefined; geo: Api.TypeGeoPoint; title: string; address: string; @@ -4157,7 +4157,7 @@ namespace Api { venueType: string; replyMarkup?: Api.TypeReplyMarkup; }> { - // flags: null; + // flags: undefined; geo: Api.TypeGeoPoint; title: string; address: string; @@ -4167,14 +4167,14 @@ namespace Api { replyMarkup?: Api.TypeReplyMarkup; }; export class BotInlineMessageMediaContact extends VirtualClass<{ - // flags: null; + // flags: undefined; phoneNumber: string; firstName: string; lastName: string; vcard: string; replyMarkup?: Api.TypeReplyMarkup; }> { - // flags: null; + // flags: undefined; phoneNumber: string; firstName: string; lastName: string; @@ -4182,7 +4182,7 @@ namespace Api { replyMarkup?: Api.TypeReplyMarkup; }; export class BotInlineMessageMediaInvoice extends VirtualClass<{ - // flags: null; + // flags: undefined; shippingAddressRequested?: true; test?: true; title: string; @@ -4192,7 +4192,7 @@ namespace Api { totalAmount: long; replyMarkup?: Api.TypeReplyMarkup; }> { - // flags: null; + // flags: undefined; shippingAddressRequested?: true; test?: true; title: string; @@ -4203,7 +4203,7 @@ namespace Api { replyMarkup?: Api.TypeReplyMarkup; }; export class BotInlineResult extends VirtualClass<{ - // flags: null; + // flags: undefined; id: string; type: string; title?: string; @@ -4213,7 +4213,7 @@ namespace Api { content?: Api.TypeWebDocument; sendMessage: Api.TypeBotInlineMessage; }> { - // flags: null; + // flags: undefined; id: string; type: string; title?: string; @@ -4224,7 +4224,7 @@ namespace Api { sendMessage: Api.TypeBotInlineMessage; }; export class BotInlineMediaResult extends VirtualClass<{ - // flags: null; + // flags: undefined; id: string; type: string; photo?: Api.TypePhoto; @@ -4233,7 +4233,7 @@ namespace Api { description?: string; sendMessage: Api.TypeBotInlineMessage; }> { - // flags: null; + // flags: undefined; id: string; type: string; photo?: Api.TypePhoto; @@ -4250,7 +4250,7 @@ namespace Api { html: string; }; export class MessageFwdHeader extends VirtualClass<{ - // flags: null; + // flags: undefined; imported?: true; fromId?: Api.TypePeer; fromName?: string; @@ -4261,7 +4261,7 @@ namespace Api { savedFromMsgId?: int; psaType?: string; }> { - // flags: null; + // flags: undefined; imported?: true; fromId?: Api.TypePeer; fromName?: string; @@ -4313,21 +4313,21 @@ namespace Api { peers: Api.TypeTopPeer[]; }; export class DraftMessageEmpty extends VirtualClass<{ - // flags: null; + // flags: undefined; date?: int; } | void> { - // flags: null; + // flags: undefined; date?: int; }; export class DraftMessage extends VirtualClass<{ - // flags: null; + // flags: undefined; noWebpage?: true; replyToMsgId?: int; message: string; entities?: Api.TypeMessageEntity[]; date: int; }> { - // flags: null; + // flags: undefined; noWebpage?: true; replyToMsgId?: int; message: string; @@ -4370,7 +4370,7 @@ namespace Api { id: Api.TypeInputDocument; }; export class Game extends VirtualClass<{ - // flags: null; + // flags: undefined; id: long; accessHash: long; shortName: string; @@ -4379,7 +4379,7 @@ namespace Api { photo: Api.TypePhoto; document?: Api.TypeDocument; }> { - // flags: null; + // flags: undefined; id: long; accessHash: long; shortName: string; @@ -4572,26 +4572,26 @@ namespace Api { caption: Api.TypeRichText; }; export class PageBlockPhoto extends VirtualClass<{ - // flags: null; + // flags: undefined; photoId: long; caption: Api.TypePageCaption; url?: string; webpageId?: long; }> { - // flags: null; + // flags: undefined; photoId: long; caption: Api.TypePageCaption; url?: string; webpageId?: long; }; export class PageBlockVideo extends VirtualClass<{ - // flags: null; + // flags: undefined; autoplay?: true; loop?: true; videoId: long; caption: Api.TypePageCaption; }> { - // flags: null; + // flags: undefined; autoplay?: true; loop?: true; videoId: long; @@ -4603,7 +4603,7 @@ namespace Api { cover: Api.TypePageBlock; }; export class PageBlockEmbed extends VirtualClass<{ - // flags: null; + // flags: undefined; fullWidth?: true; allowScrolling?: true; url?: string; @@ -4613,7 +4613,7 @@ namespace Api { h?: int; caption: Api.TypePageCaption; }> { - // flags: null; + // flags: undefined; fullWidth?: true; allowScrolling?: true; url?: string; @@ -4672,13 +4672,13 @@ namespace Api { text: Api.TypeRichText; }; export class PageBlockTable extends VirtualClass<{ - // flags: null; + // flags: undefined; bordered?: true; striped?: true; title: Api.TypeRichText; rows: Api.TypePageTableRow[]; }> { - // flags: null; + // flags: undefined; bordered?: true; striped?: true; title: Api.TypeRichText; @@ -4690,12 +4690,12 @@ namespace Api { items: Api.TypePageListOrderedItem[]; }; export class PageBlockDetails extends VirtualClass<{ - // flags: null; + // flags: undefined; open?: true; blocks: Api.TypePageBlock[]; title: Api.TypeRichText; }> { - // flags: null; + // flags: undefined; open?: true; blocks: Api.TypePageBlock[]; title: Api.TypeRichText; @@ -4737,7 +4737,7 @@ namespace Api { amount: long; }; export class Invoice extends VirtualClass<{ - // flags: null; + // flags: undefined; test?: true; nameRequested?: true; phoneRequested?: true; @@ -4751,7 +4751,7 @@ namespace Api { maxTipAmount?: long; suggestedTipAmounts?: long[]; }> { - // flags: null; + // flags: undefined; test?: true; nameRequested?: true; phoneRequested?: true; @@ -4788,13 +4788,13 @@ namespace Api { postCode: string; }; export class PaymentRequestedInfo extends VirtualClass<{ - // flags: null; + // flags: undefined; name?: string; phone?: string; email?: string; shippingAddress?: Api.TypePostAddress; } | void> { - // flags: null; + // flags: undefined; name?: string; phone?: string; email?: string; @@ -4872,11 +4872,11 @@ namespace Api { tmpPassword: bytes; }; export class InputPaymentCredentials extends VirtualClass<{ - // flags: null; + // flags: undefined; save?: true; data: Api.TypeDataJSON; }> { - // flags: null; + // flags: undefined; save?: true; data: Api.TypeDataJSON; }; @@ -4900,12 +4900,12 @@ namespace Api { prices: Api.TypeLabeledPrice[]; }; export class InputStickerSetItem extends VirtualClass<{ - // flags: null; + // flags: undefined; document: Api.TypeInputDocument; emoji: string; maskCoords?: Api.TypeMaskCoords; }> { - // flags: null; + // flags: undefined; document: Api.TypeInputDocument; emoji: string; maskCoords?: Api.TypeMaskCoords; @@ -4923,7 +4923,7 @@ namespace Api { id: long; }; export class PhoneCallWaiting extends VirtualClass<{ - // flags: null; + // flags: undefined; video?: true; id: long; accessHash: long; @@ -4933,7 +4933,7 @@ namespace Api { protocol: Api.TypePhoneCallProtocol; receiveDate?: int; }> { - // flags: null; + // flags: undefined; video?: true; id: long; accessHash: long; @@ -4944,7 +4944,7 @@ namespace Api { receiveDate?: int; }; export class PhoneCallRequested extends VirtualClass<{ - // flags: null; + // flags: undefined; video?: true; id: long; accessHash: long; @@ -4954,7 +4954,7 @@ namespace Api { gAHash: bytes; protocol: Api.TypePhoneCallProtocol; }> { - // flags: null; + // flags: undefined; video?: true; id: long; accessHash: long; @@ -4965,7 +4965,7 @@ namespace Api { protocol: Api.TypePhoneCallProtocol; }; export class PhoneCallAccepted extends VirtualClass<{ - // flags: null; + // flags: undefined; video?: true; id: long; accessHash: long; @@ -4975,7 +4975,7 @@ namespace Api { gB: bytes; protocol: Api.TypePhoneCallProtocol; }> { - // flags: null; + // flags: undefined; video?: true; id: long; accessHash: long; @@ -4986,7 +4986,7 @@ namespace Api { protocol: Api.TypePhoneCallProtocol; }; export class PhoneCall extends VirtualClass<{ - // flags: null; + // flags: undefined; p2pAllowed?: true; video?: true; id: long; @@ -5000,7 +5000,7 @@ namespace Api { connections: Api.TypePhoneConnection[]; startDate: int; }> { - // flags: null; + // flags: undefined; p2pAllowed?: true; video?: true; id: long; @@ -5015,7 +5015,7 @@ namespace Api { startDate: int; }; export class PhoneCallDiscarded extends VirtualClass<{ - // flags: null; + // flags: undefined; needRating?: true; needDebug?: true; video?: true; @@ -5023,7 +5023,7 @@ namespace Api { reason?: Api.TypePhoneCallDiscardReason; duration?: int; }> { - // flags: null; + // flags: undefined; needRating?: true; needDebug?: true; video?: true; @@ -5045,7 +5045,7 @@ namespace Api { peerTag: bytes; }; export class PhoneConnectionWebrtc extends VirtualClass<{ - // flags: null; + // flags: undefined; turn?: true; stun?: true; id: long; @@ -5055,7 +5055,7 @@ namespace Api { username: string; password: string; }> { - // flags: null; + // flags: undefined; turn?: true; stun?: true; id: long; @@ -5066,14 +5066,14 @@ namespace Api { password: string; }; export class PhoneCallProtocol extends VirtualClass<{ - // flags: null; + // flags: undefined; udpP2p?: true; udpReflector?: true; minLayer: int; maxLayer: int; libraryVersions: string[]; }> { - // flags: null; + // flags: undefined; udpP2p?: true; udpReflector?: true; minLayer: int; @@ -5100,7 +5100,7 @@ namespace Api { value: string; }; export class LangPackStringPluralized extends VirtualClass<{ - // flags: null; + // flags: undefined; key: string; zeroValue?: string; oneValue?: string; @@ -5109,7 +5109,7 @@ namespace Api { manyValue?: string; otherValue: string; }> { - // flags: null; + // flags: undefined; key: string; zeroValue?: string; oneValue?: string; @@ -5135,7 +5135,7 @@ namespace Api { strings: Api.TypeLangPackString[]; }; export class LangPackLanguage extends VirtualClass<{ - // flags: null; + // flags: undefined; official?: true; rtl?: true; beta?: true; @@ -5148,7 +5148,7 @@ namespace Api { translatedCount: int; translationsUrl: string; }> { - // flags: null; + // flags: undefined; official?: true; rtl?: true; beta?: true; @@ -5353,7 +5353,7 @@ namespace Api { action: Api.TypeChannelAdminLogEventAction; }; export class ChannelAdminLogEventsFilter extends VirtualClass<{ - // flags: null; + // flags: undefined; join?: true; leave?: true; invite?: true; @@ -5371,7 +5371,7 @@ namespace Api { groupCall?: true; invites?: true; } | void> { - // flags: null; + // flags: undefined; join?: true; leave?: true; invite?: true; @@ -5430,13 +5430,13 @@ namespace Api { set: Api.TypeStickerSetCovered; }; export class InputSingleMedia extends VirtualClass<{ - // flags: null; + // flags: undefined; media: Api.TypeInputMedia; randomId: long; message: string; entities?: Api.TypeMessageEntity[]; }> { - // flags: null; + // flags: undefined; media: Api.TypeInputMedia; randomId: long; message: string; @@ -5588,7 +5588,7 @@ namespace Api { export class SecureValueTypePhone extends VirtualClass {}; export class SecureValueTypeEmail extends VirtualClass {}; export class SecureValue extends VirtualClass<{ - // flags: null; + // flags: undefined; type: Api.TypeSecureValueType; data?: Api.TypeSecureData; frontSide?: Api.TypeSecureFile; @@ -5599,7 +5599,7 @@ namespace Api { plainData?: Api.TypeSecurePlainData; hash: bytes; }> { - // flags: null; + // flags: undefined; type: Api.TypeSecureValueType; data?: Api.TypeSecureData; frontSide?: Api.TypeSecureFile; @@ -5611,7 +5611,7 @@ namespace Api { hash: bytes; }; export class InputSecureValue extends VirtualClass<{ - // flags: null; + // flags: undefined; type: Api.TypeSecureValueType; data?: Api.TypeSecureData; frontSide?: Api.TypeInputSecureFile; @@ -5621,7 +5621,7 @@ namespace Api { files?: Api.TypeInputSecureFile[]; plainData?: Api.TypeSecurePlainData; }> { - // flags: null; + // flags: undefined; type: Api.TypeSecureValueType; data?: Api.TypeSecureData; frontSide?: Api.TypeInputSecureFile; @@ -5784,13 +5784,13 @@ namespace Api { M1: bytes; }; export class SecureRequiredType extends VirtualClass<{ - // flags: null; + // flags: undefined; nativeNames?: true; selfieRequired?: true; translationRequired?: true; type: Api.TypeSecureValueType; }> { - // flags: null; + // flags: undefined; nativeNames?: true; selfieRequired?: true; translationRequired?: true; @@ -5846,7 +5846,7 @@ namespace Api { value: Api.TypeJSONObjectValue[]; }; export class PageTableCell extends VirtualClass<{ - // flags: null; + // flags: undefined; header?: true; alignCenter?: true; alignRight?: true; @@ -5856,7 +5856,7 @@ namespace Api { colspan?: int; rowspan?: int; } | void> { - // flags: null; + // flags: undefined; header?: true; alignCenter?: true; alignRight?: true; @@ -5903,7 +5903,7 @@ namespace Api { blocks: Api.TypePageBlock[]; }; export class PageRelatedArticle extends VirtualClass<{ - // flags: null; + // flags: undefined; url: string; webpageId: long; title?: string; @@ -5912,7 +5912,7 @@ namespace Api { author?: string; publishedDate?: int; }> { - // flags: null; + // flags: undefined; url: string; webpageId: long; title?: string; @@ -5922,7 +5922,7 @@ namespace Api { publishedDate?: int; }; export class Page extends VirtualClass<{ - // flags: null; + // flags: undefined; part?: true; rtl?: true; v2?: true; @@ -5932,7 +5932,7 @@ namespace Api { documents: Api.TypeDocument[]; views?: int; }> { - // flags: null; + // flags: undefined; part?: true; rtl?: true; v2?: true; @@ -5951,7 +5951,7 @@ namespace Api { }; export class Poll extends VirtualClass<{ id: long; - // flags: null; + // flags: undefined; closed?: true; publicVoters?: true; multipleChoice?: true; @@ -5962,7 +5962,7 @@ namespace Api { closeDate?: int; }> { id: long; - // flags: null; + // flags: undefined; closed?: true; publicVoters?: true; multipleChoice?: true; @@ -5973,20 +5973,20 @@ namespace Api { closeDate?: int; }; export class PollAnswerVoters extends VirtualClass<{ - // flags: null; + // flags: undefined; chosen?: true; correct?: true; option: bytes; voters: int; }> { - // flags: null; + // flags: undefined; chosen?: true; correct?: true; option: bytes; voters: int; }; export class PollResults extends VirtualClass<{ - // flags: null; + // flags: undefined; min?: true; results?: Api.TypePollAnswerVoters[]; totalVoters?: int; @@ -5994,7 +5994,7 @@ namespace Api { solution?: string; solutionEntities?: Api.TypeMessageEntity[]; } | void> { - // flags: null; + // flags: undefined; min?: true; results?: Api.TypePollAnswerVoters[]; totalVoters?: int; @@ -6013,7 +6013,7 @@ namespace Api { url: string; }; export class ChatAdminRights extends VirtualClass<{ - // flags: null; + // flags: undefined; changeInfo?: true; postMessages?: true; editMessages?: true; @@ -6026,7 +6026,7 @@ namespace Api { manageCall?: true; other?: true; } | void> { - // flags: null; + // flags: undefined; changeInfo?: true; postMessages?: true; editMessages?: true; @@ -6040,7 +6040,7 @@ namespace Api { other?: true; }; export class ChatBannedRights extends VirtualClass<{ - // flags: null; + // flags: undefined; viewMessages?: true; sendMessages?: true; sendMedia?: true; @@ -6055,7 +6055,7 @@ namespace Api { pinMessages?: true; untilDate: int; }> { - // flags: null; + // flags: undefined; viewMessages?: true; sendMessages?: true; sendMedia?: true; @@ -6084,18 +6084,18 @@ namespace Api { }; export class InputWallPaperNoFile extends VirtualClass {}; export class CodeSettings extends VirtualClass<{ - // flags: null; + // flags: undefined; allowFlashcall?: true; currentNumber?: true; allowAppHash?: true; } | void> { - // flags: null; + // flags: undefined; allowFlashcall?: true; currentNumber?: true; allowAppHash?: true; }; export class WallPaperSettings extends VirtualClass<{ - // flags: null; + // flags: undefined; blur?: true; motion?: true; backgroundColor?: int; @@ -6103,7 +6103,7 @@ namespace Api { intensity?: int; rotation?: int; } | void> { - // flags: null; + // flags: undefined; blur?: true; motion?: true; backgroundColor?: int; @@ -6112,7 +6112,7 @@ namespace Api { rotation?: int; }; export class AutoDownloadSettings extends VirtualClass<{ - // flags: null; + // flags: undefined; disabled?: true; videoPreloadLarge?: true; audioPreloadNext?: true; @@ -6122,7 +6122,7 @@ namespace Api { fileSizeMax: int; videoUploadMaxbitrate: int; }> { - // flags: null; + // flags: undefined; disabled?: true; videoPreloadLarge?: true; audioPreloadNext?: true; @@ -6168,7 +6168,7 @@ namespace Api { langCode: string; }; export class Folder extends VirtualClass<{ - // flags: null; + // flags: undefined; autofillNewBroadcasts?: true; autofillPublicGroups?: true; autofillNewCorrespondents?: true; @@ -6176,7 +6176,7 @@ namespace Api { title: string; photo?: Api.TypeChatPhoto; }> { - // flags: null; + // flags: undefined; autofillNewBroadcasts?: true; autofillPublicGroups?: true; autofillNewCorrespondents?: true; @@ -6199,12 +6199,12 @@ namespace Api { folderId: int; }; export class UrlAuthResultRequest extends VirtualClass<{ - // flags: null; + // flags: undefined; requestWriteAccess?: true; bot: Api.TypeUser; domain: string; }> { - // flags: null; + // flags: undefined; requestWriteAccess?: true; bot: Api.TypeUser; domain: string; @@ -6259,7 +6259,7 @@ namespace Api { slug: string; }; export class Theme extends VirtualClass<{ - // flags: null; + // flags: undefined; creator?: true; default?: true; id: long; @@ -6270,7 +6270,7 @@ namespace Api { settings?: Api.TypeThemeSettings; installsCount: int; }> { - // flags: null; + // flags: undefined; creator?: true; default?: true; id: long; @@ -6287,7 +6287,7 @@ namespace Api { export class BaseThemeTinted extends VirtualClass {}; export class BaseThemeArctic extends VirtualClass {}; export class InputThemeSettings extends VirtualClass<{ - // flags: null; + // flags: undefined; baseTheme: Api.TypeBaseTheme; accentColor: int; messageTopColor?: int; @@ -6295,7 +6295,7 @@ namespace Api { wallpaper?: Api.TypeInputWallPaper; wallpaperSettings?: Api.TypeWallPaperSettings; }> { - // flags: null; + // flags: undefined; baseTheme: Api.TypeBaseTheme; accentColor: int; messageTopColor?: int; @@ -6304,14 +6304,14 @@ namespace Api { wallpaperSettings?: Api.TypeWallPaperSettings; }; export class ThemeSettings extends VirtualClass<{ - // flags: null; + // flags: undefined; baseTheme: Api.TypeBaseTheme; accentColor: int; messageTopColor?: int; messageBottomColor?: int; wallpaper?: Api.TypeWallPaper; }> { - // flags: null; + // flags: undefined; baseTheme: Api.TypeBaseTheme; accentColor: int; messageTopColor?: int; @@ -6319,11 +6319,11 @@ namespace Api { wallpaper?: Api.TypeWallPaper; }; export class WebPageAttributeTheme extends VirtualClass<{ - // flags: null; + // flags: undefined; documents?: Api.TypeDocument[]; settings?: Api.TypeThemeSettings; } | void> { - // flags: null; + // flags: undefined; documents?: Api.TypeDocument[]; settings?: Api.TypeThemeSettings; }; @@ -6360,7 +6360,7 @@ namespace Api { name: string; }; export class DialogFilter extends VirtualClass<{ - // flags: null; + // flags: undefined; contacts?: true; nonContacts?: true; groups?: true; @@ -6376,7 +6376,7 @@ namespace Api { includePeers: Api.TypeInputPeer[]; excludePeers: Api.TypeInputPeer[]; }> { - // flags: null; + // flags: undefined; contacts?: true; nonContacts?: true; groups?: true; @@ -6431,11 +6431,11 @@ namespace Api { error: string; }; export class StatsGraph extends VirtualClass<{ - // flags: null; + // flags: undefined; json: Api.TypeDataJSON; zoomToken?: string; }> { - // flags: null; + // flags: undefined; json: Api.TypeDataJSON; zoomToken?: string; }; @@ -6449,14 +6449,14 @@ namespace Api { forwards: int; }; export class VideoSize extends VirtualClass<{ - // flags: null; + // flags: undefined; type: string; w: int; h: int; size: int; videoStartTs?: double; }> { - // flags: null; + // flags: undefined; type: string; w: int; h: int; @@ -6491,36 +6491,36 @@ namespace Api { invitations: int; }; export class GlobalPrivacySettings extends VirtualClass<{ - // flags: null; + // flags: undefined; archiveAndMuteNewNoncontactPeers?: Bool; } | void> { - // flags: null; + // flags: undefined; archiveAndMuteNewNoncontactPeers?: Bool; }; export class MessageViews extends VirtualClass<{ - // flags: null; + // flags: undefined; views?: int; forwards?: int; replies?: Api.TypeMessageReplies; } | void> { - // flags: null; + // flags: undefined; views?: int; forwards?: int; replies?: Api.TypeMessageReplies; }; export class MessageReplyHeader extends VirtualClass<{ - // flags: null; + // flags: undefined; replyToMsgId: int; replyToPeerId?: Api.TypePeer; replyToTopId?: int; }> { - // flags: null; + // flags: undefined; replyToMsgId: int; replyToPeerId?: Api.TypePeer; replyToTopId?: int; }; export class MessageReplies extends VirtualClass<{ - // flags: null; + // flags: undefined; comments?: true; replies: int; repliesPts: int; @@ -6529,7 +6529,7 @@ namespace Api { maxId?: int; readMaxId?: int; }> { - // flags: null; + // flags: undefined; comments?: true; replies: int; repliesPts: int; @@ -6555,7 +6555,7 @@ namespace Api { duration: int; }; export class GroupCall extends VirtualClass<{ - // flags: null; + // flags: undefined; joinMuted?: true; canChangeJoinMuted?: true; joinDateAsc?: true; @@ -6570,7 +6570,7 @@ namespace Api { scheduleDate?: int; version: int; }> { - // flags: null; + // flags: undefined; joinMuted?: true; canChangeJoinMuted?: true; joinDateAsc?: true; @@ -6593,7 +6593,7 @@ namespace Api { accessHash: long; }; export class GroupCallParticipant extends VirtualClass<{ - // flags: null; + // flags: undefined; muted?: true; left?: true; canSelfUnmute?: true; @@ -6612,7 +6612,7 @@ namespace Api { raiseHandRating?: long; params?: Api.TypeDataJSON; }> { - // flags: null; + // flags: undefined; muted?: true; left?: true; canSelfUnmute?: true; @@ -7018,32 +7018,32 @@ namespace Api { export namespace auth { export class SentCode extends VirtualClass<{ - // flags: null; + // flags: undefined; type: auth.TypeSentCodeType; phoneCodeHash: string; nextType?: auth.TypeCodeType; timeout?: int; }> { - // flags: null; + // flags: undefined; type: auth.TypeSentCodeType; phoneCodeHash: string; nextType?: auth.TypeCodeType; timeout?: int; }; export class Authorization extends VirtualClass<{ - // flags: null; + // flags: undefined; tmpSessions?: int; user: Api.TypeUser; }> { - // flags: null; + // flags: undefined; tmpSessions?: int; user: Api.TypeUser; }; export class AuthorizationSignUpRequired extends VirtualClass<{ - // flags: null; + // flags: undefined; termsOfService?: help.TypeTermsOfService; } | void> { - // flags: null; + // flags: undefined; termsOfService?: help.TypeTermsOfService; }; export class ExportedAuthorization extends VirtualClass<{ @@ -7217,7 +7217,7 @@ namespace Api { users: Api.TypeUser[]; }; export class MessagesSlice extends VirtualClass<{ - // flags: null; + // flags: undefined; inexact?: true; count: int; nextRate?: int; @@ -7226,7 +7226,7 @@ namespace Api { chats: Api.TypeChat[]; users: Api.TypeUser[]; }> { - // flags: null; + // flags: undefined; inexact?: true; count: int; nextRate?: int; @@ -7236,7 +7236,7 @@ namespace Api { users: Api.TypeUser[]; }; export class ChannelMessages extends VirtualClass<{ - // flags: null; + // flags: undefined; inexact?: true; pts: int; count: int; @@ -7245,7 +7245,7 @@ namespace Api { chats: Api.TypeChat[]; users: Api.TypeUser[]; }> { - // flags: null; + // flags: undefined; inexact?: true; pts: int; count: int; @@ -7358,7 +7358,7 @@ namespace Api { gifs: Api.TypeDocument[]; }; export class BotResults extends VirtualClass<{ - // flags: null; + // flags: undefined; gallery?: true; queryId: long; nextOffset?: string; @@ -7367,7 +7367,7 @@ namespace Api { cacheTime: int; users: Api.TypeUser[]; }> { - // flags: null; + // flags: undefined; gallery?: true; queryId: long; nextOffset?: string; @@ -7377,7 +7377,7 @@ namespace Api { users: Api.TypeUser[]; }; export class BotCallbackAnswer extends VirtualClass<{ - // flags: null; + // flags: undefined; alert?: true; hasUrl?: true; nativeUi?: true; @@ -7385,7 +7385,7 @@ namespace Api { url?: string; cacheTime: int; }> { - // flags: null; + // flags: undefined; alert?: true; hasUrl?: true; nativeUi?: true; @@ -7394,10 +7394,10 @@ namespace Api { cacheTime: int; }; export class MessageEditData extends VirtualClass<{ - // flags: null; + // flags: undefined; caption?: true; } | void> { - // flags: null; + // flags: undefined; caption?: true; }; export class PeerDialogs extends VirtualClass<{ @@ -7480,12 +7480,12 @@ namespace Api { sets: Api.TypeStickerSetCovered[]; }; export class SearchCounter extends VirtualClass<{ - // flags: null; + // flags: undefined; inexact?: true; filter: Api.TypeMessagesFilter; count: int; }> { - // flags: null; + // flags: undefined; inexact?: true; filter: Api.TypeMessagesFilter; count: int; @@ -7500,13 +7500,13 @@ namespace Api { users: Api.TypeUser[]; }; export class VotesList extends VirtualClass<{ - // flags: null; + // flags: undefined; count: int; votes: Api.TypeMessageUserVote[]; users: Api.TypeUser[]; nextOffset?: string; }> { - // flags: null; + // flags: undefined; count: int; votes: Api.TypeMessageUserVote[]; users: Api.TypeUser[]; @@ -7522,7 +7522,7 @@ namespace Api { users: Api.TypeUser[]; }; export class DiscussionMessage extends VirtualClass<{ - // flags: null; + // flags: undefined; messages: Api.TypeMessage[]; maxId?: int; readInboxMaxId?: int; @@ -7530,7 +7530,7 @@ namespace Api { chats: Api.TypeChat[]; users: Api.TypeUser[]; }> { - // flags: null; + // flags: undefined; messages: Api.TypeMessage[]; maxId?: int; readInboxMaxId?: int; @@ -7544,12 +7544,12 @@ namespace Api { id: long; }; export class HistoryImportParsed extends VirtualClass<{ - // flags: null; + // flags: undefined; pm?: true; group?: true; title?: string; } | void> { - // flags: null; + // flags: undefined; pm?: true; group?: true; title?: string; @@ -7670,18 +7670,18 @@ namespace Api { pts: int; }; export class ChannelDifferenceEmpty extends VirtualClass<{ - // flags: null; + // flags: undefined; final?: true; pts: int; timeout?: int; }> { - // flags: null; + // flags: undefined; final?: true; pts: int; timeout?: int; }; export class ChannelDifferenceTooLong extends VirtualClass<{ - // flags: null; + // flags: undefined; final?: true; timeout?: int; dialog: Api.TypeDialog; @@ -7689,7 +7689,7 @@ namespace Api { chats: Api.TypeChat[]; users: Api.TypeUser[]; }> { - // flags: null; + // flags: undefined; final?: true; timeout?: int; dialog: Api.TypeDialog; @@ -7698,7 +7698,7 @@ namespace Api { users: Api.TypeUser[]; }; export class ChannelDifference extends VirtualClass<{ - // flags: null; + // flags: undefined; final?: true; pts: int; timeout?: int; @@ -7707,7 +7707,7 @@ namespace Api { chats: Api.TypeChat[]; users: Api.TypeUser[]; }> { - // flags: null; + // flags: undefined; final?: true; pts: int; timeout?: int; @@ -7794,7 +7794,7 @@ namespace Api { export namespace help { export class AppUpdate extends VirtualClass<{ - // flags: null; + // flags: undefined; canNotSkip?: true; id: int; version: string; @@ -7803,7 +7803,7 @@ namespace Api { document?: Api.TypeDocument; url?: string; }> { - // flags: null; + // flags: undefined; canNotSkip?: true; id: int; version: string; @@ -7826,14 +7826,14 @@ namespace Api { user: Api.TypeUser; }; export class TermsOfService extends VirtualClass<{ - // flags: null; + // flags: undefined; popup?: true; id: Api.TypeDataJSON; text: string; entities: Api.TypeMessageEntity[]; minAgeConfirm?: int; }> { - // flags: null; + // flags: undefined; popup?: true; id: Api.TypeDataJSON; text: string; @@ -7863,12 +7863,12 @@ namespace Api { }; export class DeepLinkInfoEmpty extends VirtualClass {}; export class DeepLinkInfo extends VirtualClass<{ - // flags: null; + // flags: undefined; updateApp?: true; message: string; entities?: Api.TypeMessageEntity[]; }> { - // flags: null; + // flags: undefined; updateApp?: true; message: string; entities?: Api.TypeMessageEntity[]; @@ -7904,7 +7904,7 @@ namespace Api { expires: int; }; export class PromoData extends VirtualClass<{ - // flags: null; + // flags: undefined; proxy?: true; expires: int; peer: Api.TypePeer; @@ -7913,7 +7913,7 @@ namespace Api { psaType?: string; psaMessage?: string; }> { - // flags: null; + // flags: undefined; proxy?: true; expires: int; peer: Api.TypePeer; @@ -7923,25 +7923,25 @@ namespace Api { psaMessage?: string; }; export class CountryCode extends VirtualClass<{ - // flags: null; + // flags: undefined; countryCode: string; prefixes?: string[]; patterns?: string[]; }> { - // flags: null; + // flags: undefined; countryCode: string; prefixes?: string[]; patterns?: string[]; }; export class Country extends VirtualClass<{ - // flags: null; + // flags: undefined; hidden?: true; iso2: string; defaultName: string; name?: string; countryCodes: help.TypeCountryCode[]; }> { - // flags: null; + // flags: undefined; hidden?: true; iso2: string; defaultName: string; @@ -7983,7 +7983,7 @@ namespace Api { authorizations: Api.TypeAuthorization[]; }; export class Password extends VirtualClass<{ - // flags: null; + // flags: undefined; hasRecovery?: true; hasSecureValues?: true; hasPassword?: true; @@ -7996,7 +7996,7 @@ namespace Api { newSecureAlgo: Api.TypeSecurePasswordKdfAlgo; secureRandom: bytes; }> { - // flags: null; + // flags: undefined; hasRecovery?: true; hasSecureValues?: true; hasPassword?: true; @@ -8010,23 +8010,23 @@ namespace Api { secureRandom: bytes; }; export class PasswordSettings extends VirtualClass<{ - // flags: null; + // flags: undefined; email?: string; secureSettings?: Api.TypeSecureSecretSettings; } | void> { - // flags: null; + // flags: undefined; email?: string; secureSettings?: Api.TypeSecureSecretSettings; }; export class PasswordInputSettings extends VirtualClass<{ - // flags: null; + // flags: undefined; newAlgo?: Api.TypePasswordKdfAlgo; newPasswordHash?: bytes; hint?: string; email?: string; newSecureSettings?: Api.TypeSecureSecretSettings; } | void> { - // flags: null; + // flags: undefined; newAlgo?: Api.TypePasswordKdfAlgo; newPasswordHash?: bytes; hint?: string; @@ -8048,14 +8048,14 @@ namespace Api { users: Api.TypeUser[]; }; export class AuthorizationForm extends VirtualClass<{ - // flags: null; + // flags: undefined; requiredTypes: Api.TypeSecureRequiredType[]; values: Api.TypeSecureValue[]; errors: Api.TypeSecureValueError[]; users: Api.TypeUser[]; privacyPolicyUrl?: string; }> { - // flags: null; + // flags: undefined; requiredTypes: Api.TypeSecureRequiredType[]; values: Api.TypeSecureValue[]; errors: Api.TypeSecureValueError[]; @@ -8100,11 +8100,11 @@ namespace Api { themes: Api.TypeTheme[]; }; export class ContentSettings extends VirtualClass<{ - // flags: null; + // flags: undefined; sensitiveEnabled?: true; sensitiveCanChange?: true; } | void> { - // flags: null; + // flags: undefined; sensitiveEnabled?: true; sensitiveCanChange?: true; }; @@ -8145,7 +8145,7 @@ namespace Api { export namespace payments { export class PaymentForm extends VirtualClass<{ - // flags: null; + // flags: undefined; canSaveCredentials?: true; passwordMissing?: true; formId: long; @@ -8159,7 +8159,7 @@ namespace Api { savedCredentials?: Api.TypePaymentSavedCredentials; users: Api.TypeUser[]; }> { - // flags: null; + // flags: undefined; canSaveCredentials?: true; passwordMissing?: true; formId: long; @@ -8174,11 +8174,11 @@ namespace Api { users: Api.TypeUser[]; }; export class ValidatedRequestedInfo extends VirtualClass<{ - // flags: null; + // flags: undefined; id?: string; shippingOptions?: Api.TypeShippingOption[]; } | void> { - // flags: null; + // flags: undefined; id?: string; shippingOptions?: Api.TypeShippingOption[]; }; @@ -8193,7 +8193,7 @@ namespace Api { url: string; }; export class PaymentReceipt extends VirtualClass<{ - // flags: null; + // flags: undefined; date: int; botId: int; providerId: int; @@ -8209,7 +8209,7 @@ namespace Api { credentialsTitle: string; users: Api.TypeUser[]; }> { - // flags: null; + // flags: undefined; date: int; botId: int; providerId: int; @@ -8226,11 +8226,11 @@ namespace Api { users: Api.TypeUser[]; }; export class SavedInfo extends VirtualClass<{ - // flags: null; + // flags: undefined; hasSavedCredentials?: true; savedInfo?: Api.TypePaymentRequestedInfo; } | void> { - // flags: null; + // flags: undefined; hasSavedCredentials?: true; savedInfo?: Api.TypePaymentRequestedInfo; }; @@ -8388,7 +8388,7 @@ namespace Api { query: X; }; export class InitConnection extends Request, X> { - // flags: null; + // flags: undefined; apiId: int; deviceModel: string; systemVersion: string; @@ -8623,7 +8623,7 @@ namespace Api { export namespace account { export class RegisterDevice extends Request, Bool> { - // flags: null; + // flags: undefined; noMuted?: true; tokenType: int; token: string; @@ -8662,12 +8662,12 @@ namespace Api { }; export class ResetNotifySettings extends Request {}; export class UpdateProfile extends Request, Api.TypeUser> { - // flags: null; + // flags: undefined; firstName?: string; lastName?: string; about?: string; @@ -8861,7 +8861,7 @@ namespace Api { code: string; }; export class InitTakeoutSession extends Request, account.TypeTakeout> { - // flags: null; + // flags: undefined; contacts?: true; messageUsers?: true; messageChats?: true; @@ -8880,10 +8880,10 @@ namespace Api { fileMaxSize?: int; }; export class FinishTakeoutSession extends Request, Bool> { - // flags: null; + // flags: undefined; success?: true; }; export class ConfirmPasswordEmail extends Request, Api.TypeUpdates> { - // flags: null; + // flags: undefined; compareSound?: true; peer?: Api.TypeInputNotifyPeer; }; @@ -8941,44 +8941,44 @@ namespace Api { export class ResetWallPapers extends Request {}; export class GetAutoDownloadSettings extends Request {}; export class SaveAutoDownloadSettings extends Request, Bool> { - // flags: null; + // flags: undefined; low?: true; high?: true; settings: Api.TypeAutoDownloadSettings; }; export class UploadTheme extends Request, Api.TypeDocument> { - // flags: null; + // flags: undefined; file: Api.TypeInputFile; thumb?: Api.TypeInputFile; fileName: string; mimeType: string; }; export class CreateTheme extends Request, Api.TypeTheme> { - // flags: null; + // flags: undefined; slug: string; title: string; document?: Api.TypeInputDocument; settings?: Api.TypeInputThemeSettings; }; export class UpdateTheme extends Request, Api.TypeTheme> { - // flags: null; + // flags: undefined; format: string; theme: Api.TypeInputTheme; slug?: string; @@ -9002,12 +9002,12 @@ namespace Api { unsave: Bool; }; export class InstallTheme extends Request, Bool> { - // flags: null; + // flags: undefined; dark?: true; format?: string; theme?: Api.TypeInputTheme; @@ -9029,10 +9029,10 @@ namespace Api { hash: int; }; export class SetContentSettings extends Request, Bool> { - // flags: null; + // flags: undefined; sensitiveEnabled?: true; }; export class GetContentSettings extends Request {}; @@ -9137,7 +9137,7 @@ namespace Api { username: string; }; export class GetTopPeers extends Request, contacts.TypeTopPeers> { - // flags: null; + // flags: undefined; correspondents?: true; botsPm?: true; botsInline?: true; @@ -9178,14 +9178,14 @@ namespace Api { enabled: Bool; }; export class AddContact extends Request, Api.TypeUpdates> { - // flags: null; + // flags: undefined; addPhonePrivacyException?: true; id: Api.TypeInputUser; firstName: string; @@ -9198,24 +9198,24 @@ namespace Api { id: Api.TypeInputUser; }; export class GetLocated extends Request, Api.TypeUpdates> { - // flags: null; + // flags: undefined; background?: true; geoPoint: Api.TypeInputGeoPoint; selfExpires?: int; }; export class BlockFromReplies extends Request, Api.TypeUpdates> { - // flags: null; + // flags: undefined; deleteMessage?: true; deleteHistory?: true; reportSpam?: true; @@ -9230,7 +9230,7 @@ namespace Api { id: Api.TypeInputMessage[]; }; export class GetDialogs extends Request, messages.TypeDialogs> { - // flags: null; + // flags: undefined; excludePinned?: true; folderId?: int; offsetDate: int; @@ -9268,7 +9268,7 @@ namespace Api { hash: int; }; export class Search extends Request, messages.TypeMessages> { - // flags: null; + // flags: undefined; peer: Api.TypeInputPeer; q: string; fromId?: Api.TypeInputPeer; @@ -9306,24 +9306,24 @@ namespace Api { maxId: int; }; export class DeleteHistory extends Request, messages.TypeAffectedHistory> { - // flags: null; + // flags: undefined; justClear?: true; revoke?: true; peer: Api.TypeInputPeer; maxId: int; }; export class DeleteMessages extends Request, messages.TypeAffectedMessages> { - // flags: null; + // flags: undefined; revoke?: true; id: int[]; }; @@ -9333,18 +9333,18 @@ namespace Api { maxId: int; }; export class SetTyping extends Request, Bool> { - // flags: null; + // flags: undefined; peer: Api.TypeInputPeer; topMsgId?: int; action: Api.TypeSendMessageAction; }; export class SendMessage extends Request, Api.TypeUpdates> { - // flags: null; + // flags: undefined; noWebpage?: true; silent?: true; background?: true; @@ -9371,7 +9371,7 @@ namespace Api { scheduleDate?: int; }; export class SendMedia extends Request, Api.TypeUpdates> { - // flags: null; + // flags: undefined; silent?: true; background?: true; clearDraft?: true; @@ -9398,7 +9398,7 @@ namespace Api { scheduleDate?: int; }; export class ForwardMessages extends Request, Api.TypeUpdates> { - // flags: null; + // flags: undefined; silent?: true; background?: true; withMyScore?: true; @@ -9473,12 +9473,12 @@ namespace Api { fwdLimit: int; }; export class DeleteChatUser extends Request, Api.TypeUpdates> { - // flags: null; + // flags: undefined; revokeHistory?: true; chatId: int; userId: Api.TypeInputUser; @@ -9516,11 +9516,11 @@ namespace Api { keyFingerprint: long; }; export class DiscardEncryption extends Request, Bool> { - // flags: null; + // flags: undefined; deleteHistory?: true; chatId: int; }; @@ -9539,27 +9539,27 @@ namespace Api { maxDate: int; }; export class SendEncrypted extends Request, messages.TypeSentEncryptedMessage> { - // flags: null; + // flags: undefined; silent?: true; peer: Api.TypeInputEncryptedChat; randomId: long; data: bytes; }; export class SendEncryptedFile extends Request, messages.TypeSentEncryptedMessage> { - // flags: null; + // flags: undefined; silent?: true; peer: Api.TypeInputEncryptedChat; randomId: long; @@ -9603,22 +9603,22 @@ namespace Api { hash: int; }; export class GetWebPagePreview extends Request, Api.TypeMessageMedia> { - // flags: null; + // flags: undefined; message: string; entities?: Api.TypeMessageEntity[]; }; export class ExportChatInvite extends Request, Api.TypeExportedChatInvite> { - // flags: null; + // flags: undefined; legacyRevokePermanent?: true; peer: Api.TypeInputPeer; expireDate?: int; @@ -9686,7 +9686,7 @@ namespace Api { chatId: int; }; export class SearchGlobal extends Request, messages.TypeMessages> { - // flags: null; + // flags: undefined; folderId?: int; q: string; filter: Api.TypeMessagesFilter; @@ -9709,11 +9709,11 @@ namespace Api { limit: int; }; export class ReorderStickerSets extends Request, Bool> { - // flags: null; + // flags: undefined; masks?: true; order: long[]; }; @@ -9739,14 +9739,14 @@ namespace Api { unsave: Bool; }; export class GetInlineBotResults extends Request, messages.TypeBotResults> { - // flags: null; + // flags: undefined; bot: Api.TypeInputUser; peer: Api.TypeInputPeer; geoPoint?: Api.TypeInputGeoPoint; @@ -9754,7 +9754,7 @@ namespace Api { offset: string; }; export class SetInlineBotResults extends Request, Bool> { - // flags: null; + // flags: undefined; gallery?: true; private?: true; queryId: long; @@ -9773,7 +9773,7 @@ namespace Api { switchPm?: Api.TypeInlineBotSwitchPM; }; export class SendInlineBotResult extends Request, Api.TypeUpdates> { - // flags: null; + // flags: undefined; silent?: true; background?: true; clearDraft?: true; @@ -9805,7 +9805,7 @@ namespace Api { id: int; }; export class EditMessage extends Request, Api.TypeUpdates> { - // flags: null; + // flags: undefined; noWebpage?: true; peer: Api.TypeInputPeer; id: int; @@ -9826,7 +9826,7 @@ namespace Api { scheduleDate?: int; }; export class EditInlineBotMessage extends Request, Bool> { - // flags: null; + // flags: undefined; noWebpage?: true; id: Api.TypeInputBotInlineMessageID; message?: string; @@ -9843,14 +9843,14 @@ namespace Api { entities?: Api.TypeMessageEntity[]; }; export class GetBotCallbackAnswer extends Request, messages.TypeBotCallbackAnswer> { - // flags: null; + // flags: undefined; game?: true; peer: Api.TypeInputPeer; msgId: int; @@ -9858,14 +9858,14 @@ namespace Api { password?: Api.TypeInputCheckPasswordSRP; }; export class SetBotCallbackAnswer extends Request, Bool> { - // flags: null; + // flags: undefined; alert?: true; queryId: long; message?: string; @@ -9878,14 +9878,14 @@ namespace Api { peers: Api.TypeInputDialogPeer[]; }; export class SaveDraft extends Request, Bool> { - // flags: null; + // flags: undefined; noWebpage?: true; replyToMsgId?: int; peer: Api.TypeInputPeer; @@ -9904,39 +9904,39 @@ namespace Api { id: long[]; }; export class GetRecentStickers extends Request, messages.TypeRecentStickers> { - // flags: null; + // flags: undefined; attached?: true; hash: int; }; export class SaveRecentSticker extends Request, Bool> { - // flags: null; + // flags: undefined; attached?: true; id: Api.TypeInputDocument; unsave: Bool; }; export class ClearRecentStickers extends Request, Bool> { - // flags: null; + // flags: undefined; attached?: true; }; export class GetArchivedStickers extends Request, messages.TypeArchivedStickers> { - // flags: null; + // flags: undefined; masks?: true; offsetId: long; limit: int; @@ -9952,7 +9952,7 @@ namespace Api { media: Api.TypeInputStickeredMedia; }; export class SetGameScore extends Request, Api.TypeUpdates> { - // flags: null; + // flags: undefined; editMessage?: true; force?: true; peer: Api.TypeInputPeer; @@ -9969,14 +9969,14 @@ namespace Api { score: int; }; export class SetInlineGameScore extends Request, Bool> { - // flags: null; + // flags: undefined; editMessage?: true; force?: true; id: Api.TypeInputBotInlineMessageID; @@ -10021,21 +10021,21 @@ namespace Api { hash: int; }; export class ToggleDialogPin extends Request, Bool> { - // flags: null; + // flags: undefined; pinned?: true; peer: Api.TypeInputDialogPeer; }; export class ReorderPinnedDialogs extends Request, Bool> { - // flags: null; + // flags: undefined; force?: true; folderId: int; order: Api.TypeInputDialogPeer[]; @@ -10046,23 +10046,23 @@ namespace Api { folderId: int; }; export class SetBotShippingResults extends Request, Bool> { - // flags: null; + // flags: undefined; queryId: long; error?: string; shippingOptions?: Api.TypeShippingOption[]; }; export class SetBotPrecheckoutResults extends Request, Bool> { - // flags: null; + // flags: undefined; success?: true; queryId: long; error?: string; @@ -10125,7 +10125,7 @@ namespace Api { hash: int; }; export class SendMultiMedia extends Request, Api.TypeUpdates> { - // flags: null; + // flags: undefined; silent?: true; background?: true; clearDraft?: true; @@ -10151,37 +10151,37 @@ namespace Api { file: Api.TypeInputEncryptedFile; }; export class SearchStickerSets extends Request, messages.TypeFoundStickerSets> { - // flags: null; + // flags: undefined; excludeFeatured?: true; q: string; hash: int; }; export class GetSplitRanges extends Request {}; export class MarkDialogUnread extends Request, Bool> { - // flags: null; + // flags: undefined; unread?: true; peer: Api.TypeInputDialogPeer; }; export class GetDialogUnreadMarks extends Request {}; export class ClearAllDrafts extends Request {}; export class UpdatePinnedMessage extends Request, Api.TypeUpdates> { - // flags: null; + // flags: undefined; silent?: true; unpin?: true; pmOneside?: true; @@ -10210,12 +10210,12 @@ namespace Api { peer: Api.TypeInputPeer; }; export class GetStatsURL extends Request, Api.TypeStatsURL> { - // flags: null; + // flags: undefined; dark?: true; peer: Api.TypeInputPeer; params: string; @@ -10264,27 +10264,27 @@ namespace Api { filters: Api.TypeMessagesFilter[]; }; export class RequestUrlAuth extends Request, Api.TypeUrlAuthResult> { - // flags: null; + // flags: undefined; peer?: Api.TypeInputPeer; msgId?: int; buttonId?: int; url?: string; }; export class AcceptUrlAuth extends Request, Api.TypeUrlAuthResult> { - // flags: null; + // flags: undefined; writeAllowed?: true; peer?: Api.TypeInputPeer; msgId?: int; @@ -10325,14 +10325,14 @@ namespace Api { id: int[]; }; export class GetPollVotes extends Request, messages.TypeVotesList> { - // flags: null; + // flags: undefined; peer: Api.TypeInputPeer; id: int; option?: bytes; @@ -10340,13 +10340,13 @@ namespace Api { limit: int; }; export class ToggleStickerSets extends Request, Bool> { - // flags: null; + // flags: undefined; uninstall?: true; archive?: true; unarchive?: true; @@ -10355,11 +10355,11 @@ namespace Api { export class GetDialogFilters extends Request {}; export class GetSuggestedDialogFilters extends Request {}; export class UpdateDialogFilter extends Request, Bool> { - // flags: null; + // flags: undefined; id: int; filter?: Api.TypeDialogFilter; }; @@ -10425,10 +10425,10 @@ namespace Api { chatId: int; }; export class DeletePhoneCallHistory extends Request, messages.TypeAffectedFoundMessages> { - // flags: null; + // flags: undefined; revoke?: true; }; export class CheckHistoryImport extends Request, messages.TypeExportedChatInvites> { - // flags: null; + // flags: undefined; revoked?: true; peer: Api.TypeInputPeer; adminId: Api.TypeInputUser; @@ -10488,14 +10488,14 @@ namespace Api { link: string; }; export class EditExportedChatInvite extends Request, messages.TypeExportedChatInvite> { - // flags: null; + // flags: undefined; revoked?: true; peer: Api.TypeInputPeer; link: string; @@ -10551,27 +10551,27 @@ namespace Api { export namespace updates { export class GetState extends Request {}; export class GetDifference extends Request, updates.TypeDifference> { - // flags: null; + // flags: undefined; pts: int; ptsTotalLimit?: int; date: int; qts: int; }; export class GetChannelDifference extends Request, updates.TypeChannelDifference> { - // flags: null; + // flags: undefined; force?: true; channel: Api.TypeInputChannel; filter: Api.TypeChannelMessagesFilter; @@ -10587,12 +10587,12 @@ namespace Api { id: Api.TypeInputPhoto; }; export class UploadProfilePhoto extends Request, photos.TypePhoto> { - // flags: null; + // flags: undefined; file?: Api.TypeInputFile; video?: Api.TypeInputFile; videoStartTs?: double; @@ -10626,14 +10626,14 @@ namespace Api { bytes: bytes; }; export class GetFile extends Request, upload.TypeFile> { - // flags: null; + // flags: undefined; precise?: true; cdnSupported?: true; location: Api.TypeInputFileLocation; @@ -10848,7 +10848,7 @@ namespace Api { channel: Api.TypeInputChannel; }; export class CreateChannel extends Request, Api.TypeUpdates> { - // flags: null; + // flags: undefined; broadcast?: true; megagroup?: true; forImport?: true; @@ -10928,13 +10928,13 @@ namespace Api { channel: Api.TypeInputChannel; }; export class ExportMessageLink extends Request, Api.TypeExportedMessageLink> { - // flags: null; + // flags: undefined; grouped?: true; thread?: true; channel: Api.TypeInputChannel; @@ -10948,11 +10948,11 @@ namespace Api { enabled: Bool; }; export class GetAdminedPublicChannels extends Request, messages.TypeChats> { - // flags: null; + // flags: undefined; byLocation?: true; checkLimit?: true; }; @@ -10966,7 +10966,7 @@ namespace Api { bannedRights: Api.TypeChatBannedRights; }; export class GetAdminLog extends Request, channels.TypeAdminLogResults> { - // flags: null; + // flags: undefined; channel: Api.TypeInputChannel; q: string; eventsFilter?: Api.TypeChannelAdminLogEventsFilter; @@ -11082,12 +11082,12 @@ namespace Api { export namespace payments { export class GetPaymentForm extends Request, payments.TypePaymentForm> { - // flags: null; + // flags: undefined; peer: Api.TypeInputPeer; msgId: int; themeParams?: Api.TypeDataJSON; @@ -11100,20 +11100,20 @@ namespace Api { msgId: int; }; export class ValidateRequestedInfo extends Request, payments.TypeValidatedRequestedInfo> { - // flags: null; + // flags: undefined; save?: true; peer: Api.TypeInputPeer; msgId: int; info: Api.TypePaymentRequestedInfo; }; export class SendPaymentForm extends Request, payments.TypePaymentResult> { - // flags: null; + // flags: undefined; formId: long; peer: Api.TypeInputPeer; msgId: int; @@ -11133,11 +11133,11 @@ namespace Api { }; export class GetSavedInfo extends Request {}; export class ClearSavedInfo extends Request, Bool> { - // flags: null; + // flags: undefined; credentials?: true; info?: true; }; @@ -11150,7 +11150,7 @@ namespace Api { export namespace stickers { export class CreateStickerSet extends Request, messages.TypeStickerSet> { - // flags: null; + // flags: undefined; masks?: true; animated?: true; userId: Api.TypeInputUser; @@ -11199,14 +11199,14 @@ namespace Api { export namespace phone { export class GetCallConfig extends Request {}; export class RequestCall extends Request, phone.TypePhoneCall> { - // flags: null; + // flags: undefined; video?: true; userId: Api.TypeInputUser; randomId: int; @@ -11239,14 +11239,14 @@ namespace Api { peer: Api.TypeInputPhoneCall; }; export class DiscardCall extends Request, Api.TypeUpdates> { - // flags: null; + // flags: undefined; video?: true; peer: Api.TypeInputPhoneCall; duration: int; @@ -11254,13 +11254,13 @@ namespace Api { connectionId: long; }; export class SetCallRating extends Request, Api.TypeUpdates> { - // flags: null; + // flags: undefined; userInitiative?: true; peer: Api.TypeInputPhoneCall; rating: int; @@ -11281,27 +11281,27 @@ namespace Api { data: bytes; }; export class CreateGroupCall extends Request, Api.TypeUpdates> { - // flags: null; + // flags: undefined; peer: Api.TypeInputPeer; randomId: int; title?: string; scheduleDate?: int; }; export class JoinGroupCall extends Request, Api.TypeUpdates> { - // flags: null; + // flags: undefined; muted?: true; call: Api.TypeInputGroupCall; joinAs: Api.TypeInputPeer; @@ -11328,12 +11328,12 @@ namespace Api { call: Api.TypeInputGroupCall; }; export class ToggleGroupCallSettings extends Request, Api.TypeUpdates> { - // flags: null; + // flags: undefined; resetInviteHash?: true; call: Api.TypeInputGroupCall; joinMuted?: Bool; @@ -11364,25 +11364,25 @@ namespace Api { source: int; }; export class ToggleGroupCallRecord extends Request, Api.TypeUpdates> { - // flags: null; + // flags: undefined; start?: true; call: Api.TypeInputGroupCall; title?: string; }; export class EditGroupCallParticipant extends Request, Api.TypeUpdates> { - // flags: null; + // flags: undefined; muted?: true; call: Api.TypeInputGroupCall; participant: Api.TypeInputPeer; @@ -11402,11 +11402,11 @@ namespace Api { peer: Api.TypeInputPeer; }; export class ExportGroupCallInvite extends Request, phone.TypeExportedGroupCallInvite> { - // flags: null; + // flags: undefined; canSelfUnmute?: true; call: Api.TypeInputGroupCall; }; @@ -11486,29 +11486,29 @@ namespace Api { export namespace stats { export class GetBroadcastStats extends Request, stats.TypeBroadcastStats> { - // flags: null; + // flags: undefined; dark?: true; channel: Api.TypeInputChannel; }; export class LoadAsyncGraph extends Request, Api.TypeStatsGraph> { - // flags: null; + // flags: undefined; token: string; x?: long; }; export class GetMegagroupStats extends Request, stats.TypeMegagroupStats> { - // flags: null; + // flags: undefined; dark?: true; channel: Api.TypeInputChannel; }; @@ -11528,12 +11528,12 @@ namespace Api { limit: int; }; export class GetMessageStats extends Request, stats.TypeMessageStats> { - // flags: null; + // flags: undefined; dark?: true; channel: Api.TypeInputChannel; msgId: int; diff --git a/src/lib/gramjs/tl/apiTl.js b/src/lib/gramjs/tl/apiTl.js index f17b64b97..79e3cbb07 100644 --- a/src/lib/gramjs/tl/apiTl.js +++ b/src/lib/gramjs/tl/apiTl.js @@ -939,6 +939,7 @@ account.sendVerifyPhoneCode#a5a356f9 phone_number:string settings:CodeSettings = account.confirmPasswordEmail#8fdf1920 code:string = Bool; account.getContactSignUpNotification#9f07c728 = Bool; account.setContactSignUpNotification#cff43f61 silent:Bool = Bool; +account.getNotifyExceptions#53577479 flags:# compare_sound:flags.1?true peer:flags.0?InputNotifyPeer = Updates; account.uploadWallPaper#dd853661 file:InputFile mime_type:string settings:WallPaperSettings = WallPaper; users.getUsers#d91a548 id:Vector = Vector; users.getFullUser#ca30a5b1 id:InputUser = UserFull; diff --git a/src/lib/gramjs/tl/static/api.reduced.tl b/src/lib/gramjs/tl/static/api.reduced.tl index 6393728d8..0bd24c42b 100644 --- a/src/lib/gramjs/tl/static/api.reduced.tl +++ b/src/lib/gramjs/tl/static/api.reduced.tl @@ -939,6 +939,7 @@ account.sendVerifyPhoneCode#a5a356f9 phone_number:string settings:CodeSettings = account.confirmPasswordEmail#8fdf1920 code:string = Bool; account.getContactSignUpNotification#9f07c728 = Bool; account.setContactSignUpNotification#cff43f61 silent:Bool = Bool; +account.getNotifyExceptions#53577479 flags:# compare_sound:flags.1?true peer:flags.0?InputNotifyPeer = Updates; account.uploadWallPaper#dd853661 file:InputFile mime_type:string settings:WallPaperSettings = WallPaper; users.getUsers#d91a548 id:Vector = Vector; users.getFullUser#ca30a5b1 id:InputUser = UserFull; diff --git a/src/modules/actions/api/settings.ts b/src/modules/actions/api/settings.ts index 2a1f99a4d..b4bb5d659 100644 --- a/src/modules/actions/api/settings.ts +++ b/src/modules/actions/api/settings.ts @@ -304,9 +304,13 @@ addReducer('terminateAllAuthorizations', () => { })(); }); -addReducer('loadNotificationsSettings', () => { +addReducer('loadNotificationExceptions', () => { + callApi('fetchNotificationExceptions'); +}); + +addReducer('loadNotificationSettings', () => { (async () => { - const result = await callApi('loadNotificationsSettings'); + const result = await callApi('fetchNotificationSettings'); if (!result) { return; } @@ -316,16 +320,16 @@ addReducer('loadNotificationsSettings', () => { }); addReducer('updateNotificationSettings', (global, actions, payload) => { - const { peerType, isSilent, isShowPreviews } = payload!; + const { peerType, isSilent, shouldShowPreviews } = payload!; (async () => { - const result = await callApi('updateNotificationSettings', peerType, { isSilent, isShowPreviews }); + const result = await callApi('updateNotificationSettings', peerType, { isSilent, shouldShowPreviews }); if (!result) { return; } - setGlobal(updateNotifySettings(getGlobal(), peerType, isSilent, isShowPreviews)); + setGlobal(updateNotifySettings(getGlobal(), peerType, isSilent, shouldShowPreviews)); })(); }); diff --git a/src/modules/actions/apiUpdaters/settings.ts b/src/modules/actions/apiUpdaters/settings.ts index 450e8df54..1993be052 100644 --- a/src/modules/actions/apiUpdaters/settings.ts +++ b/src/modules/actions/apiUpdaters/settings.ts @@ -1,13 +1,27 @@ -import { addReducer } from '../../../lib/teact/teactn'; +import { addReducer, setGlobal } from '../../../lib/teact/teactn'; import { ApiUpdate } from '../../../api/types'; import { GlobalState } from '../../../global/types'; -import { updateNotifySettings } from '../../reducers'; +import { addNotifyException, updateChat, updateNotifySettings } from '../../reducers'; addReducer('apiUpdate', (global, actions, update: ApiUpdate): GlobalState | undefined => { switch (update['@type']) { case 'updateNotifySettings': { - return updateNotifySettings(global, update.peerType, update.isSilent, update.isShowPreviews); + return updateNotifySettings(global, update.peerType, update.isSilent, update.shouldShowPreviews); + } + + case 'updateNotifyExceptions': { + const { + id, isMuted, isSilent, shouldShowPreviews, + } = update; + const chat = global.chats.byId[id]; + + if (chat) { + global = updateChat(global, id, { isMuted }); + } + + setGlobal(addNotifyException(global, id, { isMuted, isSilent, shouldShowPreviews })); + break; } } diff --git a/src/modules/helpers/chats.ts b/src/modules/helpers/chats.ts index 7bf0ec258..e482ff0f1 100644 --- a/src/modules/helpers/chats.ts +++ b/src/modules/helpers/chats.ts @@ -6,6 +6,7 @@ import { ApiChatFolder, MAIN_THREAD_ID, } from '../../api/types'; +import { NotifyException, NotifySettings } from '../../types'; import { ARCHIVED_FOLDER_ID } from '../../config'; import { orderBy } from '../../util/iteratees'; @@ -200,6 +201,17 @@ export function isChatArchived(chat: ApiChat) { return chat.folderId === ARCHIVED_FOLDER_ID; } +export function selectIsChatMuted( + chat: ApiChat, notifySettings: NotifySettings, notifyExceptions: Record, +) { + return !(notifyExceptions[chat.id] && !notifyExceptions[chat.id].isMuted) && ( + chat.isMuted + || (isChatPrivate(chat.id) && !notifySettings.hasPrivateChatsNotifications) + || (isChatChannel(chat) && !notifySettings.hasBroadcastNotifications) + || (isChatGroup(chat) && !notifySettings.hasGroupNotifications) + ); +} + export function getCanDeleteChat(chat: ApiChat) { return isChatBasicGroup(chat) || ((isChatSuperGroup(chat) || isChatChannel(chat)) && chat.isCreator); } @@ -208,6 +220,8 @@ export function prepareFolderListIds( chatsById: Record, usersById: Record, folder: ApiChatFolder, + notifySettings: NotifySettings, + notifyExceptions: Record, chatIdsCache?: number[], ) { const excludedChatIds = folder.excludedChatIds ? new Set(folder.excludedChatIds) : undefined; @@ -216,7 +230,14 @@ export function prepareFolderListIds( const listIds = (chatIdsCache || Object.keys(chatsById).map(Number)) .filter((id) => { return filterChatFolder( - chatsById[id], folder, usersById, excludedChatIds, includedChatIds, pinnedChatIds, + chatsById[id], + folder, + usersById, + notifySettings, + notifyExceptions, + excludedChatIds, + includedChatIds, + pinnedChatIds, ); }); @@ -227,6 +248,8 @@ function filterChatFolder( chat: ApiChat, folder: ApiChatFolder, usersById: Record, + notifySettings: NotifySettings, + notifyExceptions: Record, excludedChatIds?: Set, includedChatIds?: Set, pinnedChatIds?: Set, @@ -247,7 +270,7 @@ function filterChatFolder( return false; } - if (chat.isMuted && folder.excludeMuted) { + if (folder.excludeMuted && selectIsChatMuted(chat, notifySettings, notifyExceptions)) { return false; } @@ -340,9 +363,11 @@ export function getFolderUnreadDialogs( chatsById: Record, usersById: Record, folder: ApiChatFolder, + notifySettings: NotifySettings, + notifyExceptions: Record, chatIdsCache: number[], ) { - const [listIds] = prepareFolderListIds(chatsById, usersById, folder, chatIdsCache); + const [listIds] = prepareFolderListIds(chatsById, usersById, folder, notifySettings, notifyExceptions, chatIdsCache); const listedChats = listIds .map((id) => chatsById[id]) @@ -366,6 +391,8 @@ export function getFolderDescriptionText( chatsById: Record, usersById: Record, folder: ApiChatFolder, + notifySettings: NotifySettings, + notifyExceptions: Record, chatIdsCache: number[], lang: LangFn, ) { @@ -383,7 +410,7 @@ export function getFolderDescriptionText( || (excludedChatIds && excludedChatIds.length) || (includedChatIds && includedChatIds.length) ) { - const length = getFolderChatsCount(chatsById, usersById, folder, chatIdsCache); + const length = getFolderChatsCount(chatsById, usersById, folder, notifySettings, notifyExceptions, chatIdsCache); return lang('Chats', length); } @@ -407,9 +434,13 @@ function getFolderChatsCount( chatsById: Record, usersById: Record, folder: ApiChatFolder, + notifySettings: NotifySettings, + notifyExceptions: Record, chatIdsCache: number[], ) { - const [listIds, pinnedIds] = prepareFolderListIds(chatsById, usersById, folder, chatIdsCache); + const [listIds, pinnedIds] = prepareFolderListIds( + chatsById, usersById, folder, notifySettings, notifyExceptions, chatIdsCache, + ); const { pinnedChats, otherChats } = prepareChatList(chatsById, listIds, pinnedIds, 'folder'); return pinnedChats.length + otherChats.length; } diff --git a/src/modules/reducers/settings.ts b/src/modules/reducers/settings.ts index 31741fde6..82e13e8a6 100644 --- a/src/modules/reducers/settings.ts +++ b/src/modules/reducers/settings.ts @@ -1,5 +1,5 @@ import { GlobalState } from '../../global/types'; -import { ISettings } from '../../types'; +import { ISettings, NotifyException } from '../../types'; export function replaceSettings(global: GlobalState, newSettings?: Partial): GlobalState { return { @@ -14,24 +14,39 @@ export function replaceSettings(global: GlobalState, newSettings?: Partial { +export type NotifySettings = { + hasPrivateChatsNotifications?: boolean; + hasPrivateChatsMessagePreview?: boolean; + hasGroupNotifications?: boolean; + hasGroupMessagePreview?: boolean; + hasBroadcastNotifications?: boolean; + hasBroadcastMessagePreview?: boolean; + hasContactJoinedNotifications?: boolean; +}; + +export interface ISettings extends NotifySettings, Record { messageTextSize: number; customBackground?: string; patternColor?: string; @@ -37,13 +47,6 @@ export interface ISettings extends Record { shouldSuggestStickers: boolean; shouldLoopStickers: boolean; hasPassword?: boolean; - hasPrivateChatsNotifications?: boolean; - hasPrivateChatsMessagePreview?: boolean; - hasGroupNotifications?: boolean; - hasGroupMessagePreview?: boolean; - hasBroadcastNotifications?: boolean; - hasBroadcastMessagePreview?: boolean; - hasContactJoinedNotifications?: boolean; languages?: ApiLanguage[]; language: 'en' | 'fr' | 'de' | 'it' | 'pt' | 'ru' | 'es' | 'uk'; } @@ -269,3 +272,9 @@ export enum ManagementScreens { } export type ManagementType = 'user' | 'group' | 'channel'; + +export type NotifyException = { + isMuted: boolean; + isSilent?: boolean; + shouldShowPreviews?: boolean; +}; diff --git a/src/util/notifications.ts b/src/util/notifications.ts index c25fc1703..c07eb3f1b 100644 --- a/src/util/notifications.ts +++ b/src/util/notifications.ts @@ -125,14 +125,18 @@ export async function unsubscribe() { } // Load notification settings from the api -async function loadNotificationsSettings() { - const result = await callApi('loadNotificationsSettings'); +async function loadNotificationSettings() { + const [result] = await Promise.all([ + callApi('fetchNotificationSettings'), + callApi('fetchNotificationExceptions'), + ]); + if (!result) return; setGlobal(replaceSettings(getGlobal(), result)); } export async function subscribe() { - loadNotificationsSettings(); + loadNotificationSettings(); if (!checkIfPushSupported()) { // Ask for notification permissions only if service worker notifications are not supported