Refactoring: Introduce eslint-plugin-simple-import-sort plugin (#3802)
This commit is contained in:
parent
9439efa386
commit
fb614840f6
54
.eslintrc
54
.eslintrc
@ -10,6 +10,7 @@
|
|||||||
"no-async-without-await",
|
"no-async-without-await",
|
||||||
"teactn",
|
"teactn",
|
||||||
"no-null",
|
"no-null",
|
||||||
|
"simple-import-sort",
|
||||||
"react-hooks-static-deps",
|
"react-hooks-static-deps",
|
||||||
"eslint-multitab-tt"
|
"eslint-multitab-tt"
|
||||||
],
|
],
|
||||||
@ -149,7 +150,58 @@
|
|||||||
"disallowTypeAnnotations": false
|
"disallowTypeAnnotations": false
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"teactn/prefer-separate-component-file": "off"
|
"teactn/prefer-separate-component-file": "off",
|
||||||
|
"simple-import-sort/imports": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
"groups": [
|
||||||
|
// Side effect imports
|
||||||
|
["^\\u0000"],
|
||||||
|
// Lib and global imports
|
||||||
|
[
|
||||||
|
"^react",
|
||||||
|
"^@?\\w",
|
||||||
|
"dist(/.*|$)",
|
||||||
|
"^(\\.+/)+(lib/(teact|gramjs))(/.*|$)",
|
||||||
|
"^(\\.+/)+global$"
|
||||||
|
],
|
||||||
|
// Type imports
|
||||||
|
[
|
||||||
|
"^(\\.+/)+.+\\u0000$",
|
||||||
|
"^(\\.+/|\\w+/)+(types)(/.*|$)",
|
||||||
|
"^(\\.+/|\\w+/)+(types)\\u0000"
|
||||||
|
],
|
||||||
|
// Config, utils, helpers
|
||||||
|
[
|
||||||
|
"^(\\.+/)+config",
|
||||||
|
"^(\\.+/)+(lib)(?!/(gramjs|teact))(/.*|$)",
|
||||||
|
"^(\\.+/)+global/.+",
|
||||||
|
"^(\\.+/)+(util)(/.*|$)",
|
||||||
|
"^\\.\\.(?!/?$)",
|
||||||
|
"^\\.\\./?$",
|
||||||
|
"^\\./(?=.*/)(?!/?$)",
|
||||||
|
"^\\.(?!/?$)",
|
||||||
|
"^\\./?$"
|
||||||
|
],
|
||||||
|
// Hooks
|
||||||
|
[
|
||||||
|
".+(/hooks/)(.*|$)"
|
||||||
|
],
|
||||||
|
// Components
|
||||||
|
[
|
||||||
|
"\/[A-Z](([a-z]+[A-Z]?)*)"
|
||||||
|
],
|
||||||
|
// Styles and CSS modules
|
||||||
|
[
|
||||||
|
"^.+\\.s?css$"
|
||||||
|
],
|
||||||
|
// Assets: images, stickers, etc
|
||||||
|
[
|
||||||
|
"^(\\.+/)+(assets)(/.*|$)"
|
||||||
|
]
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"settings": {
|
"settings": {
|
||||||
"import/resolver": "webpack",
|
"import/resolver": "webpack",
|
||||||
|
|||||||
241
package-lock.json
generated
241
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -108,6 +108,7 @@
|
|||||||
"eslint-plugin-react": "^7.32.2",
|
"eslint-plugin-react": "^7.32.2",
|
||||||
"eslint-plugin-react-hooks": "^4.6.0",
|
"eslint-plugin-react-hooks": "^4.6.0",
|
||||||
"eslint-plugin-react-hooks-static-deps": "^1.0.7",
|
"eslint-plugin-react-hooks-static-deps": "^1.0.7",
|
||||||
|
"eslint-plugin-simple-import-sort": "^10.0.0",
|
||||||
"eslint-plugin-teactn": "git+https://github.com/korenskoy/eslint-plugin-teactn#c2c39dd005d58c07c24c4361de804dce1c6261b5",
|
"eslint-plugin-teactn": "git+https://github.com/korenskoy/eslint-plugin-teactn#c2c39dd005d58c07c24c4361de804dce1c6261b5",
|
||||||
"git-revision-webpack-plugin": "^5.0.0",
|
"git-revision-webpack-plugin": "^5.0.0",
|
||||||
"gitlog": "^4.0.4",
|
"gitlog": "^4.0.4",
|
||||||
|
|||||||
@ -1,16 +1,18 @@
|
|||||||
/* eslint-disable @typescript-eslint/naming-convention */
|
/* eslint-disable @typescript-eslint/naming-convention */
|
||||||
import BigInt from 'big-integer';
|
import BigInt from 'big-integer';
|
||||||
import localDb from '../localDb';
|
|
||||||
import { Api as GramJs } from '../../../lib/gramjs';
|
import { Api as GramJs } from '../../../lib/gramjs';
|
||||||
import type { ApiAppConfig } from '../../types';
|
|
||||||
import type { ApiLimitType } from '../../../global/types';
|
import type { ApiLimitType } from '../../../global/types';
|
||||||
import { buildJson } from './misc';
|
import type { ApiAppConfig } from '../../types';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
DEFAULT_LIMITS,
|
DEFAULT_LIMITS,
|
||||||
SERVICE_NOTIFICATIONS_USER_ID,
|
SERVICE_NOTIFICATIONS_USER_ID,
|
||||||
STORY_EXPIRE_PERIOD,
|
STORY_EXPIRE_PERIOD,
|
||||||
STORY_VIEWERS_EXPIRE_PERIOD,
|
STORY_VIEWERS_EXPIRE_PERIOD,
|
||||||
} from '../../../config';
|
} from '../../../config';
|
||||||
|
import localDb from '../localDb';
|
||||||
|
import { buildJson } from './misc';
|
||||||
|
|
||||||
type LimitType = 'default' | 'premium';
|
type LimitType = 'default' | 'premium';
|
||||||
type Limit = 'upload_max_fileparts' | 'stickers_faved_limit' | 'saved_gifs_limit' | 'dialog_filters_chats_limit' |
|
type Limit = 'upload_max_fileparts' | 'stickers_faved_limit' | 'saved_gifs_limit' | 'dialog_filters_chats_limit' |
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
import { Api as GramJs } from '../../../lib/gramjs';
|
import { Api as GramJs } from '../../../lib/gramjs';
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
ApiAttachBot,
|
ApiAttachBot,
|
||||||
ApiAttachBotIcon,
|
ApiAttachBotIcon,
|
||||||
@ -15,12 +16,12 @@ import type {
|
|||||||
} from '../../types';
|
} from '../../types';
|
||||||
|
|
||||||
import { pick } from '../../../util/iteratees';
|
import { pick } from '../../../util/iteratees';
|
||||||
import { buildApiPhoto, buildApiThumbnailFromStripped } from './common';
|
|
||||||
import { buildApiDocument, buildApiWebDocument, buildVideoFromDocument } from './messageContent';
|
|
||||||
import { buildStickerFromDocument } from './symbols';
|
|
||||||
import localDb from '../localDb';
|
import localDb from '../localDb';
|
||||||
import { buildApiPeerId } from './peers';
|
import { buildApiPhoto, buildApiThumbnailFromStripped } from './common';
|
||||||
import { omitVirtualClassFields } from './helpers';
|
import { omitVirtualClassFields } from './helpers';
|
||||||
|
import { buildApiDocument, buildApiWebDocument, buildVideoFromDocument } from './messageContent';
|
||||||
|
import { buildApiPeerId } from './peers';
|
||||||
|
import { buildStickerFromDocument } from './symbols';
|
||||||
|
|
||||||
export function buildApiBotInlineResult(result: GramJs.BotInlineResult, queryId: string): ApiBotInlineResult {
|
export function buildApiBotInlineResult(result: GramJs.BotInlineResult, queryId: string): ApiBotInlineResult {
|
||||||
const {
|
const {
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
import { Api as GramJs } from '../../../lib/gramjs';
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
ApiCallProtocol,
|
ApiCallProtocol,
|
||||||
ApiPhoneCallConnection,
|
ApiPhoneCallConnection,
|
||||||
@ -5,8 +7,8 @@ import type {
|
|||||||
GroupCallParticipantVideo,
|
GroupCallParticipantVideo,
|
||||||
SsrcGroup,
|
SsrcGroup,
|
||||||
} from '../../../lib/secret-sauce';
|
} from '../../../lib/secret-sauce';
|
||||||
import { Api as GramJs } from '../../../lib/gramjs';
|
|
||||||
import type { ApiGroupCall, ApiPhoneCall } from '../../types';
|
import type { ApiGroupCall, ApiPhoneCall } from '../../types';
|
||||||
|
|
||||||
import { getApiChatIdFromMtpPeer, isPeerUser } from './peers';
|
import { getApiChatIdFromMtpPeer, isPeerUser } from './peers';
|
||||||
|
|
||||||
export function buildApiGroupCallParticipant(participant: GramJs.GroupCallParticipant): GroupCallParticipant {
|
export function buildApiGroupCallParticipant(participant: GramJs.GroupCallParticipant): GroupCallParticipant {
|
||||||
|
|||||||
@ -1,30 +1,32 @@
|
|||||||
import type BigInt from 'big-integer';
|
import type BigInt from 'big-integer';
|
||||||
import { Api as GramJs } from '../../../lib/gramjs';
|
import { Api as GramJs } from '../../../lib/gramjs';
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
|
ApiBotCommand,
|
||||||
ApiChat,
|
ApiChat,
|
||||||
ApiChatAdminRights,
|
ApiChatAdminRights,
|
||||||
ApiChatBannedRights,
|
ApiChatBannedRights,
|
||||||
ApiBotCommand,
|
|
||||||
ApiChatFolder,
|
ApiChatFolder,
|
||||||
ApiChatMember,
|
|
||||||
ApiRestrictionReason,
|
|
||||||
ApiExportedInvite,
|
|
||||||
ApiChatInviteImporter,
|
ApiChatInviteImporter,
|
||||||
ApiChatSettings,
|
|
||||||
ApiTopic,
|
|
||||||
ApiSendAsPeerId,
|
|
||||||
ApiChatReactions,
|
|
||||||
ApiChatlistInvite,
|
|
||||||
ApiChatlistExportedInvite,
|
ApiChatlistExportedInvite,
|
||||||
|
ApiChatlistInvite,
|
||||||
|
ApiChatMember,
|
||||||
|
ApiChatReactions,
|
||||||
|
ApiChatSettings,
|
||||||
|
ApiExportedInvite,
|
||||||
|
ApiRestrictionReason,
|
||||||
|
ApiSendAsPeerId,
|
||||||
|
ApiTopic,
|
||||||
} from '../../types';
|
} from '../../types';
|
||||||
|
|
||||||
import { pick, pickTruthy } from '../../../util/iteratees';
|
import { pick, pickTruthy } from '../../../util/iteratees';
|
||||||
|
import { getServerTime, getServerTimeOffset } from '../../../util/serverTime';
|
||||||
|
import { buildApiUsernames } from './common';
|
||||||
|
import { omitVirtualClassFields } from './helpers';
|
||||||
import {
|
import {
|
||||||
buildApiPeerId, getApiChatIdFromMtpPeer, isPeerChat, isPeerUser,
|
buildApiPeerId, getApiChatIdFromMtpPeer, isPeerChat, isPeerUser,
|
||||||
} from './peers';
|
} from './peers';
|
||||||
import { omitVirtualClassFields } from './helpers';
|
|
||||||
import { getServerTime, getServerTimeOffset } from '../../../util/serverTime';
|
|
||||||
import { buildApiReaction } from './reactions';
|
import { buildApiReaction } from './reactions';
|
||||||
import { buildApiUsernames } from './common';
|
|
||||||
|
|
||||||
type PeerEntityApiChatFields = Omit<ApiChat, (
|
type PeerEntityApiChatFields = Omit<ApiChat, (
|
||||||
'id' | 'type' | 'title' |
|
'id' | 'type' | 'title' |
|
||||||
|
|||||||
@ -1,23 +1,24 @@
|
|||||||
import { Api as GramJs } from '../../../lib/gramjs';
|
import { Api as GramJs } from '../../../lib/gramjs';
|
||||||
import { strippedPhotoToJpg } from '../../../lib/gramjs/Utils';
|
import { strippedPhotoToJpg } from '../../../lib/gramjs/Utils';
|
||||||
|
|
||||||
|
import type { ApiPrivacySettings, PrivacyVisibility } from '../../../types';
|
||||||
import type {
|
import type {
|
||||||
ApiPhoto,
|
|
||||||
ApiPhotoSize,
|
|
||||||
ApiThumbnail,
|
|
||||||
ApiVideoSize,
|
|
||||||
ApiUsername,
|
|
||||||
ApiFormattedText,
|
ApiFormattedText,
|
||||||
ApiMessageEntity,
|
ApiMessageEntity,
|
||||||
ApiMessageEntityDefault,
|
ApiMessageEntityDefault,
|
||||||
|
ApiPhoto,
|
||||||
|
ApiPhotoSize,
|
||||||
|
ApiThumbnail,
|
||||||
|
ApiUsername,
|
||||||
|
ApiVideoSize,
|
||||||
} from '../../types';
|
} from '../../types';
|
||||||
import {
|
import {
|
||||||
ApiMessageEntityTypes,
|
ApiMessageEntityTypes,
|
||||||
} from '../../types';
|
} from '../../types';
|
||||||
import type { ApiPrivacySettings, PrivacyVisibility } from '../../../types';
|
|
||||||
|
|
||||||
|
import { compact } from '../../../util/iteratees';
|
||||||
import { bytesToDataUri } from './helpers';
|
import { bytesToDataUri } from './helpers';
|
||||||
import { pathBytesToSvg } from './pathBytesToSvg';
|
import { pathBytesToSvg } from './pathBytesToSvg';
|
||||||
import { compact } from '../../../util/iteratees';
|
|
||||||
import { buildApiPeerId } from './peers';
|
import { buildApiPeerId } from './peers';
|
||||||
|
|
||||||
const DEFAULT_THUMB_SIZE = { w: 100, h: 100 };
|
const DEFAULT_THUMB_SIZE = { w: 100, h: 100 };
|
||||||
|
|||||||
@ -1,24 +1,24 @@
|
|||||||
import { Api as GramJs } from '../../../lib/gramjs';
|
import { Api as GramJs } from '../../../lib/gramjs';
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
ApiFormattedText,
|
ApiAudio,
|
||||||
ApiMessage,
|
|
||||||
ApiWebPage,
|
|
||||||
ApiWebPageStoryData,
|
|
||||||
ApiWebDocument,
|
|
||||||
ApiMessageExtendedMediaPreview,
|
|
||||||
ApiPoll,
|
|
||||||
ApiInvoice,
|
|
||||||
ApiGame,
|
|
||||||
ApiLocation,
|
|
||||||
ApiContact,
|
ApiContact,
|
||||||
ApiDocument,
|
ApiDocument,
|
||||||
ApiVoice,
|
ApiFormattedText,
|
||||||
ApiAudio,
|
ApiGame,
|
||||||
ApiVideo,
|
ApiInvoice,
|
||||||
ApiPhoto,
|
ApiLocation,
|
||||||
ApiSticker,
|
ApiMessage,
|
||||||
|
ApiMessageExtendedMediaPreview,
|
||||||
ApiMessageStoryData,
|
ApiMessageStoryData,
|
||||||
|
ApiPhoto,
|
||||||
|
ApiPoll,
|
||||||
|
ApiSticker,
|
||||||
|
ApiVideo,
|
||||||
|
ApiVoice,
|
||||||
|
ApiWebDocument,
|
||||||
|
ApiWebPage,
|
||||||
|
ApiWebPageStoryData,
|
||||||
} from '../../types';
|
} from '../../types';
|
||||||
import type { UniversalMessage } from './messages';
|
import type { UniversalMessage } from './messages';
|
||||||
|
|
||||||
|
|||||||
@ -1,26 +1,27 @@
|
|||||||
import { Api as GramJs } from '../../../lib/gramjs';
|
import { Api as GramJs } from '../../../lib/gramjs';
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
ApiMessage,
|
|
||||||
ApiMessageForwardInfo,
|
|
||||||
ApiPhoto,
|
|
||||||
ApiSticker,
|
|
||||||
ApiVideo,
|
|
||||||
ApiAction,
|
ApiAction,
|
||||||
ApiContact,
|
|
||||||
ApiAttachment,
|
ApiAttachment,
|
||||||
ApiNewPoll,
|
|
||||||
ApiMessageEntity,
|
|
||||||
ApiReplyKeyboard,
|
|
||||||
ApiKeyboardButton,
|
|
||||||
ApiChat,
|
ApiChat,
|
||||||
ApiThreadInfo,
|
ApiContact,
|
||||||
ApiGroupCall,
|
ApiGroupCall,
|
||||||
|
ApiKeyboardButton,
|
||||||
|
ApiMessage,
|
||||||
|
ApiMessageEntity,
|
||||||
|
ApiMessageForwardInfo,
|
||||||
|
ApiNewPoll,
|
||||||
|
ApiPhoto,
|
||||||
|
ApiReplyKeyboard,
|
||||||
ApiSponsoredMessage,
|
ApiSponsoredMessage,
|
||||||
ApiUser,
|
ApiSticker,
|
||||||
PhoneCallAction,
|
|
||||||
ApiTypeReplyTo,
|
|
||||||
ApiStory,
|
ApiStory,
|
||||||
ApiStorySkipped,
|
ApiStorySkipped,
|
||||||
|
ApiThreadInfo,
|
||||||
|
ApiTypeReplyTo,
|
||||||
|
ApiUser,
|
||||||
|
ApiVideo,
|
||||||
|
PhoneCallAction,
|
||||||
} from '../../types';
|
} from '../../types';
|
||||||
import {
|
import {
|
||||||
ApiMessageEntityTypes,
|
ApiMessageEntityTypes,
|
||||||
@ -34,13 +35,9 @@ import {
|
|||||||
SUPPORTED_IMAGE_CONTENT_TYPES,
|
SUPPORTED_IMAGE_CONTENT_TYPES,
|
||||||
SUPPORTED_VIDEO_CONTENT_TYPES,
|
SUPPORTED_VIDEO_CONTENT_TYPES,
|
||||||
} from '../../../config';
|
} from '../../../config';
|
||||||
import { pick } from '../../../util/iteratees';
|
|
||||||
import { getEmojiOnlyCountForMessage } from '../../../global/helpers/getEmojiOnlyCountForMessage';
|
import { getEmojiOnlyCountForMessage } from '../../../global/helpers/getEmojiOnlyCountForMessage';
|
||||||
|
import { pick } from '../../../util/iteratees';
|
||||||
import { getServerTime, getServerTimeOffset } from '../../../util/serverTime';
|
import { getServerTime, getServerTimeOffset } from '../../../util/serverTime';
|
||||||
import { buildMessageContent, buildMessageTextContent } from './messageContent';
|
|
||||||
import {
|
|
||||||
buildApiPhoto,
|
|
||||||
} from './common';
|
|
||||||
import { interpolateArray } from '../../../util/waveform';
|
import { interpolateArray } from '../../../util/waveform';
|
||||||
import { buildPeer } from '../gramjsBuilders';
|
import { buildPeer } from '../gramjsBuilders';
|
||||||
import {
|
import {
|
||||||
@ -48,9 +45,13 @@ import {
|
|||||||
resolveMessageApiChatId,
|
resolveMessageApiChatId,
|
||||||
serializeBytes,
|
serializeBytes,
|
||||||
} from '../helpers';
|
} from '../helpers';
|
||||||
|
import { buildApiCallDiscardReason } from './calls';
|
||||||
|
import {
|
||||||
|
buildApiPhoto,
|
||||||
|
} from './common';
|
||||||
|
import { buildMessageContent, buildMessageTextContent } from './messageContent';
|
||||||
import { buildApiPeerId, getApiChatIdFromMtpPeer, isPeerUser } from './peers';
|
import { buildApiPeerId, getApiChatIdFromMtpPeer, isPeerUser } from './peers';
|
||||||
import { buildMessageReactions } from './reactions';
|
import { buildMessageReactions } from './reactions';
|
||||||
import { buildApiCallDiscardReason } from './calls';
|
|
||||||
|
|
||||||
const LOCAL_MESSAGES_LIMIT = 1e6; // 1M
|
const LOCAL_MESSAGES_LIMIT = 1e6; // 1M
|
||||||
|
|
||||||
|
|||||||
@ -1,18 +1,19 @@
|
|||||||
import { Api as GramJs } from '../../../lib/gramjs';
|
import { Api as GramJs } from '../../../lib/gramjs';
|
||||||
|
|
||||||
import type {
|
|
||||||
ApiConfig, ApiCountry, ApiSession, ApiUrlAuthResult, ApiWallpaper, ApiWebSession, ApiLangString,
|
|
||||||
} from '../../types';
|
|
||||||
import type { ApiPrivacyKey } from '../../../types';
|
import type { ApiPrivacyKey } from '../../../types';
|
||||||
|
import type {
|
||||||
|
ApiConfig, ApiCountry, ApiLangString,
|
||||||
|
ApiSession, ApiUrlAuthResult, ApiWallpaper, ApiWebSession,
|
||||||
|
} from '../../types';
|
||||||
|
|
||||||
import { buildApiReaction } from './reactions';
|
|
||||||
import { buildApiDocument } from './messageContent';
|
|
||||||
import { buildApiPeerId, getApiChatIdFromMtpPeer } from './peers';
|
|
||||||
import { omit, pick } from '../../../util/iteratees';
|
import { omit, pick } from '../../../util/iteratees';
|
||||||
import { getServerTime } from '../../../util/serverTime';
|
import { getServerTime } from '../../../util/serverTime';
|
||||||
import { buildApiUser } from './users';
|
|
||||||
import { addUserToLocalDb } from '../helpers';
|
import { addUserToLocalDb } from '../helpers';
|
||||||
import { omitVirtualClassFields } from './helpers';
|
import { omitVirtualClassFields } from './helpers';
|
||||||
|
import { buildApiDocument } from './messageContent';
|
||||||
|
import { buildApiPeerId, getApiChatIdFromMtpPeer } from './peers';
|
||||||
|
import { buildApiReaction } from './reactions';
|
||||||
|
import { buildApiUser } from './users';
|
||||||
|
|
||||||
export function buildApiWallpaper(wallpaper: GramJs.TypeWallPaper): ApiWallpaper | undefined {
|
export function buildApiWallpaper(wallpaper: GramJs.TypeWallPaper): ApiWallpaper | undefined {
|
||||||
if (wallpaper instanceof GramJs.WallPaperNoFile) {
|
if (wallpaper instanceof GramJs.WallPaperNoFile) {
|
||||||
|
|||||||
@ -1,13 +1,13 @@
|
|||||||
import type { Api as GramJs } from '../../../lib/gramjs';
|
import type { Api as GramJs } from '../../../lib/gramjs';
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
ApiInvoice, ApiPaymentSavedInfo, ApiPremiumPromo, ApiPremiumSubscriptionOption,
|
ApiInvoice, ApiLabeledPrice, ApiPaymentCredentials,
|
||||||
ApiPaymentForm, ApiReceipt, ApiLabeledPrice, ApiPaymentCredentials,
|
ApiPaymentForm, ApiPaymentSavedInfo, ApiPremiumPromo, ApiPremiumSubscriptionOption,
|
||||||
|
ApiReceipt,
|
||||||
} from '../../types';
|
} from '../../types';
|
||||||
|
|
||||||
import { buildApiDocument, buildApiWebDocument } from './messageContent';
|
|
||||||
import { buildApiMessageEntity } from './common';
|
import { buildApiMessageEntity } from './common';
|
||||||
import { omitVirtualClassFields } from './helpers';
|
import { omitVirtualClassFields } from './helpers';
|
||||||
|
import { buildApiDocument, buildApiWebDocument } from './messageContent';
|
||||||
|
|
||||||
export function buildShippingOptions(shippingOptions: GramJs.ShippingOption[] | undefined) {
|
export function buildShippingOptions(shippingOptions: GramJs.ShippingOption[] | undefined) {
|
||||||
if (!shippingOptions) {
|
if (!shippingOptions) {
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
import { Api as GramJs } from '../../../lib/gramjs';
|
import { Api as GramJs } from '../../../lib/gramjs';
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
ApiAvailableReaction,
|
ApiAvailableReaction,
|
||||||
ApiPeerReaction,
|
ApiPeerReaction,
|
||||||
@ -7,6 +8,7 @@ import type {
|
|||||||
ApiReactionEmoji,
|
ApiReactionEmoji,
|
||||||
ApiReactions,
|
ApiReactions,
|
||||||
} from '../../types';
|
} from '../../types';
|
||||||
|
|
||||||
import { buildApiDocument } from './messageContent';
|
import { buildApiDocument } from './messageContent';
|
||||||
import { getApiChatIdFromMtpPeer } from './peers';
|
import { getApiChatIdFromMtpPeer } from './peers';
|
||||||
|
|
||||||
|
|||||||
@ -2,13 +2,14 @@ import type { Api as GramJs } from '../../../lib/gramjs';
|
|||||||
import type {
|
import type {
|
||||||
ApiChannelStatistics,
|
ApiChannelStatistics,
|
||||||
ApiGroupStatistics,
|
ApiGroupStatistics,
|
||||||
ApiMessageStatistics,
|
|
||||||
ApiMessagePublicForward,
|
ApiMessagePublicForward,
|
||||||
|
ApiMessageStatistics,
|
||||||
StatisticsGraph,
|
StatisticsGraph,
|
||||||
StatisticsOverviewItem,
|
StatisticsOverviewItem,
|
||||||
StatisticsOverviewPercentage,
|
StatisticsOverviewPercentage,
|
||||||
StatisticsOverviewPeriod,
|
StatisticsOverviewPeriod,
|
||||||
} from '../../types';
|
} from '../../types';
|
||||||
|
|
||||||
import { buildAvatarHash } from './chats';
|
import { buildAvatarHash } from './chats';
|
||||||
import { buildApiPeerId } from './peers';
|
import { buildApiPeerId } from './peers';
|
||||||
|
|
||||||
|
|||||||
@ -5,9 +5,9 @@ import type {
|
|||||||
} from '../../types';
|
} from '../../types';
|
||||||
|
|
||||||
import { buildCollectionByCallback } from '../../../util/iteratees';
|
import { buildCollectionByCallback } from '../../../util/iteratees';
|
||||||
import { buildApiPeerId } from './peers';
|
|
||||||
import { buildPrivacyRules } from './common';
|
import { buildPrivacyRules } from './common';
|
||||||
import { buildGeoPoint, buildMessageMediaContent, buildMessageTextContent } from './messageContent';
|
import { buildGeoPoint, buildMessageMediaContent, buildMessageTextContent } from './messageContent';
|
||||||
|
import { buildApiPeerId } from './peers';
|
||||||
import { buildApiReaction } from './reactions';
|
import { buildApiReaction } from './reactions';
|
||||||
|
|
||||||
export function buildApiStory(userId: string, story: GramJs.TypeStoryItem): ApiTypeStory {
|
export function buildApiStory(userId: string, story: GramJs.TypeStoryItem): ApiTypeStory {
|
||||||
|
|||||||
@ -1,11 +1,12 @@
|
|||||||
import { Api as GramJs } from '../../../lib/gramjs';
|
import { Api as GramJs } from '../../../lib/gramjs';
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
ApiEmojiInteraction, ApiStickerSetInfo, ApiSticker, ApiStickerSet, GramJsEmojiInteraction,
|
ApiEmojiInteraction, ApiSticker, ApiStickerSet, ApiStickerSetInfo, GramJsEmojiInteraction,
|
||||||
} from '../../types';
|
} from '../../types';
|
||||||
|
|
||||||
import { buildApiThumbnailFromCached, buildApiThumbnailFromPath } from './common';
|
|
||||||
import localDb from '../localDb';
|
|
||||||
import { compact } from '../../../util/iteratees';
|
import { compact } from '../../../util/iteratees';
|
||||||
|
import localDb from '../localDb';
|
||||||
|
import { buildApiThumbnailFromCached, buildApiThumbnailFromPath } from './common';
|
||||||
|
|
||||||
const LOTTIE_STICKER_MIME_TYPE = 'application/x-tgsticker';
|
const LOTTIE_STICKER_MIME_TYPE = 'application/x-tgsticker';
|
||||||
const VIDEO_STICKER_MIME_TYPE = 'video/webm';
|
const VIDEO_STICKER_MIME_TYPE = 'video/webm';
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
import { Api as GramJs } from '../../../lib/gramjs';
|
import { Api as GramJs } from '../../../lib/gramjs';
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
ApiEmojiStatus,
|
ApiEmojiStatus,
|
||||||
ApiPremiumGiftOption,
|
ApiPremiumGiftOption,
|
||||||
@ -7,9 +8,10 @@ import type {
|
|||||||
ApiUserStatus,
|
ApiUserStatus,
|
||||||
ApiUserType,
|
ApiUserType,
|
||||||
} from '../../types';
|
} from '../../types';
|
||||||
import { buildApiPeerId } from './peers';
|
|
||||||
import { buildApiBotInfo } from './bots';
|
import { buildApiBotInfo } from './bots';
|
||||||
import { buildApiPhoto, buildApiUsernames } from './common';
|
import { buildApiPhoto, buildApiUsernames } from './common';
|
||||||
|
import { buildApiPeerId } from './peers';
|
||||||
|
|
||||||
export function buildApiUserFullInfo(mtpUserFull: GramJs.users.UserFull): ApiUserFullInfo {
|
export function buildApiUserFullInfo(mtpUserFull: GramJs.users.UserFull): ApiUserFullInfo {
|
||||||
const {
|
const {
|
||||||
|
|||||||
@ -1,41 +1,41 @@
|
|||||||
import BigInt from 'big-integer';
|
import BigInt from 'big-integer';
|
||||||
import { Api as GramJs } from '../../../lib/gramjs';
|
import { Api as GramJs } from '../../../lib/gramjs';
|
||||||
|
import { generateRandomBytes, readBigIntFromBuffer } from '../../../lib/gramjs/Helpers';
|
||||||
|
|
||||||
import type { ApiPrivacyKey, PrivacyVisibility } from '../../../types';
|
import type { ApiPrivacyKey, PrivacyVisibility } from '../../../types';
|
||||||
|
|
||||||
import { generateRandomBytes, readBigIntFromBuffer } from '../../../lib/gramjs/Helpers';
|
|
||||||
import type {
|
import type {
|
||||||
|
ApiBotApp,
|
||||||
ApiChatAdminRights,
|
ApiChatAdminRights,
|
||||||
ApiChatBannedRights,
|
ApiChatBannedRights,
|
||||||
ApiChatFolder,
|
ApiChatFolder,
|
||||||
|
ApiChatReactions,
|
||||||
|
ApiFormattedText,
|
||||||
ApiGroupCall,
|
ApiGroupCall,
|
||||||
ApiMessageEntity,
|
ApiMessageEntity,
|
||||||
ApiNewPoll,
|
ApiNewPoll,
|
||||||
ApiPhoto,
|
|
||||||
ApiPhoneCall,
|
ApiPhoneCall,
|
||||||
|
ApiPhoto,
|
||||||
|
ApiPoll,
|
||||||
|
ApiReaction,
|
||||||
ApiReportReason,
|
ApiReportReason,
|
||||||
|
ApiRequestInputInvoice,
|
||||||
ApiSendMessageAction,
|
ApiSendMessageAction,
|
||||||
ApiSticker,
|
ApiSticker,
|
||||||
ApiVideo,
|
|
||||||
ApiThemeParameters,
|
|
||||||
ApiPoll,
|
|
||||||
ApiRequestInputInvoice,
|
|
||||||
ApiChatReactions,
|
|
||||||
ApiReaction,
|
|
||||||
ApiFormattedText,
|
|
||||||
ApiBotApp,
|
|
||||||
ApiStory,
|
ApiStory,
|
||||||
ApiStorySkipped,
|
ApiStorySkipped,
|
||||||
ApiUser,
|
ApiThemeParameters,
|
||||||
ApiTypeReplyTo,
|
ApiTypeReplyTo,
|
||||||
|
ApiUser,
|
||||||
|
ApiVideo,
|
||||||
} from '../../types';
|
} from '../../types';
|
||||||
import {
|
import {
|
||||||
ApiMessageEntityTypes,
|
ApiMessageEntityTypes,
|
||||||
} from '../../types';
|
} from '../../types';
|
||||||
import localDb from '../localDb';
|
|
||||||
|
import { DEFAULT_STATUS_ICON_ID } from '../../../config';
|
||||||
import { pick } from '../../../util/iteratees';
|
import { pick } from '../../../util/iteratees';
|
||||||
import { deserializeBytes } from '../helpers';
|
import { deserializeBytes } from '../helpers';
|
||||||
import { DEFAULT_STATUS_ICON_ID } from '../../../config';
|
import localDb from '../localDb';
|
||||||
|
|
||||||
const CHANNEL_ID_MIN_LENGTH = 11; // Example: -1000000000
|
const CHANNEL_ID_MIN_LENGTH = 11; // Example: -1000000000
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
import { Api as GramJs } from '../../lib/gramjs';
|
import { Api as GramJs } from '../../lib/gramjs';
|
||||||
import localDb from './localDb';
|
|
||||||
import type { StoryRepairInfo } from './localDb';
|
import type { StoryRepairInfo } from './localDb';
|
||||||
|
|
||||||
import { buildApiPeerId, getApiChatIdFromMtpPeer } from './apiBuilders/peers';
|
import { buildApiPeerId, getApiChatIdFromMtpPeer } from './apiBuilders/peers';
|
||||||
|
import localDb from './localDb';
|
||||||
|
|
||||||
const LOG_BACKGROUND = '#111111DD';
|
const LOG_BACKGROUND = '#111111DD';
|
||||||
const LOG_PREFIX_COLOR = '#E4D00A';
|
const LOG_PREFIX_COLOR = '#E4D00A';
|
||||||
|
|||||||
@ -1,9 +1,11 @@
|
|||||||
import BigInt from 'big-integer';
|
import BigInt from 'big-integer';
|
||||||
import type { Api as GramJs } from '../../lib/gramjs';
|
|
||||||
import { omitVirtualClassFields } from './apiBuilders/helpers';
|
|
||||||
import { DATA_BROADCAST_CHANNEL_NAME } from '../../config';
|
|
||||||
import { constructors } from '../../lib/gramjs/tl';
|
import { constructors } from '../../lib/gramjs/tl';
|
||||||
|
|
||||||
|
import type { Api as GramJs } from '../../lib/gramjs';
|
||||||
|
|
||||||
|
import { DATA_BROADCAST_CHANNEL_NAME } from '../../config';
|
||||||
import { throttle } from '../../util/schedulers';
|
import { throttle } from '../../util/schedulers';
|
||||||
|
import { omitVirtualClassFields } from './apiBuilders/helpers';
|
||||||
|
|
||||||
// eslint-disable-next-line no-restricted-globals
|
// eslint-disable-next-line no-restricted-globals
|
||||||
const IS_MULTITAB_SUPPORTED = 'BroadcastChannel' in self;
|
const IS_MULTITAB_SUPPORTED = 'BroadcastChannel' in self;
|
||||||
|
|||||||
@ -1,10 +1,12 @@
|
|||||||
import BigInt from 'big-integer';
|
import BigInt from 'big-integer';
|
||||||
|
import { Api as GramJs } from '../../../lib/gramjs';
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
ApiChat, ApiPhoto, ApiReportReason, ApiUser,
|
ApiChat, ApiPhoto, ApiReportReason, ApiUser,
|
||||||
} from '../../types';
|
} from '../../types';
|
||||||
|
|
||||||
|
import { buildInputPeer, buildInputPhoto, buildInputReportReason } from '../gramjsBuilders';
|
||||||
import { invokeRequest } from './client';
|
import { invokeRequest } from './client';
|
||||||
import { Api as GramJs } from '../../../lib/gramjs';
|
|
||||||
import { buildInputPeer, buildInputReportReason, buildInputPhoto } from '../gramjsBuilders';
|
|
||||||
|
|
||||||
export async function reportPeer({
|
export async function reportPeer({
|
||||||
peer,
|
peer,
|
||||||
|
|||||||
@ -1,10 +1,11 @@
|
|||||||
import { errors } from '../../../lib/gramjs';
|
import { errors } from '../../../lib/gramjs';
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
ApiUpdateAuthorizationState,
|
ApiUpdateAuthorizationState,
|
||||||
ApiUpdateAuthorizationStateType,
|
ApiUpdateAuthorizationStateType,
|
||||||
OnApiUpdate,
|
|
||||||
ApiUser,
|
ApiUser,
|
||||||
ApiUserFullInfo,
|
ApiUserFullInfo,
|
||||||
|
OnApiUpdate,
|
||||||
} from '../../types';
|
} from '../../types';
|
||||||
|
|
||||||
import { DEBUG } from '../../../config';
|
import { DEBUG } from '../../../config';
|
||||||
|
|||||||
@ -6,18 +6,8 @@ import type {
|
|||||||
ApiChat, ApiThemeParameters, ApiUser, OnApiUpdate,
|
ApiChat, ApiThemeParameters, ApiUser, OnApiUpdate,
|
||||||
} from '../../types';
|
} from '../../types';
|
||||||
|
|
||||||
import localDb from '../localDb';
|
|
||||||
import { WEB_APP_PLATFORM } from '../../../config';
|
import { WEB_APP_PLATFORM } from '../../../config';
|
||||||
import { invokeRequest } from './client';
|
import { buildCollectionByKey } from '../../../util/iteratees';
|
||||||
import {
|
|
||||||
buildInputBotApp,
|
|
||||||
buildInputEntity,
|
|
||||||
buildInputPeer,
|
|
||||||
buildInputReplyToMessage,
|
|
||||||
buildInputThemeParams,
|
|
||||||
generateRandomBigInt,
|
|
||||||
} from '../gramjsBuilders';
|
|
||||||
import { buildApiUser } from '../apiBuilders/users';
|
|
||||||
import {
|
import {
|
||||||
buildApiAttachBot,
|
buildApiAttachBot,
|
||||||
buildApiBotApp,
|
buildApiBotApp,
|
||||||
@ -27,10 +17,20 @@ import {
|
|||||||
buildBotSwitchWebview,
|
buildBotSwitchWebview,
|
||||||
} from '../apiBuilders/bots';
|
} from '../apiBuilders/bots';
|
||||||
import { buildApiChatFromPreview } from '../apiBuilders/chats';
|
import { buildApiChatFromPreview } from '../apiBuilders/chats';
|
||||||
import { addEntitiesToLocalDb, addUserToLocalDb, deserializeBytes } from '../helpers';
|
|
||||||
import { omitVirtualClassFields } from '../apiBuilders/helpers';
|
import { omitVirtualClassFields } from '../apiBuilders/helpers';
|
||||||
import { buildCollectionByKey } from '../../../util/iteratees';
|
|
||||||
import { buildApiUrlAuthResult } from '../apiBuilders/misc';
|
import { buildApiUrlAuthResult } from '../apiBuilders/misc';
|
||||||
|
import { buildApiUser } from '../apiBuilders/users';
|
||||||
|
import {
|
||||||
|
buildInputBotApp,
|
||||||
|
buildInputEntity,
|
||||||
|
buildInputPeer,
|
||||||
|
buildInputReplyToMessage,
|
||||||
|
buildInputThemeParams,
|
||||||
|
generateRandomBigInt,
|
||||||
|
} from '../gramjsBuilders';
|
||||||
|
import { addEntitiesToLocalDb, addUserToLocalDb, deserializeBytes } from '../helpers';
|
||||||
|
import localDb from '../localDb';
|
||||||
|
import { invokeRequest } from './client';
|
||||||
|
|
||||||
let onUpdate: OnApiUpdate;
|
let onUpdate: OnApiUpdate;
|
||||||
|
|
||||||
|
|||||||
@ -1,24 +1,25 @@
|
|||||||
import BigInt from 'big-integer';
|
import BigInt from 'big-integer';
|
||||||
import type { JoinGroupCallPayload } from '../../../lib/secret-sauce';
|
|
||||||
import type {
|
|
||||||
ApiChat, ApiUser, OnApiUpdate, ApiGroupCall, ApiPhoneCall,
|
|
||||||
} from '../../types';
|
|
||||||
import { Api as GramJs } from '../../../lib/gramjs';
|
import { Api as GramJs } from '../../../lib/gramjs';
|
||||||
|
|
||||||
import { invokeRequest, invokeRequestBeacon } from './client';
|
import type { JoinGroupCallPayload } from '../../../lib/secret-sauce';
|
||||||
|
import type {
|
||||||
|
ApiChat, ApiGroupCall, ApiPhoneCall,
|
||||||
|
ApiUser, OnApiUpdate,
|
||||||
|
} from '../../types';
|
||||||
|
|
||||||
|
import { GROUP_CALL_PARTICIPANTS_LIMIT } from '../../../config';
|
||||||
|
import {
|
||||||
|
buildApiGroupCall,
|
||||||
|
buildApiGroupCallParticipant, buildCallProtocol,
|
||||||
|
buildPhoneCall,
|
||||||
|
} from '../apiBuilders/calls';
|
||||||
|
import { buildApiChatFromPreview } from '../apiBuilders/chats';
|
||||||
|
import { buildApiUser } from '../apiBuilders/users';
|
||||||
import {
|
import {
|
||||||
buildInputGroupCall, buildInputPeer, buildInputPhoneCall, generateRandomInt,
|
buildInputGroupCall, buildInputPeer, buildInputPhoneCall, generateRandomInt,
|
||||||
} from '../gramjsBuilders';
|
} from '../gramjsBuilders';
|
||||||
import {
|
|
||||||
buildCallProtocol,
|
|
||||||
buildApiGroupCall,
|
|
||||||
buildApiGroupCallParticipant, buildPhoneCall,
|
|
||||||
|
|
||||||
} from '../apiBuilders/calls';
|
|
||||||
import { buildApiUser } from '../apiBuilders/users';
|
|
||||||
import { buildApiChatFromPreview } from '../apiBuilders/chats';
|
|
||||||
import { addEntitiesToLocalDb } from '../helpers';
|
import { addEntitiesToLocalDb } from '../helpers';
|
||||||
import { GROUP_CALL_PARTICIPANTS_LIMIT } from '../../../config';
|
import { invokeRequest, invokeRequestBeacon } from './client';
|
||||||
|
|
||||||
let onUpdate: OnApiUpdate;
|
let onUpdate: OnApiUpdate;
|
||||||
|
|
||||||
|
|||||||
@ -1,76 +1,76 @@
|
|||||||
import BigInt from 'big-integer';
|
import BigInt from 'big-integer';
|
||||||
import { Api as GramJs } from '../../../lib/gramjs';
|
import { Api as GramJs } from '../../../lib/gramjs';
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
OnApiUpdate,
|
|
||||||
ApiChat,
|
ApiChat,
|
||||||
ApiMessage,
|
|
||||||
ApiUser,
|
|
||||||
ApiMessageEntity,
|
|
||||||
ApiFormattedText,
|
|
||||||
ApiChatFullInfo,
|
|
||||||
ApiChatFolder,
|
|
||||||
ApiChatBannedRights,
|
|
||||||
ApiChatAdminRights,
|
ApiChatAdminRights,
|
||||||
|
ApiChatBannedRights,
|
||||||
|
ApiChatFolder,
|
||||||
|
ApiChatFullInfo,
|
||||||
|
ApiChatReactions,
|
||||||
|
ApiFormattedText,
|
||||||
ApiGroupCall,
|
ApiGroupCall,
|
||||||
ApiUserStatus,
|
ApiMessage,
|
||||||
|
ApiMessageEntity,
|
||||||
ApiPhoto,
|
ApiPhoto,
|
||||||
ApiTopic,
|
ApiTopic,
|
||||||
ApiChatReactions,
|
ApiUser,
|
||||||
|
ApiUserStatus,
|
||||||
|
OnApiUpdate,
|
||||||
} from '../../types';
|
} from '../../types';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
DEBUG,
|
ALL_FOLDER_ID,
|
||||||
ARCHIVED_FOLDER_ID,
|
ARCHIVED_FOLDER_ID,
|
||||||
|
DEBUG,
|
||||||
|
GENERAL_TOPIC_ID,
|
||||||
|
MAX_INT_32,
|
||||||
MEMBERS_LOAD_SLICE,
|
MEMBERS_LOAD_SLICE,
|
||||||
SERVICE_NOTIFICATIONS_USER_ID,
|
SERVICE_NOTIFICATIONS_USER_ID,
|
||||||
ALL_FOLDER_ID,
|
|
||||||
MAX_INT_32,
|
|
||||||
TOPICS_SLICE,
|
TOPICS_SLICE,
|
||||||
GENERAL_TOPIC_ID,
|
|
||||||
} from '../../../config';
|
} from '../../../config';
|
||||||
import { invokeRequest, uploadFile } from './client';
|
|
||||||
import {
|
|
||||||
buildApiChatFromDialog,
|
|
||||||
getPeerKey,
|
|
||||||
buildChatMembers,
|
|
||||||
buildApiChatFromPreview,
|
|
||||||
buildApiChatFolder,
|
|
||||||
buildApiChatFolderFromSuggested,
|
|
||||||
buildApiChatBotCommands,
|
|
||||||
buildApiChatSettings,
|
|
||||||
buildApiChatReactions,
|
|
||||||
buildApiTopic,
|
|
||||||
buildApiChatlistInvite,
|
|
||||||
buildApiChatlistExportedInvite,
|
|
||||||
} from '../apiBuilders/chats';
|
|
||||||
import { buildApiMessage, buildMessageDraft } from '../apiBuilders/messages';
|
|
||||||
import { buildApiUser, buildApiUsersAndStatuses } from '../apiBuilders/users';
|
|
||||||
import { buildCollectionByKey } from '../../../util/iteratees';
|
import { buildCollectionByKey } from '../../../util/iteratees';
|
||||||
import {
|
import {
|
||||||
|
buildApiChatBotCommands,
|
||||||
|
buildApiChatFolder,
|
||||||
|
buildApiChatFolderFromSuggested,
|
||||||
|
buildApiChatFromDialog,
|
||||||
|
buildApiChatFromPreview,
|
||||||
|
buildApiChatlistExportedInvite,
|
||||||
|
buildApiChatlistInvite,
|
||||||
|
buildApiChatReactions,
|
||||||
|
buildApiChatSettings,
|
||||||
|
buildApiTopic,
|
||||||
|
buildChatMembers,
|
||||||
|
getPeerKey,
|
||||||
|
} from '../apiBuilders/chats';
|
||||||
|
import { buildApiPhoto } from '../apiBuilders/common';
|
||||||
|
import { buildApiMessage, buildMessageDraft } from '../apiBuilders/messages';
|
||||||
|
import { buildApiPeerId, getApiChatIdFromMtpPeer } from '../apiBuilders/peers';
|
||||||
|
import { buildStickerSet } from '../apiBuilders/symbols';
|
||||||
|
import { buildApiUser, buildApiUsersAndStatuses } from '../apiBuilders/users';
|
||||||
|
import {
|
||||||
|
buildChatAdminRights,
|
||||||
|
buildChatBannedRights,
|
||||||
|
buildFilterFromApiFolder,
|
||||||
|
buildInputChatReactions,
|
||||||
buildInputEntity,
|
buildInputEntity,
|
||||||
buildInputPeer,
|
buildInputPeer,
|
||||||
buildMtpMessageEntity,
|
|
||||||
buildFilterFromApiFolder,
|
|
||||||
isMessageWithMedia,
|
|
||||||
buildChatBannedRights,
|
|
||||||
buildChatAdminRights,
|
|
||||||
buildInputChatReactions,
|
|
||||||
buildInputPhoto,
|
buildInputPhoto,
|
||||||
|
buildMtpMessageEntity,
|
||||||
generateRandomBigInt,
|
generateRandomBigInt,
|
||||||
|
isMessageWithMedia,
|
||||||
} from '../gramjsBuilders';
|
} from '../gramjsBuilders';
|
||||||
import {
|
import {
|
||||||
addEntitiesToLocalDb,
|
addEntitiesToLocalDb,
|
||||||
addMessageToLocalDb,
|
addMessageToLocalDb,
|
||||||
addPhotoToLocalDb,
|
addPhotoToLocalDb,
|
||||||
isChatFolder,
|
isChatFolder,
|
||||||
|
|
||||||
} from '../helpers';
|
} from '../helpers';
|
||||||
import { buildApiPeerId, getApiChatIdFromMtpPeer } from '../apiBuilders/peers';
|
|
||||||
import { buildApiPhoto } from '../apiBuilders/common';
|
|
||||||
import { buildStickerSet } from '../apiBuilders/symbols';
|
|
||||||
import localDb from '../localDb';
|
import localDb from '../localDb';
|
||||||
import { updateChannelState } from '../updateManager';
|
|
||||||
import { scheduleMutedChatUpdate } from '../scheduleUnmute';
|
import { scheduleMutedChatUpdate } from '../scheduleUnmute';
|
||||||
|
import { updateChannelState } from '../updateManager';
|
||||||
|
import { invokeRequest, uploadFile } from './client';
|
||||||
|
|
||||||
type FullChatData = {
|
type FullChatData = {
|
||||||
fullInfo: ApiChatFullInfo;
|
fullInfo: ApiChatFullInfo;
|
||||||
|
|||||||
@ -1,10 +1,11 @@
|
|||||||
import {
|
import {
|
||||||
sessions, Api as GramJs,
|
Api as GramJs,
|
||||||
|
sessions,
|
||||||
} from '../../../lib/gramjs';
|
} from '../../../lib/gramjs';
|
||||||
import TelegramClient from '../../../lib/gramjs/client/TelegramClient';
|
|
||||||
|
|
||||||
import { Logger as GramJsLogger } from '../../../lib/gramjs/extensions/index';
|
|
||||||
import type { TwoFaParams } from '../../../lib/gramjs/client/2fa';
|
import type { TwoFaParams } from '../../../lib/gramjs/client/2fa';
|
||||||
|
import TelegramClient from '../../../lib/gramjs/client/TelegramClient';
|
||||||
|
import { Logger as GramJsLogger } from '../../../lib/gramjs/extensions/index';
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
ApiInitialArgs,
|
ApiInitialArgs,
|
||||||
ApiMediaFormat,
|
ApiMediaFormat,
|
||||||
@ -14,31 +15,33 @@ import type {
|
|||||||
} from '../../types';
|
} from '../../types';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
DEBUG, DEBUG_GRAMJS, UPLOAD_WORKERS, IS_TEST, APP_CODE_NAME,
|
APP_CODE_NAME,
|
||||||
|
DEBUG, DEBUG_GRAMJS, IS_TEST, UPLOAD_WORKERS,
|
||||||
} from '../../../config';
|
} from '../../../config';
|
||||||
import {
|
import { pause } from '../../../util/schedulers';
|
||||||
onRequestPhoneNumber, onRequestCode, onRequestPassword, onRequestRegistration,
|
|
||||||
onAuthError, onAuthReady, onCurrentUserUpdate, onRequestQrCode, onWebAuthTokenFailed,
|
|
||||||
} from './auth';
|
|
||||||
import { setMessageBuilderCurrentUserId } from '../apiBuilders/messages';
|
import { setMessageBuilderCurrentUserId } from '../apiBuilders/messages';
|
||||||
import downloadMediaWithClient, { parseMediaUrl } from './media';
|
|
||||||
import { buildApiUser, buildApiUserFullInfo } from '../apiBuilders/users';
|
|
||||||
import localDb, { clearLocalDb } from '../localDb';
|
|
||||||
import { buildApiPeerId } from '../apiBuilders/peers';
|
import { buildApiPeerId } from '../apiBuilders/peers';
|
||||||
|
import { buildApiUser, buildApiUserFullInfo } from '../apiBuilders/users';
|
||||||
import {
|
import {
|
||||||
addEntitiesToLocalDb,
|
addEntitiesToLocalDb,
|
||||||
addMessageToLocalDb, addStoryToLocalDb, addUserToLocalDb, isResponseUpdate, log,
|
addMessageToLocalDb, addStoryToLocalDb, addUserToLocalDb, isResponseUpdate, log,
|
||||||
} from '../helpers';
|
} from '../helpers';
|
||||||
import { ChatAbortController } from '../ChatAbortController';
|
import localDb, { clearLocalDb } from '../localDb';
|
||||||
import {
|
import {
|
||||||
updateChannelState,
|
|
||||||
getDifference,
|
getDifference,
|
||||||
init as initUpdatesManager,
|
init as initUpdatesManager,
|
||||||
processUpdate,
|
processUpdate,
|
||||||
reset as resetUpdatesManager,
|
reset as resetUpdatesManager,
|
||||||
scheduleGetChannelDifference,
|
scheduleGetChannelDifference,
|
||||||
|
updateChannelState,
|
||||||
} from '../updateManager';
|
} from '../updateManager';
|
||||||
import { pause } from '../../../util/schedulers';
|
import {
|
||||||
|
onAuthError, onAuthReady, onCurrentUserUpdate, onRequestCode, onRequestPassword, onRequestPhoneNumber,
|
||||||
|
onRequestQrCode, onRequestRegistration, onWebAuthTokenFailed,
|
||||||
|
} from './auth';
|
||||||
|
import downloadMediaWithClient, { parseMediaUrl } from './media';
|
||||||
|
|
||||||
|
import { ChatAbortController } from '../ChatAbortController';
|
||||||
|
|
||||||
const DEFAULT_USER_AGENT = 'Unknown UserAgent';
|
const DEFAULT_USER_AGENT = 'Unknown UserAgent';
|
||||||
const DEFAULT_PLATFORM = 'Unknown platform';
|
const DEFAULT_PLATFORM = 'Unknown platform';
|
||||||
|
|||||||
@ -1,28 +1,28 @@
|
|||||||
import type {
|
import type {
|
||||||
OnApiUpdate,
|
|
||||||
ApiInitialArgs,
|
ApiInitialArgs,
|
||||||
ApiUpdate,
|
|
||||||
ApiOnProgress,
|
ApiOnProgress,
|
||||||
|
ApiUpdate,
|
||||||
|
OnApiUpdate,
|
||||||
} from '../../types';
|
} from '../../types';
|
||||||
import type { Methods, MethodArgs, MethodResponse } from './types';
|
|
||||||
import type { LocalDb } from '../localDb';
|
import type { LocalDb } from '../localDb';
|
||||||
|
import type { MethodArgs, MethodResponse, Methods } from './types';
|
||||||
|
|
||||||
import { API_THROTTLE_RESET_UPDATES, API_UPDATE_THROTTLE } from '../../../config';
|
import { API_THROTTLE_RESET_UPDATES, API_UPDATE_THROTTLE } from '../../../config';
|
||||||
import { throttle, throttleWithTickEnd } from '../../../util/schedulers';
|
import { throttle, throttleWithTickEnd } from '../../../util/schedulers';
|
||||||
import { updateFullLocalDb } from '../localDb';
|
import { updateFullLocalDb } from '../localDb';
|
||||||
import { init as initUpdater } from '../updater';
|
import { init as initUpdater } from '../updater';
|
||||||
import { init as initAuth } from './auth';
|
import { init as initAuth } from './auth';
|
||||||
import { init as initChats } from './chats';
|
|
||||||
import { init as initMessages } from './messages';
|
|
||||||
import { init as initUsers } from './users';
|
|
||||||
import { init as initClient } from './client';
|
|
||||||
import { init as initStickers } from './symbols';
|
|
||||||
import { init as initManagement } from './management';
|
|
||||||
import { init as initTwoFaSettings } from './twoFaSettings';
|
|
||||||
import { init as initBots } from './bots';
|
import { init as initBots } from './bots';
|
||||||
import { init as initCalls } from './calls';
|
import { init as initCalls } from './calls';
|
||||||
import { init as initPayments } from './payments';
|
import { init as initChats } from './chats';
|
||||||
|
import { init as initClient } from './client';
|
||||||
import * as methods from './index';
|
import * as methods from './index';
|
||||||
|
import { init as initManagement } from './management';
|
||||||
|
import { init as initMessages } from './messages';
|
||||||
|
import { init as initPayments } from './payments';
|
||||||
|
import { init as initStickers } from './symbols';
|
||||||
|
import { init as initTwoFaSettings } from './twoFaSettings';
|
||||||
|
import { init as initUsers } from './users';
|
||||||
|
|
||||||
let onUpdate: OnApiUpdate;
|
let onUpdate: OnApiUpdate;
|
||||||
|
|
||||||
|
|||||||
@ -1,16 +1,16 @@
|
|||||||
import { Api as GramJs } from '../../../lib/gramjs';
|
import { Api as GramJs } from '../../../lib/gramjs';
|
||||||
|
|
||||||
import { invokeRequest } from './client';
|
|
||||||
import { buildInputEntity, buildInputPeer } from '../gramjsBuilders';
|
|
||||||
import type {
|
import type {
|
||||||
ApiChat, ApiError, ApiUser, ApiUsername, OnApiUpdate,
|
ApiChat, ApiError, ApiUser, ApiUsername, OnApiUpdate,
|
||||||
} from '../../types';
|
} from '../../types';
|
||||||
|
|
||||||
import { USERNAME_PURCHASE_ERROR } from '../../../config';
|
import { USERNAME_PURCHASE_ERROR } from '../../../config';
|
||||||
import { addEntitiesToLocalDb } from '../helpers';
|
import { buildCollectionByKey } from '../../../util/iteratees';
|
||||||
import { buildApiExportedInvite, buildChatInviteImporter } from '../apiBuilders/chats';
|
import { buildApiExportedInvite, buildChatInviteImporter } from '../apiBuilders/chats';
|
||||||
import { buildApiUser } from '../apiBuilders/users';
|
import { buildApiUser } from '../apiBuilders/users';
|
||||||
import { buildCollectionByKey } from '../../../util/iteratees';
|
import { buildInputEntity, buildInputPeer } from '../gramjsBuilders';
|
||||||
|
import { addEntitiesToLocalDb } from '../helpers';
|
||||||
|
import { invokeRequest } from './client';
|
||||||
|
|
||||||
let onUpdate: OnApiUpdate;
|
let onUpdate: OnApiUpdate;
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
import type { TelegramClient } from '../../../lib/gramjs';
|
|
||||||
import { Api as GramJs } from '../../../lib/gramjs';
|
import { Api as GramJs } from '../../../lib/gramjs';
|
||||||
|
|
||||||
|
import type { TelegramClient } from '../../../lib/gramjs';
|
||||||
import type { ApiOnProgress, ApiParsedMedia } from '../../types';
|
import type { ApiOnProgress, ApiParsedMedia } from '../../types';
|
||||||
import {
|
import {
|
||||||
ApiMediaFormat,
|
ApiMediaFormat,
|
||||||
@ -12,9 +13,9 @@ import {
|
|||||||
MEDIA_CACHE_NAME,
|
MEDIA_CACHE_NAME,
|
||||||
MEDIA_CACHE_NAME_AVATARS,
|
MEDIA_CACHE_NAME_AVATARS,
|
||||||
} from '../../../config';
|
} from '../../../config';
|
||||||
import localDb from '../localDb';
|
|
||||||
import * as cacheApi from '../../../util/cacheApi';
|
import * as cacheApi from '../../../util/cacheApi';
|
||||||
import { getEntityTypeById } from '../gramjsBuilders';
|
import { getEntityTypeById } from '../gramjsBuilders';
|
||||||
|
import localDb from '../localDb';
|
||||||
|
|
||||||
const MEDIA_ENTITY_TYPES = new Set([
|
const MEDIA_ENTITY_TYPES = new Set([
|
||||||
'msg', 'sticker', 'gif', 'wallpaper', 'photo', 'webDocument', 'document', 'videoAvatar',
|
'msg', 'sticker', 'gif', 'wallpaper', 'photo', 'webDocument', 'document', 'videoAvatar',
|
||||||
|
|||||||
@ -1,25 +1,26 @@
|
|||||||
import { Api as GramJs } from '../../../lib/gramjs';
|
import { Api as GramJs } from '../../../lib/gramjs';
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
ApiAttachment,
|
ApiAttachment,
|
||||||
ApiChat,
|
ApiChat,
|
||||||
|
ApiContact,
|
||||||
|
ApiFormattedText,
|
||||||
ApiGlobalMessageSearchType,
|
ApiGlobalMessageSearchType,
|
||||||
ApiMessage,
|
ApiMessage,
|
||||||
ApiMessageEntity,
|
ApiMessageEntity,
|
||||||
ApiMessageSearchType,
|
ApiMessageSearchType,
|
||||||
ApiNewPoll,
|
ApiNewPoll,
|
||||||
ApiOnProgress,
|
ApiOnProgress,
|
||||||
|
ApiPoll,
|
||||||
ApiReportReason,
|
ApiReportReason,
|
||||||
|
ApiSendMessageAction,
|
||||||
ApiSticker,
|
ApiSticker,
|
||||||
|
ApiStory,
|
||||||
|
ApiStorySkipped,
|
||||||
|
ApiTypeReplyTo,
|
||||||
ApiUser,
|
ApiUser,
|
||||||
ApiVideo,
|
ApiVideo,
|
||||||
OnApiUpdate,
|
OnApiUpdate,
|
||||||
ApiSendMessageAction,
|
|
||||||
ApiContact,
|
|
||||||
ApiPoll,
|
|
||||||
ApiFormattedText,
|
|
||||||
ApiTypeReplyTo,
|
|
||||||
ApiStory,
|
|
||||||
ApiStorySkipped,
|
|
||||||
} from '../../types';
|
} from '../../types';
|
||||||
import {
|
import {
|
||||||
MAIN_THREAD_ID,
|
MAIN_THREAD_ID,
|
||||||
@ -33,51 +34,51 @@ import {
|
|||||||
SUPPORTED_IMAGE_CONTENT_TYPES,
|
SUPPORTED_IMAGE_CONTENT_TYPES,
|
||||||
SUPPORTED_VIDEO_CONTENT_TYPES,
|
SUPPORTED_VIDEO_CONTENT_TYPES,
|
||||||
} from '../../../config';
|
} from '../../../config';
|
||||||
import { handleGramJsUpdate, invokeRequest, uploadFile } from './client';
|
import { getEmojiOnlyCountForMessage } from '../../../global/helpers/getEmojiOnlyCountForMessage';
|
||||||
import {
|
import { fetchFile } from '../../../util/files';
|
||||||
buildApiMessage,
|
import { compact } from '../../../util/iteratees';
|
||||||
buildLocalForwardedMessage,
|
import { getServerTimeOffset } from '../../../util/serverTime';
|
||||||
buildLocalMessage,
|
import { interpolateArray } from '../../../util/waveform';
|
||||||
buildApiSponsoredMessage,
|
import { buildApiChatFromPreview, buildApiSendAsPeerId } from '../apiBuilders/chats';
|
||||||
} from '../apiBuilders/messages';
|
import { buildApiFormattedText } from '../apiBuilders/common';
|
||||||
import {
|
import {
|
||||||
buildMessageMediaContent, buildMessageTextContent, buildWebPage,
|
buildMessageMediaContent, buildMessageTextContent, buildWebPage,
|
||||||
} from '../apiBuilders/messageContent';
|
} from '../apiBuilders/messageContent';
|
||||||
import { buildApiFormattedText } from '../apiBuilders/common';
|
import {
|
||||||
|
buildApiMessage,
|
||||||
|
buildApiSponsoredMessage,
|
||||||
|
buildLocalForwardedMessage,
|
||||||
|
buildLocalMessage,
|
||||||
|
} from '../apiBuilders/messages';
|
||||||
|
import { getApiChatIdFromMtpPeer } from '../apiBuilders/peers';
|
||||||
import { buildApiUser } from '../apiBuilders/users';
|
import { buildApiUser } from '../apiBuilders/users';
|
||||||
import {
|
import {
|
||||||
buildInputEntity,
|
buildInputEntity,
|
||||||
buildInputMediaDocument,
|
buildInputMediaDocument,
|
||||||
buildInputPeer,
|
buildInputPeer,
|
||||||
buildInputPoll,
|
buildInputPoll,
|
||||||
|
buildInputPollFromExisting,
|
||||||
|
buildInputReplyTo,
|
||||||
buildInputReportReason,
|
buildInputReportReason,
|
||||||
|
buildInputStory,
|
||||||
|
buildInputTextWithEntities,
|
||||||
|
buildMessageFromUpdate,
|
||||||
buildMtpMessageEntity,
|
buildMtpMessageEntity,
|
||||||
|
buildSendMessageAction,
|
||||||
generateRandomBigInt,
|
generateRandomBigInt,
|
||||||
getEntityTypeById,
|
getEntityTypeById,
|
||||||
isMessageWithMedia,
|
isMessageWithMedia,
|
||||||
isServiceMessageWithMedia,
|
isServiceMessageWithMedia,
|
||||||
buildSendMessageAction,
|
|
||||||
buildInputPollFromExisting,
|
|
||||||
buildInputTextWithEntities,
|
|
||||||
buildMessageFromUpdate,
|
|
||||||
buildInputStory,
|
|
||||||
buildInputReplyTo,
|
|
||||||
} from '../gramjsBuilders';
|
} from '../gramjsBuilders';
|
||||||
import { buildApiChatFromPreview, buildApiSendAsPeerId } from '../apiBuilders/chats';
|
|
||||||
import { fetchFile } from '../../../util/files';
|
|
||||||
import {
|
import {
|
||||||
addEntitiesToLocalDb,
|
addEntitiesToLocalDb,
|
||||||
addMessageToLocalDb,
|
addMessageToLocalDb,
|
||||||
deserializeBytes,
|
deserializeBytes,
|
||||||
resolveMessageApiChatId,
|
resolveMessageApiChatId,
|
||||||
} from '../helpers';
|
} from '../helpers';
|
||||||
import { interpolateArray } from '../../../util/waveform';
|
|
||||||
import { requestChatUpdate } from './chats';
|
|
||||||
import { getEmojiOnlyCountForMessage } from '../../../global/helpers/getEmojiOnlyCountForMessage';
|
|
||||||
import { getServerTimeOffset } from '../../../util/serverTime';
|
|
||||||
import { getApiChatIdFromMtpPeer } from '../apiBuilders/peers';
|
|
||||||
import { updateChannelState } from '../updateManager';
|
import { updateChannelState } from '../updateManager';
|
||||||
import { compact } from '../../../util/iteratees';
|
import { requestChatUpdate } from './chats';
|
||||||
|
import { handleGramJsUpdate, invokeRequest, uploadFile } from './client';
|
||||||
|
|
||||||
const FAST_SEND_TIMEOUT = 1000;
|
const FAST_SEND_TIMEOUT = 1000;
|
||||||
const INPUT_WAVEFORM_LENGTH = 63;
|
const INPUT_WAVEFORM_LENGTH = 63;
|
||||||
|
|||||||
@ -1,24 +1,27 @@
|
|||||||
import BigInt from 'big-integer';
|
import BigInt from 'big-integer';
|
||||||
import { Api as GramJs } from '../../../lib/gramjs';
|
import { Api as GramJs } from '../../../lib/gramjs';
|
||||||
import { invokeRequest } from './client';
|
|
||||||
import { buildInputInvoice, buildInputPeer, buildShippingInfo } from '../gramjsBuilders';
|
import type {
|
||||||
|
ApiChat, ApiRequestInputInvoice,
|
||||||
|
OnApiUpdate,
|
||||||
|
} from '../../types';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
buildApiInvoiceFromForm,
|
buildApiInvoiceFromForm,
|
||||||
buildApiPremiumPromo,
|
|
||||||
buildApiPaymentForm,
|
buildApiPaymentForm,
|
||||||
|
buildApiPremiumPromo,
|
||||||
buildApiReceipt,
|
buildApiReceipt,
|
||||||
buildShippingOptions,
|
buildShippingOptions,
|
||||||
} from '../apiBuilders/payments';
|
} from '../apiBuilders/payments';
|
||||||
import type {
|
import { buildApiUser } from '../apiBuilders/users';
|
||||||
ApiChat, OnApiUpdate, ApiRequestInputInvoice,
|
import { buildInputInvoice, buildInputPeer, buildShippingInfo } from '../gramjsBuilders';
|
||||||
} from '../../types';
|
|
||||||
import localDb from '../localDb';
|
|
||||||
import {
|
import {
|
||||||
addEntitiesToLocalDb,
|
addEntitiesToLocalDb,
|
||||||
deserializeBytes,
|
deserializeBytes,
|
||||||
serializeBytes,
|
serializeBytes,
|
||||||
} from '../helpers';
|
} from '../helpers';
|
||||||
import { buildApiUser } from '../apiBuilders/users';
|
import localDb from '../localDb';
|
||||||
|
import { invokeRequest } from './client';
|
||||||
import { getTemporaryPaymentPassword } from './twoFaSettings';
|
import { getTemporaryPaymentPassword } from './twoFaSettings';
|
||||||
|
|
||||||
let onUpdate: OnApiUpdate;
|
let onUpdate: OnApiUpdate;
|
||||||
|
|||||||
@ -1,9 +1,9 @@
|
|||||||
import BigInt from 'big-integer';
|
|
||||||
import type bigInt from 'big-integer';
|
import type bigInt from 'big-integer';
|
||||||
import MTProtoState from '../../../lib/gramjs/network/MTProtoState';
|
import BigInt from 'big-integer';
|
||||||
|
import AuthKey from '../../../lib/gramjs/crypto/AuthKey';
|
||||||
import Logger from '../../../lib/gramjs/extensions/Logger';
|
import Logger from '../../../lib/gramjs/extensions/Logger';
|
||||||
import Helpers from '../../../lib/gramjs/Helpers';
|
import Helpers from '../../../lib/gramjs/Helpers';
|
||||||
import AuthKey from '../../../lib/gramjs/crypto/AuthKey';
|
import MTProtoState from '../../../lib/gramjs/network/MTProtoState';
|
||||||
|
|
||||||
type DhConfig = {
|
type DhConfig = {
|
||||||
p: number[];
|
p: number[];
|
||||||
|
|||||||
@ -4,13 +4,13 @@ import { Api as GramJs } from '../../../lib/gramjs';
|
|||||||
import type { ApiChat, ApiReaction } from '../../types';
|
import type { ApiChat, ApiReaction } from '../../types';
|
||||||
|
|
||||||
import { REACTION_LIST_LIMIT, RECENT_REACTIONS_LIMIT, TOP_REACTIONS_LIMIT } from '../../../config';
|
import { REACTION_LIST_LIMIT, RECENT_REACTIONS_LIMIT, TOP_REACTIONS_LIMIT } from '../../../config';
|
||||||
import { buildInputPeer, buildInputReaction } from '../gramjsBuilders';
|
|
||||||
import { buildApiUser } from '../apiBuilders/users';
|
|
||||||
import { buildApiAvailableReaction, buildApiReaction, buildMessagePeerReaction } from '../apiBuilders/reactions';
|
|
||||||
import { invokeRequest } from './client';
|
|
||||||
import localDb from '../localDb';
|
|
||||||
import { addEntitiesToLocalDb } from '../helpers';
|
|
||||||
import { buildApiChatFromPreview } from '../apiBuilders/chats';
|
import { buildApiChatFromPreview } from '../apiBuilders/chats';
|
||||||
|
import { buildApiAvailableReaction, buildApiReaction, buildMessagePeerReaction } from '../apiBuilders/reactions';
|
||||||
|
import { buildApiUser } from '../apiBuilders/users';
|
||||||
|
import { buildInputPeer, buildInputReaction } from '../gramjsBuilders';
|
||||||
|
import { addEntitiesToLocalDb } from '../helpers';
|
||||||
|
import localDb from '../localDb';
|
||||||
|
import { invokeRequest } from './client';
|
||||||
|
|
||||||
export function sendWatchingEmojiInteraction({
|
export function sendWatchingEmojiInteraction({
|
||||||
chat,
|
chat,
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
import BigInt from 'big-integer';
|
import BigInt from 'big-integer';
|
||||||
import { Api as GramJs } from '../../../lib/gramjs';
|
import { Api as GramJs } from '../../../lib/gramjs';
|
||||||
|
|
||||||
|
import type { LANG_PACKS } from '../../../config';
|
||||||
|
import type { ApiPrivacyKey, InputPrivacyRules, LangCode } from '../../../types';
|
||||||
import type {
|
import type {
|
||||||
ApiAppConfig,
|
ApiAppConfig,
|
||||||
ApiConfig,
|
ApiConfig,
|
||||||
@ -10,11 +12,14 @@ import type {
|
|||||||
ApiPhoto,
|
ApiPhoto,
|
||||||
ApiUser,
|
ApiUser,
|
||||||
} from '../../types';
|
} from '../../types';
|
||||||
import type { ApiPrivacyKey, InputPrivacyRules, LangCode } from '../../../types';
|
|
||||||
import type { LANG_PACKS } from '../../../config';
|
|
||||||
|
|
||||||
import { BLOCKED_LIST_LIMIT, DEFAULT_LANG_PACK, MAX_INT_32 } from '../../../config';
|
import { BLOCKED_LIST_LIMIT, DEFAULT_LANG_PACK, MAX_INT_32 } from '../../../config';
|
||||||
import { ACCEPTABLE_USERNAME_ERRORS } from './management';
|
import { buildCollectionByKey } from '../../../util/iteratees';
|
||||||
|
import { getServerTime } from '../../../util/serverTime';
|
||||||
|
import { buildAppConfig } from '../apiBuilders/appConfig';
|
||||||
|
import { buildApiChatFromPreview } from '../apiBuilders/chats';
|
||||||
|
import { buildApiPhoto, buildPrivacyRules } from '../apiBuilders/common';
|
||||||
|
import { omitVirtualClassFields } from '../apiBuilders/helpers';
|
||||||
import {
|
import {
|
||||||
buildApiConfig,
|
buildApiConfig,
|
||||||
buildApiCountryList,
|
buildApiCountryList,
|
||||||
@ -23,20 +28,16 @@ import {
|
|||||||
buildApiWallpaper,
|
buildApiWallpaper,
|
||||||
buildApiWebSession, buildLangPack, buildLangPackString,
|
buildApiWebSession, buildLangPack, buildLangPackString,
|
||||||
} from '../apiBuilders/misc';
|
} from '../apiBuilders/misc';
|
||||||
import { buildApiPhoto, buildPrivacyRules } from '../apiBuilders/common';
|
|
||||||
import { buildApiUser } from '../apiBuilders/users';
|
|
||||||
import { buildApiChatFromPreview } from '../apiBuilders/chats';
|
|
||||||
import { getApiChatIdFromMtpPeer } from '../apiBuilders/peers';
|
import { getApiChatIdFromMtpPeer } from '../apiBuilders/peers';
|
||||||
import { buildAppConfig } from '../apiBuilders/appConfig';
|
import { buildApiUser } from '../apiBuilders/users';
|
||||||
import { omitVirtualClassFields } from '../apiBuilders/helpers';
|
|
||||||
import {
|
import {
|
||||||
buildInputEntity, buildInputPeer, buildInputPrivacyKey, buildInputPhoto,
|
buildInputEntity, buildInputPeer, buildInputPhoto,
|
||||||
|
buildInputPrivacyKey,
|
||||||
} from '../gramjsBuilders';
|
} from '../gramjsBuilders';
|
||||||
import { getClient, invokeRequest, uploadFile } from './client';
|
|
||||||
import { buildCollectionByKey } from '../../../util/iteratees';
|
|
||||||
import { getServerTime } from '../../../util/serverTime';
|
|
||||||
import { addEntitiesToLocalDb, addPhotoToLocalDb } from '../helpers';
|
import { addEntitiesToLocalDb, addPhotoToLocalDb } from '../helpers';
|
||||||
import localDb from '../localDb';
|
import localDb from '../localDb';
|
||||||
|
import { getClient, invokeRequest, uploadFile } from './client';
|
||||||
|
import { ACCEPTABLE_USERNAME_ERRORS } from './management';
|
||||||
|
|
||||||
const BETA_LANG_CODES = ['ar', 'fa', 'id', 'ko', 'uz', 'en'];
|
const BETA_LANG_CODES = ['ar', 'fa', 'id', 'ko', 'uz', 'en'];
|
||||||
|
|
||||||
|
|||||||
@ -2,16 +2,17 @@ import BigInt from 'big-integer';
|
|||||||
import { Api as GramJs } from '../../../lib/gramjs';
|
import { Api as GramJs } from '../../../lib/gramjs';
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
ApiChat, ApiMessageStatistics, ApiMessagePublicForward, StatisticsGraph,
|
ApiChat, ApiMessagePublicForward, ApiMessageStatistics, StatisticsGraph,
|
||||||
} from '../../types';
|
} from '../../types';
|
||||||
|
|
||||||
import { invokeRequest } from './client';
|
|
||||||
import { addEntitiesToLocalDb } from '../helpers';
|
|
||||||
import { buildInputEntity } from '../gramjsBuilders';
|
|
||||||
import {
|
import {
|
||||||
buildChannelStatistics, buildGroupStatistics, buildMessageStatistics, buildMessagePublicForwards, buildGraph,
|
buildChannelStatistics, buildGraph,
|
||||||
|
buildGroupStatistics, buildMessagePublicForwards, buildMessageStatistics,
|
||||||
} from '../apiBuilders/statistics';
|
} from '../apiBuilders/statistics';
|
||||||
import { buildApiUser } from '../apiBuilders/users';
|
import { buildApiUser } from '../apiBuilders/users';
|
||||||
|
import { buildInputEntity } from '../gramjsBuilders';
|
||||||
|
import { addEntitiesToLocalDb } from '../helpers';
|
||||||
|
import { invokeRequest } from './client';
|
||||||
|
|
||||||
export async function fetchChannelStatistics({
|
export async function fetchChannelStatistics({
|
||||||
chat, dcId,
|
chat, dcId,
|
||||||
|
|||||||
@ -1,15 +1,19 @@
|
|||||||
import { invokeRequest } from './client';
|
|
||||||
import type {
|
|
||||||
ApiUser, ApiUserStories, ApiReportReason, ApiTypeStory, ApiReaction, ApiStealthMode,
|
|
||||||
} from '../../types';
|
|
||||||
import type { PrivacyVisibility } from '../../../types';
|
|
||||||
import { Api as GramJs } from '../../../lib/gramjs';
|
import { Api as GramJs } from '../../../lib/gramjs';
|
||||||
import { addEntitiesToLocalDb, addStoryToLocalDb } from '../helpers';
|
|
||||||
import { buildApiUser } from '../apiBuilders/users';
|
import type { PrivacyVisibility } from '../../../types';
|
||||||
|
import type {
|
||||||
|
ApiReaction, ApiReportReason, ApiStealthMode,
|
||||||
|
ApiTypeStory, ApiUser, ApiUserStories,
|
||||||
|
} from '../../types';
|
||||||
|
|
||||||
|
import { STORY_LIST_LIMIT } from '../../../config';
|
||||||
|
import { buildCollectionByCallback } from '../../../util/iteratees';
|
||||||
import { buildApiPeerId } from '../apiBuilders/peers';
|
import { buildApiPeerId } from '../apiBuilders/peers';
|
||||||
import {
|
import {
|
||||||
buildApiStoryView, buildApiStory, buildApiUsersStories, buildApiStealthMode,
|
buildApiStealthMode,
|
||||||
|
buildApiStory, buildApiStoryView, buildApiUsersStories,
|
||||||
} from '../apiBuilders/stories';
|
} from '../apiBuilders/stories';
|
||||||
|
import { buildApiUser } from '../apiBuilders/users';
|
||||||
import {
|
import {
|
||||||
buildInputEntity,
|
buildInputEntity,
|
||||||
buildInputPeer,
|
buildInputPeer,
|
||||||
@ -18,8 +22,8 @@ import {
|
|||||||
buildInputReaction,
|
buildInputReaction,
|
||||||
buildInputReportReason,
|
buildInputReportReason,
|
||||||
} from '../gramjsBuilders';
|
} from '../gramjsBuilders';
|
||||||
import { STORY_LIST_LIMIT } from '../../../config';
|
import { addEntitiesToLocalDb, addStoryToLocalDb } from '../helpers';
|
||||||
import { buildCollectionByCallback } from '../../../util/iteratees';
|
import { invokeRequest } from './client';
|
||||||
|
|
||||||
export async function fetchAllStories({
|
export async function fetchAllStories({
|
||||||
stateHash,
|
stateHash,
|
||||||
|
|||||||
@ -1,19 +1,19 @@
|
|||||||
import BigInt from 'big-integer';
|
import BigInt from 'big-integer';
|
||||||
import { Api as GramJs } from '../../../lib/gramjs';
|
import { Api as GramJs } from '../../../lib/gramjs';
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
ApiStickerSetInfo, ApiSticker, ApiVideo, OnApiUpdate,
|
ApiSticker, ApiStickerSetInfo, ApiVideo, OnApiUpdate,
|
||||||
} from '../../types';
|
} from '../../types';
|
||||||
|
|
||||||
import { invokeRequest } from './client';
|
import { DEFAULT_GIF_SEARCH_BOT_USERNAME, RECENT_STATUS_LIMIT, RECENT_STICKERS_LIMIT } from '../../../config';
|
||||||
|
import { buildVideoFromDocument } from '../apiBuilders/messageContent';
|
||||||
import {
|
import {
|
||||||
buildStickerSet, buildStickerSetCovered, processStickerPackResult, processStickerResult,
|
buildStickerSet, buildStickerSetCovered, processStickerPackResult, processStickerResult,
|
||||||
} from '../apiBuilders/symbols';
|
} from '../apiBuilders/symbols';
|
||||||
import { buildApiUserEmojiStatus } from '../apiBuilders/users';
|
import { buildApiUserEmojiStatus } from '../apiBuilders/users';
|
||||||
import { buildInputStickerSet, buildInputDocument, buildInputStickerSetShortName } from '../gramjsBuilders';
|
import { buildInputDocument, buildInputStickerSet, buildInputStickerSetShortName } from '../gramjsBuilders';
|
||||||
import { buildVideoFromDocument } from '../apiBuilders/messageContent';
|
|
||||||
import { DEFAULT_GIF_SEARCH_BOT_USERNAME, RECENT_STATUS_LIMIT, RECENT_STICKERS_LIMIT } from '../../../config';
|
|
||||||
|
|
||||||
import localDb from '../localDb';
|
import localDb from '../localDb';
|
||||||
|
import { invokeRequest } from './client';
|
||||||
|
|
||||||
let onUpdate: OnApiUpdate;
|
let onUpdate: OnApiUpdate;
|
||||||
|
|
||||||
|
|||||||
@ -3,7 +3,7 @@ import { Api as GramJs, errors } from '../../../lib/gramjs';
|
|||||||
import type { OnApiUpdate } from '../../types';
|
import type { OnApiUpdate } from '../../types';
|
||||||
|
|
||||||
import { DEBUG } from '../../../config';
|
import { DEBUG } from '../../../config';
|
||||||
import { invokeRequest, updateTwoFaSettings, getTmpPassword } from './client';
|
import { getTmpPassword, invokeRequest, updateTwoFaSettings } from './client';
|
||||||
|
|
||||||
const ApiErrors: { [k: string]: string } = {
|
const ApiErrors: { [k: string]: string } = {
|
||||||
EMAIL_UNCONFIRMED: 'Email unconfirmed',
|
EMAIL_UNCONFIRMED: 'Email unconfirmed',
|
||||||
|
|||||||
@ -1,26 +1,28 @@
|
|||||||
import BigInt from 'big-integer';
|
import BigInt from 'big-integer';
|
||||||
import { Api as GramJs } from '../../../lib/gramjs';
|
import { Api as GramJs } from '../../../lib/gramjs';
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
OnApiUpdate, ApiUser, ApiChat, ApiSticker,
|
ApiChat, ApiSticker,
|
||||||
|
ApiUser, OnApiUpdate,
|
||||||
} from '../../types';
|
} from '../../types';
|
||||||
|
|
||||||
import { COMMON_CHATS_LIMIT, PROFILE_PHOTOS_LIMIT } from '../../../config';
|
import { COMMON_CHATS_LIMIT, PROFILE_PHOTOS_LIMIT } from '../../../config';
|
||||||
import { invokeRequest } from './client';
|
|
||||||
import { searchMessagesLocal } from './messages';
|
|
||||||
import {
|
|
||||||
buildInputEntity,
|
|
||||||
buildInputPeer,
|
|
||||||
buildInputContact,
|
|
||||||
buildMtpPeerId,
|
|
||||||
getEntityTypeById,
|
|
||||||
buildInputEmojiStatus,
|
|
||||||
} from '../gramjsBuilders';
|
|
||||||
import { buildApiUser, buildApiUserFullInfo, buildApiUsersAndStatuses } from '../apiBuilders/users';
|
|
||||||
import { buildApiChatFromPreview } from '../apiBuilders/chats';
|
import { buildApiChatFromPreview } from '../apiBuilders/chats';
|
||||||
import { buildApiPhoto } from '../apiBuilders/common';
|
import { buildApiPhoto } from '../apiBuilders/common';
|
||||||
import { addEntitiesToLocalDb, addPhotoToLocalDb, addUserToLocalDb } from '../helpers';
|
|
||||||
import { buildApiPeerId } from '../apiBuilders/peers';
|
import { buildApiPeerId } from '../apiBuilders/peers';
|
||||||
|
import { buildApiUser, buildApiUserFullInfo, buildApiUsersAndStatuses } from '../apiBuilders/users';
|
||||||
|
import {
|
||||||
|
buildInputContact,
|
||||||
|
buildInputEmojiStatus,
|
||||||
|
buildInputEntity,
|
||||||
|
buildInputPeer,
|
||||||
|
buildMtpPeerId,
|
||||||
|
getEntityTypeById,
|
||||||
|
} from '../gramjsBuilders';
|
||||||
|
import { addEntitiesToLocalDb, addPhotoToLocalDb, addUserToLocalDb } from '../helpers';
|
||||||
import localDb from '../localDb';
|
import localDb from '../localDb';
|
||||||
|
import { invokeRequest } from './client';
|
||||||
|
import { searchMessagesLocal } from './messages';
|
||||||
|
|
||||||
let onUpdate: OnApiUpdate;
|
let onUpdate: OnApiUpdate;
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
import type { OnApiUpdate } from '../types';
|
import type { OnApiUpdate } from '../types';
|
||||||
import { getServerTime } from '../../util/serverTime';
|
|
||||||
import { MAX_INT_32 } from '../../config';
|
import { MAX_INT_32 } from '../../config';
|
||||||
|
import { getServerTime } from '../../util/serverTime';
|
||||||
|
|
||||||
type UnmuteQueueItem = { chatId: string; topicId?: number; muteUntil: number };
|
type UnmuteQueueItem = { chatId: string; topicId?: number; muteUntil: number };
|
||||||
const unmuteTimers = new Map<string, any>();
|
const unmuteTimers = new Map<string, any>();
|
||||||
|
|||||||
@ -1,15 +1,16 @@
|
|||||||
import { Api as GramJs } from '../../lib/gramjs';
|
import { Api as GramJs } from '../../lib/gramjs';
|
||||||
import type { Update } from './updater';
|
|
||||||
import type { invokeRequest } from './methods/client';
|
|
||||||
|
|
||||||
import { UpdateConnectionState, UpdateServerTimeOffset } from '../../lib/gramjs/network';
|
import { UpdateConnectionState, UpdateServerTimeOffset } from '../../lib/gramjs/network';
|
||||||
|
|
||||||
|
import type { invokeRequest } from './methods/client';
|
||||||
|
import type { Update } from './updater';
|
||||||
|
|
||||||
import { DEBUG } from '../../config';
|
import { DEBUG } from '../../config';
|
||||||
import localDb from './localDb';
|
|
||||||
import SortedQueue from '../../util/SortedQueue';
|
import SortedQueue from '../../util/SortedQueue';
|
||||||
import { dispatchUserAndChatUpdates, sendUpdate, updater } from './updater';
|
|
||||||
import { addEntitiesToLocalDb } from './helpers';
|
|
||||||
import { buildInputEntity } from './gramjsBuilders';
|
|
||||||
import { buildApiPeerId } from './apiBuilders/peers';
|
import { buildApiPeerId } from './apiBuilders/peers';
|
||||||
|
import { buildInputEntity } from './gramjsBuilders';
|
||||||
|
import { addEntitiesToLocalDb } from './helpers';
|
||||||
|
import localDb from './localDb';
|
||||||
|
import { dispatchUserAndChatUpdates, sendUpdate, updater } from './updater';
|
||||||
|
|
||||||
export type State = {
|
export type State = {
|
||||||
seq: number;
|
seq: number;
|
||||||
|
|||||||
@ -1,79 +1,80 @@
|
|||||||
import type { GroupCallConnectionData } from '../../lib/secret-sauce';
|
|
||||||
import { Api as GramJs, connection } from '../../lib/gramjs';
|
import { Api as GramJs, connection } from '../../lib/gramjs';
|
||||||
|
|
||||||
|
import type { GroupCallConnectionData } from '../../lib/secret-sauce';
|
||||||
import type {
|
import type {
|
||||||
ApiMessage, ApiMessageExtendedMediaPreview, ApiUpdate, ApiUpdateConnectionStateType, OnApiUpdate,
|
ApiMessage, ApiMessageExtendedMediaPreview, ApiStory, ApiStorySkipped,
|
||||||
ApiStory, ApiStorySkipped,
|
ApiUpdate, ApiUpdateConnectionStateType, OnApiUpdate,
|
||||||
} from '../types';
|
} from '../types';
|
||||||
|
|
||||||
import localDb from './localDb';
|
|
||||||
import { DEBUG, GENERAL_TOPIC_ID } from '../../config';
|
import { DEBUG, GENERAL_TOPIC_ID } from '../../config';
|
||||||
import { omit, pick } from '../../util/iteratees';
|
import { omit, pick } from '../../util/iteratees';
|
||||||
import { getServerTimeOffset, setServerTimeOffset } from '../../util/serverTime';
|
import { getServerTimeOffset, setServerTimeOffset } from '../../util/serverTime';
|
||||||
import {
|
import { buildApiBotMenuButton } from './apiBuilders/bots';
|
||||||
addMessageToLocalDb,
|
|
||||||
addEntitiesToLocalDb,
|
|
||||||
addPhotoToLocalDb,
|
|
||||||
resolveMessageApiChatId,
|
|
||||||
serializeBytes,
|
|
||||||
log,
|
|
||||||
swapLocalInvoiceMedia,
|
|
||||||
isChatFolder,
|
|
||||||
addStoryToLocalDb,
|
|
||||||
} from './helpers';
|
|
||||||
import { scheduleMutedTopicUpdate, scheduleMutedChatUpdate } from './scheduleUnmute';
|
|
||||||
import {
|
|
||||||
buildApiMessage,
|
|
||||||
buildApiMessageFromShort,
|
|
||||||
buildApiMessageFromShortChat,
|
|
||||||
buildApiMessageFromNotification,
|
|
||||||
buildMessageDraft,
|
|
||||||
} from './apiBuilders/messages';
|
|
||||||
import {
|
|
||||||
buildApiReaction,
|
|
||||||
buildMessageReactions,
|
|
||||||
} from './apiBuilders/reactions';
|
|
||||||
import {
|
|
||||||
buildChatMember,
|
|
||||||
buildChatMembers,
|
|
||||||
buildChatTypingStatus,
|
|
||||||
buildAvatarHash,
|
|
||||||
buildApiChatFromPreview,
|
|
||||||
buildApiChatFolder,
|
|
||||||
buildApiChatSettings,
|
|
||||||
} from './apiBuilders/chats';
|
|
||||||
import {
|
|
||||||
buildApiUser,
|
|
||||||
buildApiUserEmojiStatus,
|
|
||||||
buildApiUserStatus,
|
|
||||||
} from './apiBuilders/users';
|
|
||||||
import { omitVirtualClassFields } from './apiBuilders/helpers';
|
|
||||||
import {
|
|
||||||
buildApiNotifyException,
|
|
||||||
buildApiNotifyExceptionTopic,
|
|
||||||
buildPrivacyKey,
|
|
||||||
} from './apiBuilders/misc';
|
|
||||||
import {
|
|
||||||
buildApiMessageExtendedMediaPreview,
|
|
||||||
buildMessageMediaContent,
|
|
||||||
buildPoll,
|
|
||||||
buildPollResults,
|
|
||||||
} from './apiBuilders/messageContent';
|
|
||||||
import { buildApiStealthMode, buildApiStory } from './apiBuilders/stories';
|
|
||||||
import { buildApiPhoto, buildApiUsernames, buildPrivacyRules } from './apiBuilders/common';
|
|
||||||
import {
|
import {
|
||||||
buildApiGroupCall,
|
buildApiGroupCall,
|
||||||
buildApiGroupCallParticipant,
|
buildApiGroupCallParticipant,
|
||||||
buildPhoneCall,
|
buildPhoneCall,
|
||||||
getGroupCallId,
|
getGroupCallId,
|
||||||
} from './apiBuilders/calls';
|
} from './apiBuilders/calls';
|
||||||
import { buildApiPeerId, getApiChatIdFromMtpPeer } from './apiBuilders/peers';
|
|
||||||
import { buildApiEmojiInteraction, buildStickerSet } from './apiBuilders/symbols';
|
|
||||||
import { buildApiBotMenuButton } from './apiBuilders/bots';
|
|
||||||
import {
|
import {
|
||||||
|
buildApiChatFolder,
|
||||||
|
buildApiChatFromPreview,
|
||||||
|
buildApiChatSettings,
|
||||||
|
buildAvatarHash,
|
||||||
|
buildChatMember,
|
||||||
|
buildChatMembers,
|
||||||
|
buildChatTypingStatus,
|
||||||
|
} from './apiBuilders/chats';
|
||||||
|
import { buildApiPhoto, buildApiUsernames, buildPrivacyRules } from './apiBuilders/common';
|
||||||
|
import { omitVirtualClassFields } from './apiBuilders/helpers';
|
||||||
|
import {
|
||||||
|
buildApiMessageExtendedMediaPreview,
|
||||||
|
buildMessageMediaContent,
|
||||||
|
buildPoll,
|
||||||
|
buildPollResults,
|
||||||
|
} from './apiBuilders/messageContent';
|
||||||
|
import {
|
||||||
|
buildApiMessage,
|
||||||
|
buildApiMessageFromNotification,
|
||||||
|
buildApiMessageFromShort,
|
||||||
|
buildApiMessageFromShortChat,
|
||||||
|
buildMessageDraft,
|
||||||
|
} from './apiBuilders/messages';
|
||||||
|
import {
|
||||||
|
buildApiNotifyException,
|
||||||
|
buildApiNotifyExceptionTopic,
|
||||||
|
buildPrivacyKey,
|
||||||
|
} from './apiBuilders/misc';
|
||||||
|
import { buildApiPeerId, getApiChatIdFromMtpPeer } from './apiBuilders/peers';
|
||||||
|
import {
|
||||||
|
buildApiReaction,
|
||||||
|
buildMessageReactions,
|
||||||
|
} from './apiBuilders/reactions';
|
||||||
|
import { buildApiStealthMode, buildApiStory } from './apiBuilders/stories';
|
||||||
|
import { buildApiEmojiInteraction, buildStickerSet } from './apiBuilders/symbols';
|
||||||
|
import {
|
||||||
|
buildApiUser,
|
||||||
|
buildApiUserEmojiStatus,
|
||||||
|
buildApiUserStatus,
|
||||||
|
} from './apiBuilders/users';
|
||||||
|
import {
|
||||||
|
buildChatPhotoForLocalDb,
|
||||||
buildMessageFromUpdate,
|
buildMessageFromUpdate,
|
||||||
isMessageWithMedia,
|
isMessageWithMedia,
|
||||||
buildChatPhotoForLocalDb,
|
|
||||||
} from './gramjsBuilders';
|
} from './gramjsBuilders';
|
||||||
|
import {
|
||||||
|
addEntitiesToLocalDb,
|
||||||
|
addMessageToLocalDb,
|
||||||
|
addPhotoToLocalDb,
|
||||||
|
addStoryToLocalDb,
|
||||||
|
isChatFolder,
|
||||||
|
log,
|
||||||
|
resolveMessageApiChatId,
|
||||||
|
serializeBytes,
|
||||||
|
swapLocalInvoiceMedia,
|
||||||
|
} from './helpers';
|
||||||
|
import localDb from './localDb';
|
||||||
|
import { scheduleMutedChatUpdate, scheduleMutedTopicUpdate } from './scheduleUnmute';
|
||||||
|
|
||||||
export type Update = (
|
export type Update = (
|
||||||
(GramJs.TypeUpdate | GramJs.TypeUpdates) & { _entities?: (GramJs.TypeUser | GramJs.TypeChat)[] }
|
(GramJs.TypeUpdate | GramJs.TypeUpdates) & { _entities?: (GramJs.TypeUser | GramJs.TypeChat)[] }
|
||||||
|
|||||||
@ -1,17 +1,17 @@
|
|||||||
import type { Api } from '../../../lib/gramjs';
|
import type { Api } from '../../../lib/gramjs';
|
||||||
|
import type { TypedBroadcastChannel } from '../../../util/multitab';
|
||||||
import type { ApiInitialArgs, ApiOnProgress, OnApiUpdate } from '../../types';
|
import type { ApiInitialArgs, ApiOnProgress, OnApiUpdate } from '../../types';
|
||||||
|
import type { LocalDb } from '../localDb';
|
||||||
import type { MethodArgs, MethodResponse, Methods } from '../methods/types';
|
import type { MethodArgs, MethodResponse, Methods } from '../methods/types';
|
||||||
import type { OriginRequest, ThenArg, WorkerMessageEvent } from './types';
|
import type { OriginRequest, ThenArg, WorkerMessageEvent } from './types';
|
||||||
import type { LocalDb } from '../localDb';
|
|
||||||
import type { TypedBroadcastChannel } from '../../../util/multitab';
|
|
||||||
|
|
||||||
import { IS_MULTITAB_SUPPORTED } from '../../../util/windowEnvironment';
|
|
||||||
import { DATA_BROADCAST_CHANNEL_NAME, DEBUG } from '../../../config';
|
import { DATA_BROADCAST_CHANNEL_NAME, DEBUG } from '../../../config';
|
||||||
|
import { logDebugMessage } from '../../../util/debugConsole';
|
||||||
|
import Deferred from '../../../util/Deferred';
|
||||||
|
import { getCurrentTabId, subscribeToMasterChange } from '../../../util/establishMultitabRole';
|
||||||
import generateUniqueId from '../../../util/generateUniqueId';
|
import generateUniqueId from '../../../util/generateUniqueId';
|
||||||
import { pause } from '../../../util/schedulers';
|
import { pause } from '../../../util/schedulers';
|
||||||
import { getCurrentTabId, subscribeToMasterChange } from '../../../util/establishMultitabRole';
|
import { IS_MULTITAB_SUPPORTED } from '../../../util/windowEnvironment';
|
||||||
import Deferred from '../../../util/Deferred';
|
|
||||||
import { logDebugMessage } from '../../../util/debugConsole';
|
|
||||||
|
|
||||||
type RequestStates = {
|
type RequestStates = {
|
||||||
messageId: string;
|
messageId: string;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import type { ApiInitialArgs, ApiUpdate } from '../../types';
|
|
||||||
import type { Methods, MethodArgs, MethodResponse } from '../methods/types';
|
|
||||||
import type { LocalDb } from '../localDb';
|
|
||||||
import type { DebugLevel } from '../../../util/debugConsole';
|
import type { DebugLevel } from '../../../util/debugConsole';
|
||||||
|
import type { ApiInitialArgs, ApiUpdate } from '../../types';
|
||||||
|
import type { LocalDb } from '../localDb';
|
||||||
|
import type { MethodArgs, MethodResponse, Methods } from '../methods/types';
|
||||||
|
|
||||||
export type ThenArg<T> = T extends Promise<infer U> ? U : T;
|
export type ThenArg<T> = T extends Promise<infer U> ? U : T;
|
||||||
|
|
||||||
|
|||||||
@ -1,14 +1,14 @@
|
|||||||
/* eslint-disable no-console */
|
/* eslint-disable no-console */
|
||||||
|
|
||||||
|
import type { DebugLevel } from '../../../util/debugConsole';
|
||||||
import type { ApiOnProgress, ApiUpdate } from '../../types';
|
import type { ApiOnProgress, ApiUpdate } from '../../types';
|
||||||
import type { OriginMessageEvent, WorkerMessageData } from './types';
|
import type { OriginMessageEvent, WorkerMessageData } from './types';
|
||||||
|
|
||||||
import { DEBUG } from '../../../config';
|
import { DEBUG } from '../../../config';
|
||||||
import { callApi, cancelApiProgress, initApi } from '../methods/init';
|
|
||||||
import { log } from '../helpers';
|
|
||||||
import type { DebugLevel } from '../../../util/debugConsole';
|
|
||||||
import { DEBUG_LEVELS } from '../../../util/debugConsole';
|
import { DEBUG_LEVELS } from '../../../util/debugConsole';
|
||||||
import { throttleWithTickEnd } from '../../../util/schedulers';
|
import { throttleWithTickEnd } from '../../../util/schedulers';
|
||||||
|
import { log } from '../helpers';
|
||||||
|
import { callApi, cancelApiProgress, initApi } from '../methods/init';
|
||||||
|
|
||||||
declare const self: WorkerGlobalScope;
|
declare const self: WorkerGlobalScope;
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,9 @@
|
|||||||
import type {
|
import type {
|
||||||
GroupCallParticipant,
|
ApiCallProtocol, ApiPhoneCallConnection,
|
||||||
GroupCallConnectionState,
|
GroupCallConnectionState,
|
||||||
ApiPhoneCallConnection,
|
GroupCallParticipant,
|
||||||
ApiCallProtocol, VideoState, VideoRotation,
|
VideoRotation,
|
||||||
|
VideoState,
|
||||||
} from '../../lib/secret-sauce';
|
} from '../../lib/secret-sauce';
|
||||||
|
|
||||||
export interface ApiGroupCall {
|
export interface ApiGroupCall {
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
|
import type { ApiBotCommand } from './bots';
|
||||||
import type {
|
import type {
|
||||||
ApiChatReactions, ApiMessage, ApiPhoto, ApiStickerSet,
|
ApiChatReactions, ApiMessage, ApiPhoto, ApiStickerSet,
|
||||||
} from './messages';
|
} from './messages';
|
||||||
import type { ApiBotCommand } from './bots';
|
|
||||||
import type { ApiChatInviteImporter } from './misc';
|
import type { ApiChatInviteImporter } from './misc';
|
||||||
import type { ApiFakeType, ApiUsername } from './users';
|
import type { ApiFakeType, ApiUsername } from './users';
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
|
import type { ApiLimitType, CallbackAction } from '../../global/types';
|
||||||
import type { ApiDocument, ApiPhoto, ApiReaction } from './messages';
|
import type { ApiDocument, ApiPhoto, ApiReaction } from './messages';
|
||||||
import type { ApiUser } from './users';
|
import type { ApiUser } from './users';
|
||||||
import type { ApiLimitType, CallbackAction } from '../../global/types';
|
|
||||||
|
|
||||||
export interface ApiInitialArgs {
|
export interface ApiInitialArgs {
|
||||||
userAgent: string;
|
userAgent: string;
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import type { ApiDocument, ApiMessageEntity, ApiPaymentCredentials } from './messages';
|
|
||||||
import type { ApiWebDocument } from './bots';
|
|
||||||
import type { ApiInvoiceContainer } from '../../types';
|
import type { ApiInvoiceContainer } from '../../types';
|
||||||
|
import type { ApiWebDocument } from './bots';
|
||||||
|
import type { ApiDocument, ApiMessageEntity, ApiPaymentCredentials } from './messages';
|
||||||
|
|
||||||
export interface ApiShippingAddress {
|
export interface ApiShippingAddress {
|
||||||
streetLine1: string;
|
streetLine1: string;
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import type { ApiGeoPoint, ApiMessage, ApiReaction } from './messages';
|
|
||||||
import type { ApiPrivacySettings } from '../../types';
|
import type { ApiPrivacySettings } from '../../types';
|
||||||
|
import type { ApiGeoPoint, ApiMessage, ApiReaction } from './messages';
|
||||||
|
|
||||||
export interface ApiStory {
|
export interface ApiStory {
|
||||||
'@type'?: 'story';
|
'@type'?: 'story';
|
||||||
|
|||||||
@ -1,16 +1,21 @@
|
|||||||
import type {
|
import type {
|
||||||
GroupCallConnectionData,
|
GroupCallConnectionData,
|
||||||
GroupCallParticipant,
|
|
||||||
GroupCallConnectionState,
|
GroupCallConnectionState,
|
||||||
VideoState,
|
GroupCallParticipant,
|
||||||
VideoRotation,
|
VideoRotation,
|
||||||
|
VideoState,
|
||||||
} from '../../lib/secret-sauce';
|
} from '../../lib/secret-sauce';
|
||||||
|
import type { ApiPrivacyKey, PrivacyVisibility } from '../../types';
|
||||||
|
import type { ApiBotMenuButton } from './bots';
|
||||||
|
import type {
|
||||||
|
ApiGroupCall, ApiPhoneCall,
|
||||||
|
} from './calls';
|
||||||
import type {
|
import type {
|
||||||
ApiChat,
|
ApiChat,
|
||||||
ApiChatFullInfo,
|
|
||||||
ApiTypingStatus,
|
|
||||||
ApiChatMember,
|
|
||||||
ApiChatFolder,
|
ApiChatFolder,
|
||||||
|
ApiChatFullInfo,
|
||||||
|
ApiChatMember,
|
||||||
|
ApiTypingStatus,
|
||||||
} from './chats';
|
} from './chats';
|
||||||
import type {
|
import type {
|
||||||
ApiFormattedText,
|
ApiFormattedText,
|
||||||
@ -23,18 +28,13 @@ import type {
|
|||||||
ApiStickerSet,
|
ApiStickerSet,
|
||||||
ApiThreadInfo,
|
ApiThreadInfo,
|
||||||
} from './messages';
|
} from './messages';
|
||||||
import type {
|
|
||||||
ApiEmojiStatus, ApiUser, ApiUserFullInfo, ApiUserStatus,
|
|
||||||
} from './users';
|
|
||||||
import type {
|
import type {
|
||||||
ApiEmojiInteraction, ApiError, ApiInviteInfo, ApiNotifyException, ApiSessionData,
|
ApiEmojiInteraction, ApiError, ApiInviteInfo, ApiNotifyException, ApiSessionData,
|
||||||
} from './misc';
|
} from './misc';
|
||||||
import type {
|
|
||||||
ApiGroupCall, ApiPhoneCall,
|
|
||||||
} from './calls';
|
|
||||||
import type { ApiBotMenuButton } from './bots';
|
|
||||||
import type { ApiPrivacyKey, PrivacyVisibility } from '../../types';
|
|
||||||
import type { ApiStealthMode, ApiStory, ApiStorySkipped } from './stories';
|
import type { ApiStealthMode, ApiStory, ApiStorySkipped } from './stories';
|
||||||
|
import type {
|
||||||
|
ApiEmojiStatus, ApiUser, ApiUserFullInfo, ApiUserStatus,
|
||||||
|
} from './users';
|
||||||
|
|
||||||
export type ApiUpdateReady = {
|
export type ApiUpdateReady = {
|
||||||
'@type': 'updateApiReady';
|
'@type': 'updateApiReady';
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import type { ApiDocument, ApiPhoto } from './messages';
|
|
||||||
import type { ApiBotInfo } from './bots';
|
|
||||||
import type { API_CHAT_TYPES } from '../../config';
|
import type { API_CHAT_TYPES } from '../../config';
|
||||||
|
import type { ApiBotInfo } from './bots';
|
||||||
|
import type { ApiDocument, ApiPhoto } from './messages';
|
||||||
|
|
||||||
export interface ApiUser {
|
export interface ApiUser {
|
||||||
id: string;
|
id: string;
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { IS_IOS, IS_SAFARI } from '../util/windowEnvironment';
|
|
||||||
import { initializeSoundsForSafari } from '../global/actions/ui/calls';
|
import { initializeSoundsForSafari } from '../global/actions/ui/calls';
|
||||||
|
import { IS_IOS, IS_SAFARI } from '../util/windowEnvironment';
|
||||||
|
|
||||||
export { default as GroupCall } from '../components/calls/group/GroupCall';
|
export { default as GroupCall } from '../components/calls/group/GroupCall';
|
||||||
export { default as ActiveCallHeader } from '../components/calls/ActiveCallHeader';
|
export { default as ActiveCallHeader } from '../components/calls/ActiveCallHeader';
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { getActions, getGlobal } from '../global';
|
import { getActions, getGlobal } from '../global';
|
||||||
|
|
||||||
import { IS_MULTITAB_SUPPORTED } from '../util/windowEnvironment';
|
|
||||||
import { DEBUG } from '../config';
|
import { DEBUG } from '../config';
|
||||||
|
import { IS_MULTITAB_SUPPORTED } from '../util/windowEnvironment';
|
||||||
|
|
||||||
export { default as Main } from '../components/main/Main';
|
export { default as Main } from '../components/main/Main';
|
||||||
export { default as LockScreen } from '../components/main/LockScreen';
|
export { default as LockScreen } from '../components/main/LockScreen';
|
||||||
|
|||||||
@ -3,32 +3,32 @@ import React, { useEffect, useLayoutEffect } from '../lib/teact/teact';
|
|||||||
import { getActions, withGlobal } from '../global';
|
import { getActions, withGlobal } from '../global';
|
||||||
|
|
||||||
import type { GlobalState } from '../global/types';
|
import type { GlobalState } from '../global/types';
|
||||||
import type { UiLoaderPage } from './common/UiLoader';
|
|
||||||
import type { ThemeKey } from '../types';
|
import type { ThemeKey } from '../types';
|
||||||
|
import type { UiLoaderPage } from './common/UiLoader';
|
||||||
|
|
||||||
import { IS_INSTALL_PROMPT_SUPPORTED, IS_MULTITAB_SUPPORTED, PLATFORM_ENV } from '../util/windowEnvironment';
|
|
||||||
import {
|
import {
|
||||||
DARK_THEME_BG_COLOR, INACTIVE_MARKER, LIGHT_THEME_BG_COLOR, PAGE_TITLE,
|
DARK_THEME_BG_COLOR, INACTIVE_MARKER, LIGHT_THEME_BG_COLOR, PAGE_TITLE,
|
||||||
} from '../config';
|
} from '../config';
|
||||||
import { selectTabState, selectTheme } from '../global/selectors';
|
import { selectTabState, selectTheme } from '../global/selectors';
|
||||||
import { updateSizes } from '../util/windowSize';
|
|
||||||
import { addActiveTabChangeListener } from '../util/activeTabMonitor';
|
import { addActiveTabChangeListener } from '../util/activeTabMonitor';
|
||||||
import { hasStoredSession } from '../util/sessions';
|
|
||||||
import buildClassName from '../util/buildClassName';
|
import buildClassName from '../util/buildClassName';
|
||||||
import { parseInitialLocationHash } from '../util/routing';
|
|
||||||
import { setupBeforeInstallPrompt } from '../util/installPrompt';
|
import { setupBeforeInstallPrompt } from '../util/installPrompt';
|
||||||
|
import { parseInitialLocationHash } from '../util/routing';
|
||||||
|
import { hasStoredSession } from '../util/sessions';
|
||||||
|
import { IS_INSTALL_PROMPT_SUPPORTED, IS_MULTITAB_SUPPORTED, PLATFORM_ENV } from '../util/windowEnvironment';
|
||||||
|
import { updateSizes } from '../util/windowSize';
|
||||||
|
|
||||||
|
import useAppLayout from '../hooks/useAppLayout';
|
||||||
import useFlag from '../hooks/useFlag';
|
import useFlag from '../hooks/useFlag';
|
||||||
import usePrevious from '../hooks/usePrevious';
|
import usePrevious from '../hooks/usePrevious';
|
||||||
import useAppLayout from '../hooks/useAppLayout';
|
|
||||||
|
|
||||||
import Auth from './auth/Auth';
|
|
||||||
import Main from './main/Main.async';
|
|
||||||
import LockScreen from './main/LockScreen.async';
|
|
||||||
import AppInactive from './main/AppInactive';
|
|
||||||
import Transition from './ui/Transition';
|
|
||||||
import UiLoader from './common/UiLoader';
|
|
||||||
// import Test from './test/TestSvg';
|
// import Test from './test/TestSvg';
|
||||||
|
import Auth from './auth/Auth';
|
||||||
|
import UiLoader from './common/UiLoader';
|
||||||
|
import AppInactive from './main/AppInactive';
|
||||||
|
import LockScreen from './main/LockScreen.async';
|
||||||
|
import Main from './main/Main.async';
|
||||||
|
import Transition from './ui/Transition';
|
||||||
|
|
||||||
import styles from './App.module.scss';
|
import styles from './App.module.scss';
|
||||||
|
|
||||||
|
|||||||
@ -1,21 +1,23 @@
|
|||||||
|
import '../../global/actions/initial';
|
||||||
|
|
||||||
import type { FC } from '../../lib/teact/teact';
|
import type { FC } from '../../lib/teact/teact';
|
||||||
import React, { memo, useRef } from '../../lib/teact/teact';
|
import React, { memo, useRef } from '../../lib/teact/teact';
|
||||||
import { getActions, withGlobal } from '../../global';
|
import { getActions, withGlobal } from '../../global';
|
||||||
|
|
||||||
import type { GlobalState } from '../../global/types';
|
import type { GlobalState } from '../../global/types';
|
||||||
|
|
||||||
import '../../global/actions/initial';
|
|
||||||
import { PLATFORM_ENV } from '../../util/windowEnvironment';
|
import { PLATFORM_ENV } from '../../util/windowEnvironment';
|
||||||
import useHistoryBack from '../../hooks/useHistoryBack';
|
|
||||||
import useCurrentOrPrev from '../../hooks/useCurrentOrPrev';
|
import useCurrentOrPrev from '../../hooks/useCurrentOrPrev';
|
||||||
import useElectronDrag from '../../hooks/useElectronDrag';
|
import useElectronDrag from '../../hooks/useElectronDrag';
|
||||||
|
import useHistoryBack from '../../hooks/useHistoryBack';
|
||||||
|
|
||||||
import Transition from '../ui/Transition';
|
import Transition from '../ui/Transition';
|
||||||
import AuthPhoneNumber from './AuthPhoneNumber';
|
|
||||||
import AuthCode from './AuthCode.async';
|
import AuthCode from './AuthCode.async';
|
||||||
import AuthPassword from './AuthPassword.async';
|
import AuthPassword from './AuthPassword.async';
|
||||||
import AuthRegister from './AuthRegister.async';
|
import AuthPhoneNumber from './AuthPhoneNumber';
|
||||||
import AuthQrCode from './AuthQrCode';
|
import AuthQrCode from './AuthQrCode';
|
||||||
|
import AuthRegister from './AuthRegister.async';
|
||||||
|
|
||||||
import './Auth.scss';
|
import './Auth.scss';
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,10 @@
|
|||||||
import type { FC } from '../../lib/teact/teact';
|
import type { FC } from '../../lib/teact/teact';
|
||||||
import React from '../../lib/teact/teact';
|
import React from '../../lib/teact/teact';
|
||||||
|
|
||||||
import { Bundles } from '../../util/moduleLoader';
|
import { Bundles } from '../../util/moduleLoader';
|
||||||
|
|
||||||
import useModuleLoader from '../../hooks/useModuleLoader';
|
import useModuleLoader from '../../hooks/useModuleLoader';
|
||||||
|
|
||||||
import Loading from '../ui/Loading';
|
import Loading from '../ui/Loading';
|
||||||
|
|
||||||
const AuthCodeAsync: FC = () => {
|
const AuthCodeAsync: FC = () => {
|
||||||
|
|||||||
@ -1,20 +1,22 @@
|
|||||||
import type { FormEvent } from 'react';
|
import type { FormEvent } from 'react';
|
||||||
import type { FC } from '../../lib/teact/teact';
|
import type { FC } from '../../lib/teact/teact';
|
||||||
import React, {
|
import React, {
|
||||||
useState, useEffect, useCallback, memo, useRef,
|
memo, useCallback, useEffect, useRef, useState,
|
||||||
} from '../../lib/teact/teact';
|
} from '../../lib/teact/teact';
|
||||||
import { getActions, withGlobal } from '../../global';
|
import { getActions, withGlobal } from '../../global';
|
||||||
|
|
||||||
import type { GlobalState } from '../../global/types';
|
import type { GlobalState } from '../../global/types';
|
||||||
|
|
||||||
import { IS_TOUCH_ENV } from '../../util/windowEnvironment';
|
|
||||||
import { pick } from '../../util/iteratees';
|
import { pick } from '../../util/iteratees';
|
||||||
|
import { IS_TOUCH_ENV } from '../../util/windowEnvironment';
|
||||||
import renderText from '../common/helpers/renderText';
|
import renderText from '../common/helpers/renderText';
|
||||||
|
|
||||||
import useHistoryBack from '../../hooks/useHistoryBack';
|
import useHistoryBack from '../../hooks/useHistoryBack';
|
||||||
import useLang from '../../hooks/useLang';
|
import useLang from '../../hooks/useLang';
|
||||||
|
|
||||||
|
import TrackingMonkey from '../common/TrackingMonkey';
|
||||||
import InputText from '../ui/InputText';
|
import InputText from '../ui/InputText';
|
||||||
import Loading from '../ui/Loading';
|
import Loading from '../ui/Loading';
|
||||||
import TrackingMonkey from '../common/TrackingMonkey';
|
|
||||||
|
|
||||||
type StateProps = Pick<GlobalState, 'authPhoneNumber' | 'authIsCodeViaApp' | 'authIsLoading' | 'authError'>;
|
type StateProps = Pick<GlobalState, 'authPhoneNumber' | 'authIsCodeViaApp' | 'authIsLoading' | 'authError'>;
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,10 @@
|
|||||||
import type { FC } from '../../lib/teact/teact';
|
import type { FC } from '../../lib/teact/teact';
|
||||||
import React from '../../lib/teact/teact';
|
import React from '../../lib/teact/teact';
|
||||||
|
|
||||||
import { Bundles } from '../../util/moduleLoader';
|
import { Bundles } from '../../util/moduleLoader';
|
||||||
|
|
||||||
import useModuleLoader from '../../hooks/useModuleLoader';
|
import useModuleLoader from '../../hooks/useModuleLoader';
|
||||||
|
|
||||||
import Loading from '../ui/Loading';
|
import Loading from '../ui/Loading';
|
||||||
|
|
||||||
const AuthPasswordAsync: FC = () => {
|
const AuthPasswordAsync: FC = () => {
|
||||||
|
|||||||
@ -5,10 +5,11 @@ import { getActions, withGlobal } from '../../global';
|
|||||||
import type { GlobalState } from '../../global/types';
|
import type { GlobalState } from '../../global/types';
|
||||||
|
|
||||||
import { pick } from '../../util/iteratees';
|
import { pick } from '../../util/iteratees';
|
||||||
|
|
||||||
import useLang from '../../hooks/useLang';
|
import useLang from '../../hooks/useLang';
|
||||||
|
|
||||||
import MonkeyPassword from '../common/PasswordMonkey';
|
|
||||||
import PasswordForm from '../common/PasswordForm';
|
import PasswordForm from '../common/PasswordForm';
|
||||||
|
import MonkeyPassword from '../common/PasswordMonkey';
|
||||||
|
|
||||||
type StateProps = Pick<GlobalState, 'authIsLoading' | 'authError' | 'authHint'>;
|
type StateProps = Pick<GlobalState, 'authIsLoading' | 'authError' | 'authHint'>;
|
||||||
|
|
||||||
|
|||||||
@ -1,35 +1,35 @@
|
|||||||
import type { ChangeEvent } from 'react';
|
import type { ChangeEvent } from 'react';
|
||||||
import { requestMeasure } from '../../lib/fasterdom/fasterdom';
|
|
||||||
|
|
||||||
import monkeyPath from '../../assets/monkey.svg';
|
|
||||||
|
|
||||||
import type { FC } from '../../lib/teact/teact';
|
import type { FC } from '../../lib/teact/teact';
|
||||||
import React, {
|
import React, {
|
||||||
memo, useCallback, useEffect, useLayoutEffect, useRef, useState,
|
memo, useCallback, useEffect, useLayoutEffect, useRef, useState,
|
||||||
} from '../../lib/teact/teact';
|
} from '../../lib/teact/teact';
|
||||||
import { getActions, withGlobal } from '../../global';
|
import { getActions, withGlobal } from '../../global';
|
||||||
|
|
||||||
|
import type { ApiCountryCode } from '../../api/types';
|
||||||
import type { GlobalState } from '../../global/types';
|
import type { GlobalState } from '../../global/types';
|
||||||
import type { LangCode } from '../../types';
|
import type { LangCode } from '../../types';
|
||||||
import type { ApiCountryCode } from '../../api/types';
|
|
||||||
|
|
||||||
import { IS_SAFARI, IS_TOUCH_ENV } from '../../util/windowEnvironment';
|
import { requestMeasure } from '../../lib/fasterdom/fasterdom';
|
||||||
import { preloadImage } from '../../util/files';
|
import { preloadImage } from '../../util/files';
|
||||||
import preloadFonts from '../../util/fonts';
|
import preloadFonts from '../../util/fonts';
|
||||||
import { pick } from '../../util/iteratees';
|
import { pick } from '../../util/iteratees';
|
||||||
import { formatPhoneNumber, getCountryCodesByIso, getCountryFromPhoneNumber } from '../../util/phoneNumber';
|
|
||||||
import { setLanguage } from '../../util/langProvider';
|
import { setLanguage } from '../../util/langProvider';
|
||||||
import useLang from '../../hooks/useLang';
|
import { formatPhoneNumber, getCountryCodesByIso, getCountryFromPhoneNumber } from '../../util/phoneNumber';
|
||||||
import useFlag from '../../hooks/useFlag';
|
import { IS_SAFARI, IS_TOUCH_ENV } from '../../util/windowEnvironment';
|
||||||
import useLangString from '../../hooks/useLangString';
|
|
||||||
import { getSuggestedLanguage } from './helpers/getSuggestedLanguage';
|
import { getSuggestedLanguage } from './helpers/getSuggestedLanguage';
|
||||||
|
|
||||||
|
import useFlag from '../../hooks/useFlag';
|
||||||
|
import useLang from '../../hooks/useLang';
|
||||||
|
import useLangString from '../../hooks/useLangString';
|
||||||
|
|
||||||
import Button from '../ui/Button';
|
import Button from '../ui/Button';
|
||||||
import Checkbox from '../ui/Checkbox';
|
import Checkbox from '../ui/Checkbox';
|
||||||
import InputText from '../ui/InputText';
|
import InputText from '../ui/InputText';
|
||||||
import Loading from '../ui/Loading';
|
import Loading from '../ui/Loading';
|
||||||
import CountryCodeInput from './CountryCodeInput';
|
import CountryCodeInput from './CountryCodeInput';
|
||||||
|
|
||||||
|
import monkeyPath from '../../assets/monkey.svg';
|
||||||
|
|
||||||
type StateProps = Pick<GlobalState, (
|
type StateProps = Pick<GlobalState, (
|
||||||
'connectionState' | 'authState' |
|
'connectionState' | 'authState' |
|
||||||
'authPhoneNumber' | 'authIsLoading' |
|
'authPhoneNumber' | 'authIsLoading' |
|
||||||
|
|||||||
@ -1,29 +1,29 @@
|
|||||||
|
import type { FC } from '../../lib/teact/teact';
|
||||||
import React, {
|
import React, {
|
||||||
useEffect, useRef, memo, useCallback, useLayoutEffect,
|
memo, useCallback, useEffect, useLayoutEffect, useRef,
|
||||||
} from '../../lib/teact/teact';
|
} from '../../lib/teact/teact';
|
||||||
import { disableStrict, enableStrict } from '../../lib/fasterdom/stricterdom';
|
|
||||||
import { getActions, withGlobal } from '../../global';
|
import { getActions, withGlobal } from '../../global';
|
||||||
|
|
||||||
import type { FC } from '../../lib/teact/teact';
|
|
||||||
import type { GlobalState } from '../../global/types';
|
import type { GlobalState } from '../../global/types';
|
||||||
import type { LangCode } from '../../types';
|
import type { LangCode } from '../../types';
|
||||||
|
|
||||||
import { DEFAULT_LANG_CODE } from '../../config';
|
import { DEFAULT_LANG_CODE } from '../../config';
|
||||||
import { LOCAL_TGS_URLS } from '../common/helpers/animatedAssets';
|
import { disableStrict, enableStrict } from '../../lib/fasterdom/stricterdom';
|
||||||
import { setLanguage } from '../../util/langProvider';
|
|
||||||
import buildClassName from '../../util/buildClassName';
|
import buildClassName from '../../util/buildClassName';
|
||||||
|
import { setLanguage } from '../../util/langProvider';
|
||||||
|
import { LOCAL_TGS_URLS } from '../common/helpers/animatedAssets';
|
||||||
import renderText from '../common/helpers/renderText';
|
import renderText from '../common/helpers/renderText';
|
||||||
import { getSuggestedLanguage } from './helpers/getSuggestedLanguage';
|
import { getSuggestedLanguage } from './helpers/getSuggestedLanguage';
|
||||||
|
|
||||||
import useLangString from '../../hooks/useLangString';
|
import useAsync from '../../hooks/useAsync';
|
||||||
import useFlag from '../../hooks/useFlag';
|
import useFlag from '../../hooks/useFlag';
|
||||||
import useLang from '../../hooks/useLang';
|
import useLang from '../../hooks/useLang';
|
||||||
|
import useLangString from '../../hooks/useLangString';
|
||||||
import useMediaTransition from '../../hooks/useMediaTransition';
|
import useMediaTransition from '../../hooks/useMediaTransition';
|
||||||
import useAsync from '../../hooks/useAsync';
|
|
||||||
|
|
||||||
import Loading from '../ui/Loading';
|
|
||||||
import Button from '../ui/Button';
|
|
||||||
import AnimatedIcon from '../common/AnimatedIcon';
|
import AnimatedIcon from '../common/AnimatedIcon';
|
||||||
|
import Button from '../ui/Button';
|
||||||
|
import Loading from '../ui/Loading';
|
||||||
|
|
||||||
import blankUrl from '../../assets/blank.png';
|
import blankUrl from '../../assets/blank.png';
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,10 @@
|
|||||||
import type { FC } from '../../lib/teact/teact';
|
import type { FC } from '../../lib/teact/teact';
|
||||||
import React from '../../lib/teact/teact';
|
import React from '../../lib/teact/teact';
|
||||||
|
|
||||||
import { Bundles } from '../../util/moduleLoader';
|
import { Bundles } from '../../util/moduleLoader';
|
||||||
|
|
||||||
import useModuleLoader from '../../hooks/useModuleLoader';
|
import useModuleLoader from '../../hooks/useModuleLoader';
|
||||||
|
|
||||||
import Loading from '../ui/Loading';
|
import Loading from '../ui/Loading';
|
||||||
|
|
||||||
const AuthRegisterAsync: FC = () => {
|
const AuthRegisterAsync: FC = () => {
|
||||||
|
|||||||
@ -1,16 +1,17 @@
|
|||||||
import type { ChangeEvent } from 'react';
|
import type { ChangeEvent } from 'react';
|
||||||
import type { FC } from '../../lib/teact/teact';
|
import type { FC } from '../../lib/teact/teact';
|
||||||
import React, { useState, memo, useCallback } from '../../lib/teact/teact';
|
import React, { memo, useCallback, useState } from '../../lib/teact/teact';
|
||||||
import { getActions, withGlobal } from '../../global';
|
import { getActions, withGlobal } from '../../global';
|
||||||
|
|
||||||
import type { GlobalState } from '../../global/types';
|
import type { GlobalState } from '../../global/types';
|
||||||
|
|
||||||
import { pick } from '../../util/iteratees';
|
import { pick } from '../../util/iteratees';
|
||||||
|
|
||||||
import useLang from '../../hooks/useLang';
|
import useLang from '../../hooks/useLang';
|
||||||
|
|
||||||
|
import AvatarEditable from '../ui/AvatarEditable';
|
||||||
import Button from '../ui/Button';
|
import Button from '../ui/Button';
|
||||||
import InputText from '../ui/InputText';
|
import InputText from '../ui/InputText';
|
||||||
import AvatarEditable from '../ui/AvatarEditable';
|
|
||||||
|
|
||||||
type StateProps = Pick<GlobalState, 'authIsLoading' | 'authError'>;
|
type StateProps = Pick<GlobalState, 'authIsLoading' | 'authError'>;
|
||||||
|
|
||||||
|
|||||||
@ -1,17 +1,18 @@
|
|||||||
import type { FC } from '../../lib/teact/teact';
|
import type { FC } from '../../lib/teact/teact';
|
||||||
import React, {
|
import React, {
|
||||||
useState, memo, useCallback, useRef,
|
memo, useCallback, useRef, useState,
|
||||||
} from '../../lib/teact/teact';
|
} from '../../lib/teact/teact';
|
||||||
import { withGlobal } from '../../global';
|
import { withGlobal } from '../../global';
|
||||||
|
|
||||||
import type { ApiCountryCode } from '../../api/types';
|
import type { ApiCountryCode } from '../../api/types';
|
||||||
|
|
||||||
import { ANIMATION_END_DELAY } from '../../config';
|
import { ANIMATION_END_DELAY } from '../../config';
|
||||||
import { prepareSearchWordsForNeedle } from '../../util/searchWords';
|
|
||||||
import buildClassName from '../../util/buildClassName';
|
import buildClassName from '../../util/buildClassName';
|
||||||
import renderText from '../common/helpers/renderText';
|
|
||||||
import useLang from '../../hooks/useLang';
|
|
||||||
import { isoToEmoji } from '../../util/emoji';
|
import { isoToEmoji } from '../../util/emoji';
|
||||||
|
import { prepareSearchWordsForNeedle } from '../../util/searchWords';
|
||||||
|
import renderText from '../common/helpers/renderText';
|
||||||
|
|
||||||
|
import useLang from '../../hooks/useLang';
|
||||||
import useSyncEffect from '../../hooks/useSyncEffect';
|
import useSyncEffect from '../../hooks/useSyncEffect';
|
||||||
|
|
||||||
import DropdownMenu from '../ui/DropdownMenu';
|
import DropdownMenu from '../ui/DropdownMenu';
|
||||||
|
|||||||
@ -1,8 +1,10 @@
|
|||||||
import type { FC } from '../../lib/teact/teact';
|
import type { FC } from '../../lib/teact/teact';
|
||||||
import React from '../../lib/teact/teact';
|
import React from '../../lib/teact/teact';
|
||||||
import useModuleLoader from '../../hooks/useModuleLoader';
|
|
||||||
import { Bundles } from '../../util/moduleLoader';
|
import { Bundles } from '../../util/moduleLoader';
|
||||||
|
|
||||||
|
import useModuleLoader from '../../hooks/useModuleLoader';
|
||||||
|
|
||||||
type OwnProps = {
|
type OwnProps = {
|
||||||
isActive?: boolean;
|
isActive?: boolean;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -4,9 +4,10 @@ import { getActions, withGlobal } from '../../global';
|
|||||||
|
|
||||||
import type { ApiGroupCall, ApiUser } from '../../api/types';
|
import type { ApiGroupCall, ApiUser } from '../../api/types';
|
||||||
|
|
||||||
import { selectActiveGroupCall, selectPhoneCallUser } from '../../global/selectors/calls';
|
|
||||||
import { selectTabState } from '../../global/selectors';
|
import { selectTabState } from '../../global/selectors';
|
||||||
|
import { selectActiveGroupCall, selectPhoneCallUser } from '../../global/selectors/calls';
|
||||||
import buildClassName from '../../util/buildClassName';
|
import buildClassName from '../../util/buildClassName';
|
||||||
|
|
||||||
import useLang from '../../hooks/useLang';
|
import useLang from '../../hooks/useLang';
|
||||||
|
|
||||||
import './ActiveCallHeader.scss';
|
import './ActiveCallHeader.scss';
|
||||||
|
|||||||
@ -1,9 +1,12 @@
|
|||||||
import type { FC } from '../../../lib/teact/teact';
|
import type { FC } from '../../../lib/teact/teact';
|
||||||
import React from '../../../lib/teact/teact';
|
import React from '../../../lib/teact/teact';
|
||||||
import useModuleLoader from '../../../hooks/useModuleLoader';
|
|
||||||
import { Bundles } from '../../../util/moduleLoader';
|
|
||||||
import type { OwnProps } from './GroupCall';
|
import type { OwnProps } from './GroupCall';
|
||||||
|
|
||||||
|
import { Bundles } from '../../../util/moduleLoader';
|
||||||
|
|
||||||
|
import useModuleLoader from '../../../hooks/useModuleLoader';
|
||||||
|
|
||||||
const GroupCallAsync: FC<OwnProps> = (props) => {
|
const GroupCallAsync: FC<OwnProps> = (props) => {
|
||||||
const { groupCallId } = props;
|
const { groupCallId } = props;
|
||||||
const GroupCall = useModuleLoader(Bundles.Calls, 'GroupCall', !groupCallId);
|
const GroupCall = useModuleLoader(Bundles.Calls, 'GroupCall', !groupCallId);
|
||||||
|
|||||||
@ -1,40 +1,42 @@
|
|||||||
|
import '../../../global/actions/calls';
|
||||||
|
|
||||||
|
import type { FC } from '../../../lib/teact/teact';
|
||||||
import React, {
|
import React, {
|
||||||
memo, useEffect, useMemo, useRef, useState,
|
memo, useEffect, useMemo, useRef, useState,
|
||||||
} from '../../../lib/teact/teact';
|
} from '../../../lib/teact/teact';
|
||||||
import { getActions, withGlobal } from '../../../global';
|
import { getActions, withGlobal } from '../../../global';
|
||||||
import '../../../global/actions/calls';
|
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
GroupCallConnectionState, GroupCallParticipant as TypeGroupCallParticipant,
|
GroupCallConnectionState, GroupCallParticipant as TypeGroupCallParticipant,
|
||||||
} from '../../../lib/secret-sauce';
|
} from '../../../lib/secret-sauce';
|
||||||
import type { FC } from '../../../lib/teact/teact';
|
|
||||||
import type { VideoParticipant } from './hooks/useGroupCallVideoLayout';
|
import type { VideoParticipant } from './hooks/useGroupCallVideoLayout';
|
||||||
|
|
||||||
import { IS_SCREENSHARE_SUPPORTED } from '../../../lib/secret-sauce';
|
import { IS_SCREENSHARE_SUPPORTED } from '../../../lib/secret-sauce';
|
||||||
import buildClassName from '../../../util/buildClassName';
|
import { selectChat, selectTabState } from '../../../global/selectors';
|
||||||
import {
|
import {
|
||||||
selectCanInviteToActiveGroupCall,
|
selectCanInviteToActiveGroupCall,
|
||||||
selectGroupCall,
|
selectGroupCall,
|
||||||
selectGroupCallParticipant,
|
selectGroupCallParticipant,
|
||||||
selectIsAdminInActiveGroupCall,
|
selectIsAdminInActiveGroupCall,
|
||||||
} from '../../../global/selectors/calls';
|
} from '../../../global/selectors/calls';
|
||||||
import { selectChat, selectTabState } from '../../../global/selectors';
|
import buildClassName from '../../../util/buildClassName';
|
||||||
import { compact } from '../../../util/iteratees';
|
import { compact } from '../../../util/iteratees';
|
||||||
import useFlag from '../../../hooks/useFlag';
|
|
||||||
import useLang from '../../../hooks/useLang';
|
|
||||||
import useAppLayout from '../../../hooks/useAppLayout';
|
import useAppLayout from '../../../hooks/useAppLayout';
|
||||||
import useGroupCallVideoLayout from './hooks/useGroupCallVideoLayout';
|
import useFlag from '../../../hooks/useFlag';
|
||||||
import { useIntersectionObserver, useIsIntersecting } from '../../../hooks/useIntersectionObserver';
|
|
||||||
import useLastCallback from '../../../hooks/useLastCallback';
|
|
||||||
import { useFullscreenStatus } from '../../../hooks/useFullscreen';
|
import { useFullscreenStatus } from '../../../hooks/useFullscreen';
|
||||||
|
import { useIntersectionObserver, useIsIntersecting } from '../../../hooks/useIntersectionObserver';
|
||||||
|
import useLang from '../../../hooks/useLang';
|
||||||
|
import useLastCallback from '../../../hooks/useLastCallback';
|
||||||
|
import useGroupCallVideoLayout from './hooks/useGroupCallVideoLayout';
|
||||||
|
|
||||||
import Button from '../../ui/Button';
|
import Button from '../../ui/Button';
|
||||||
import Modal from '../../ui/Modal';
|
|
||||||
import MicrophoneButton from './MicrophoneButton';
|
|
||||||
import Checkbox from '../../ui/Checkbox';
|
import Checkbox from '../../ui/Checkbox';
|
||||||
import GroupCallParticipantList from './GroupCallParticipantList';
|
|
||||||
import FloatingActionButton from '../../ui/FloatingActionButton';
|
import FloatingActionButton from '../../ui/FloatingActionButton';
|
||||||
|
import Modal from '../../ui/Modal';
|
||||||
|
import GroupCallParticipantList from './GroupCallParticipantList';
|
||||||
import GroupCallParticipantVideo from './GroupCallParticipantVideo';
|
import GroupCallParticipantVideo from './GroupCallParticipantVideo';
|
||||||
|
import MicrophoneButton from './MicrophoneButton';
|
||||||
|
|
||||||
import styles from './GroupCall.module.scss';
|
import styles from './GroupCall.module.scss';
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
import type { GroupCallParticipant as TypeGroupCallParticipant } from '../../../lib/secret-sauce';
|
|
||||||
import { THRESHOLD } from '../../../lib/secret-sauce';
|
|
||||||
import type { FC } from '../../../lib/teact/teact';
|
import type { FC } from '../../../lib/teact/teact';
|
||||||
import React, {
|
import React, {
|
||||||
memo, useCallback, useMemo, useRef,
|
memo, useCallback, useMemo, useRef,
|
||||||
@ -7,22 +5,24 @@ import React, {
|
|||||||
import { withGlobal } from '../../../global';
|
import { withGlobal } from '../../../global';
|
||||||
|
|
||||||
import type { ApiChat, ApiUser } from '../../../api/types';
|
import type { ApiChat, ApiUser } from '../../../api/types';
|
||||||
|
import type { GroupCallParticipant as TypeGroupCallParticipant } from '../../../lib/secret-sauce';
|
||||||
|
|
||||||
import { GROUP_CALL_DEFAULT_VOLUME } from '../../../config';
|
import { GROUP_CALL_DEFAULT_VOLUME } from '../../../config';
|
||||||
|
import { THRESHOLD } from '../../../lib/secret-sauce';
|
||||||
|
import { selectChat, selectUser } from '../../../global/selectors';
|
||||||
import buildClassName from '../../../util/buildClassName';
|
import buildClassName from '../../../util/buildClassName';
|
||||||
import renderText from '../../common/helpers/renderText';
|
import renderText from '../../common/helpers/renderText';
|
||||||
import { selectChat, selectUser } from '../../../global/selectors';
|
|
||||||
import formatGroupCallVolume from './helpers/formatGroupCallVolume';
|
import formatGroupCallVolume from './helpers/formatGroupCallVolume';
|
||||||
|
|
||||||
import useLang from '../../../hooks/useLang';
|
|
||||||
import useContextMenuHandlers from '../../../hooks/useContextMenuHandlers';
|
import useContextMenuHandlers from '../../../hooks/useContextMenuHandlers';
|
||||||
|
import useLang from '../../../hooks/useLang';
|
||||||
import useMenuPosition from '../../../hooks/useMenuPosition';
|
import useMenuPosition from '../../../hooks/useMenuPosition';
|
||||||
|
|
||||||
import Avatar from '../../common/Avatar';
|
import Avatar from '../../common/Avatar';
|
||||||
import OutlinedMicrophoneIcon from './OutlinedMicrophoneIcon';
|
import FullNameTitle from '../../common/FullNameTitle';
|
||||||
import ListItem from '../../ui/ListItem';
|
import ListItem from '../../ui/ListItem';
|
||||||
import GroupCallParticipantMenu from './GroupCallParticipantMenu';
|
import GroupCallParticipantMenu from './GroupCallParticipantMenu';
|
||||||
import FullNameTitle from '../../common/FullNameTitle';
|
import OutlinedMicrophoneIcon from './OutlinedMicrophoneIcon';
|
||||||
|
|
||||||
import styles from './GroupCallParticipant.module.scss';
|
import styles from './GroupCallParticipant.module.scss';
|
||||||
|
|
||||||
|
|||||||
@ -1,16 +1,17 @@
|
|||||||
|
import type { FC } from '../../../lib/teact/teact';
|
||||||
import React, { memo, useMemo } from '../../../lib/teact/teact';
|
import React, { memo, useMemo } from '../../../lib/teact/teact';
|
||||||
import { getActions, withGlobal } from '../../../global';
|
import { getActions, withGlobal } from '../../../global';
|
||||||
|
|
||||||
import type { GroupCallParticipant as TypeGroupCallParticipant } from '../../../lib/secret-sauce';
|
import type { GroupCallParticipant as TypeGroupCallParticipant } from '../../../lib/secret-sauce';
|
||||||
import type { FC } from '../../../lib/teact/teact';
|
|
||||||
|
|
||||||
import buildClassName from '../../../util/buildClassName';
|
|
||||||
import { selectActiveGroupCall } from '../../../global/selectors/calls';
|
import { selectActiveGroupCall } from '../../../global/selectors/calls';
|
||||||
|
import buildClassName from '../../../util/buildClassName';
|
||||||
|
|
||||||
import useInfiniteScroll from '../../../hooks/useInfiniteScroll';
|
import useInfiniteScroll from '../../../hooks/useInfiniteScroll';
|
||||||
import useLastCallback from '../../../hooks/useLastCallback';
|
import useLastCallback from '../../../hooks/useLastCallback';
|
||||||
|
|
||||||
import GroupCallParticipant from './GroupCallParticipant';
|
|
||||||
import InfiniteScroll from '../../ui/InfiniteScroll';
|
import InfiniteScroll from '../../ui/InfiniteScroll';
|
||||||
|
import GroupCallParticipant from './GroupCallParticipant';
|
||||||
|
|
||||||
import styles from './GroupCallParticipantList.module.scss';
|
import styles from './GroupCallParticipantList.module.scss';
|
||||||
|
|
||||||
|
|||||||
@ -1,23 +1,25 @@
|
|||||||
import type { GroupCallParticipant } from '../../../lib/secret-sauce';
|
|
||||||
import type { FC } from '../../../lib/teact/teact';
|
import type { FC } from '../../../lib/teact/teact';
|
||||||
import React, {
|
import React, {
|
||||||
memo, useEffect, useState,
|
memo, useEffect, useState,
|
||||||
} from '../../../lib/teact/teact';
|
} from '../../../lib/teact/teact';
|
||||||
import { getActions, withGlobal } from '../../../global';
|
import { getActions, withGlobal } from '../../../global';
|
||||||
|
|
||||||
|
import type { GroupCallParticipant } from '../../../lib/secret-sauce';
|
||||||
|
|
||||||
import { GROUP_CALL_DEFAULT_VOLUME, GROUP_CALL_VOLUME_MULTIPLIER } from '../../../config';
|
import { GROUP_CALL_DEFAULT_VOLUME, GROUP_CALL_VOLUME_MULTIPLIER } from '../../../config';
|
||||||
import { LOCAL_TGS_URLS } from '../../common/helpers/animatedAssets';
|
import { selectIsAdminInActiveGroupCall } from '../../../global/selectors/calls';
|
||||||
import buildClassName from '../../../util/buildClassName';
|
import buildClassName from '../../../util/buildClassName';
|
||||||
import useRunThrottled from '../../../hooks/useRunThrottled';
|
import { LOCAL_TGS_URLS } from '../../common/helpers/animatedAssets';
|
||||||
|
|
||||||
import useFlag from '../../../hooks/useFlag';
|
import useFlag from '../../../hooks/useFlag';
|
||||||
import useLang from '../../../hooks/useLang';
|
import useLang from '../../../hooks/useLang';
|
||||||
import useLastCallback from '../../../hooks/useLastCallback';
|
import useLastCallback from '../../../hooks/useLastCallback';
|
||||||
import { selectIsAdminInActiveGroupCall } from '../../../global/selectors/calls';
|
import useRunThrottled from '../../../hooks/useRunThrottled';
|
||||||
|
|
||||||
import Menu from '../../ui/Menu';
|
|
||||||
import MenuItem from '../../ui/MenuItem';
|
|
||||||
import AnimatedIcon from '../../common/AnimatedIcon';
|
import AnimatedIcon from '../../common/AnimatedIcon';
|
||||||
import DeleteMemberModal from '../../right/DeleteMemberModal';
|
import DeleteMemberModal from '../../right/DeleteMemberModal';
|
||||||
|
import Menu from '../../ui/Menu';
|
||||||
|
import MenuItem from '../../ui/MenuItem';
|
||||||
|
|
||||||
import './GroupCallParticipantMenu.scss';
|
import './GroupCallParticipantMenu.scss';
|
||||||
|
|
||||||
|
|||||||
@ -1,35 +1,35 @@
|
|||||||
|
import type { FC } from '../../../lib/teact/teact';
|
||||||
import React, {
|
import React, {
|
||||||
memo, useCallback, useEffect, useMemo, useRef, useState,
|
memo, useCallback, useEffect, useMemo, useRef, useState,
|
||||||
} from '../../../lib/teact/teact';
|
} from '../../../lib/teact/teact';
|
||||||
import { withGlobal } from '../../../global';
|
import { withGlobal } from '../../../global';
|
||||||
|
|
||||||
import type { FC } from '../../../lib/teact/teact';
|
|
||||||
import type { VideoLayout, VideoParticipant } from './hooks/useGroupCallVideoLayout';
|
|
||||||
import type { GroupCallParticipant as TypeGroupCallParticipant } from '../../../lib/secret-sauce';
|
|
||||||
import type { ApiChat, ApiUser } from '../../../api/types';
|
import type { ApiChat, ApiUser } from '../../../api/types';
|
||||||
|
import type { GroupCallParticipant as TypeGroupCallParticipant } from '../../../lib/secret-sauce';
|
||||||
|
import type { VideoLayout, VideoParticipant } from './hooks/useGroupCallVideoLayout';
|
||||||
|
|
||||||
import { IS_CANVAS_FILTER_SUPPORTED } from '../../../util/windowEnvironment';
|
|
||||||
import { GROUP_CALL_DEFAULT_VOLUME } from '../../../config';
|
import { GROUP_CALL_DEFAULT_VOLUME } from '../../../config';
|
||||||
|
import fastBlur from '../../../lib/fastBlur';
|
||||||
|
import { requestMutation } from '../../../lib/fasterdom/fasterdom';
|
||||||
import { getUserStreams, THRESHOLD } from '../../../lib/secret-sauce';
|
import { getUserStreams, THRESHOLD } from '../../../lib/secret-sauce';
|
||||||
import buildClassName from '../../../util/buildClassName';
|
|
||||||
import { selectChat, selectUser } from '../../../global/selectors';
|
import { selectChat, selectUser } from '../../../global/selectors';
|
||||||
import { animate } from '../../../util/animation';
|
import { animate } from '../../../util/animation';
|
||||||
|
import buildClassName from '../../../util/buildClassName';
|
||||||
import { fastRaf } from '../../../util/schedulers';
|
import { fastRaf } from '../../../util/schedulers';
|
||||||
import { requestMutation } from '../../../lib/fasterdom/fasterdom';
|
import { IS_CANVAS_FILTER_SUPPORTED } from '../../../util/windowEnvironment';
|
||||||
import formatGroupCallVolume from './helpers/formatGroupCallVolume';
|
import formatGroupCallVolume from './helpers/formatGroupCallVolume';
|
||||||
import fastBlur from '../../../lib/fastBlur';
|
|
||||||
|
|
||||||
import useLang from '../../../hooks/useLang';
|
|
||||||
import useContextMenuHandlers from '../../../hooks/useContextMenuHandlers';
|
import useContextMenuHandlers from '../../../hooks/useContextMenuHandlers';
|
||||||
import useMenuPosition from '../../../hooks/useMenuPosition';
|
|
||||||
import useLastCallback from '../../../hooks/useLastCallback';
|
|
||||||
import useInterval from '../../../hooks/useInterval';
|
import useInterval from '../../../hooks/useInterval';
|
||||||
|
import useLang from '../../../hooks/useLang';
|
||||||
|
import useLastCallback from '../../../hooks/useLastCallback';
|
||||||
|
import useMenuPosition from '../../../hooks/useMenuPosition';
|
||||||
|
|
||||||
import Button from '../../ui/Button';
|
|
||||||
import OutlinedMicrophoneIcon from './OutlinedMicrophoneIcon';
|
|
||||||
import FullNameTitle from '../../common/FullNameTitle';
|
import FullNameTitle from '../../common/FullNameTitle';
|
||||||
import GroupCallParticipantMenu from './GroupCallParticipantMenu';
|
import Button from '../../ui/Button';
|
||||||
import Skeleton from '../../ui/placeholder/Skeleton';
|
import Skeleton from '../../ui/placeholder/Skeleton';
|
||||||
|
import GroupCallParticipantMenu from './GroupCallParticipantMenu';
|
||||||
|
import OutlinedMicrophoneIcon from './OutlinedMicrophoneIcon';
|
||||||
|
|
||||||
import styles from './GroupCallParticipantVideo.module.scss';
|
import styles from './GroupCallParticipantVideo.module.scss';
|
||||||
|
|
||||||
|
|||||||
@ -6,15 +6,16 @@ import { getActions, getGlobal, withGlobal } from '../../../global';
|
|||||||
|
|
||||||
import type { ApiGroupCall } from '../../../api/types';
|
import type { ApiGroupCall } from '../../../api/types';
|
||||||
|
|
||||||
|
import { selectChat, selectTabState } from '../../../global/selectors';
|
||||||
import { selectChatGroupCall } from '../../../global/selectors/calls';
|
import { selectChatGroupCall } from '../../../global/selectors/calls';
|
||||||
import buildClassName from '../../../util/buildClassName';
|
import buildClassName from '../../../util/buildClassName';
|
||||||
import { selectChat, selectTabState } from '../../../global/selectors';
|
|
||||||
|
import useCurrentOrPrev from '../../../hooks/useCurrentOrPrev';
|
||||||
import useLang from '../../../hooks/useLang';
|
import useLang from '../../../hooks/useLang';
|
||||||
import useShowTransition from '../../../hooks/useShowTransition';
|
import useShowTransition from '../../../hooks/useShowTransition';
|
||||||
import useCurrentOrPrev from '../../../hooks/useCurrentOrPrev';
|
|
||||||
|
|
||||||
import Button from '../../ui/Button';
|
|
||||||
import Avatar from '../../common/Avatar';
|
import Avatar from '../../common/Avatar';
|
||||||
|
import Button from '../../ui/Button';
|
||||||
|
|
||||||
import './GroupCallTopPane.scss';
|
import './GroupCallTopPane.scss';
|
||||||
|
|
||||||
|
|||||||
@ -1,16 +1,18 @@
|
|||||||
import type { GroupCallConnectionState } from '../../../lib/secret-sauce';
|
|
||||||
import type { FC } from '../../../lib/teact/teact';
|
import type { FC } from '../../../lib/teact/teact';
|
||||||
import React, {
|
import React, {
|
||||||
memo, useCallback, useEffect, useMemo, useRef, useState,
|
memo, useCallback, useEffect, useMemo, useRef, useState,
|
||||||
} from '../../../lib/teact/teact';
|
} from '../../../lib/teact/teact';
|
||||||
import { getActions, withGlobal } from '../../../global';
|
import { getActions, withGlobal } from '../../../global';
|
||||||
|
|
||||||
import { LOCAL_TGS_URLS } from '../../common/helpers/animatedAssets';
|
import type { GroupCallConnectionState } from '../../../lib/secret-sauce';
|
||||||
|
|
||||||
|
import { selectActiveGroupCall, selectGroupCallParticipant } from '../../../global/selectors/calls';
|
||||||
import buildClassName from '../../../util/buildClassName';
|
import buildClassName from '../../../util/buildClassName';
|
||||||
import { vibrateShort } from '../../../util/vibrate';
|
import { vibrateShort } from '../../../util/vibrate';
|
||||||
import usePrevious from '../../../hooks/usePrevious';
|
import { LOCAL_TGS_URLS } from '../../common/helpers/animatedAssets';
|
||||||
import { selectActiveGroupCall, selectGroupCallParticipant } from '../../../global/selectors/calls';
|
|
||||||
import useLang from '../../../hooks/useLang';
|
import useLang from '../../../hooks/useLang';
|
||||||
|
import usePrevious from '../../../hooks/usePrevious';
|
||||||
|
|
||||||
import AnimatedIcon from '../../common/AnimatedIcon';
|
import AnimatedIcon from '../../common/AnimatedIcon';
|
||||||
import Button from '../../ui/Button';
|
import Button from '../../ui/Button';
|
||||||
|
|||||||
@ -1,9 +1,11 @@
|
|||||||
import type { GroupCallParticipant } from '../../../lib/secret-sauce';
|
|
||||||
import { THRESHOLD } from '../../../lib/secret-sauce';
|
|
||||||
import type { FC } from '../../../lib/teact/teact';
|
import type { FC } from '../../../lib/teact/teact';
|
||||||
import React, { memo, useMemo } from '../../../lib/teact/teact';
|
import React, { memo, useMemo } from '../../../lib/teact/teact';
|
||||||
|
|
||||||
|
import type { GroupCallParticipant } from '../../../lib/secret-sauce';
|
||||||
|
|
||||||
|
import { THRESHOLD } from '../../../lib/secret-sauce';
|
||||||
import { LOCAL_TGS_URLS } from '../../common/helpers/animatedAssets';
|
import { LOCAL_TGS_URLS } from '../../common/helpers/animatedAssets';
|
||||||
|
|
||||||
import usePrevious from '../../../hooks/usePrevious';
|
import usePrevious from '../../../hooks/usePrevious';
|
||||||
|
|
||||||
import AnimatedIcon from '../../common/AnimatedIcon';
|
import AnimatedIcon from '../../common/AnimatedIcon';
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
import type { GroupCallParticipant } from '../../../../lib/secret-sauce';
|
import type { GroupCallParticipant } from '../../../../lib/secret-sauce';
|
||||||
|
|
||||||
import { GROUP_CALL_DEFAULT_VOLUME, GROUP_CALL_VOLUME_MULTIPLIER } from '../../../../config';
|
import { GROUP_CALL_DEFAULT_VOLUME, GROUP_CALL_VOLUME_MULTIPLIER } from '../../../../config';
|
||||||
|
|
||||||
export default function formatGroupCallVolume(participant: GroupCallParticipant) {
|
export default function formatGroupCallVolume(participant: GroupCallParticipant) {
|
||||||
|
|||||||
@ -2,9 +2,10 @@ import type { RefObject } from 'react';
|
|||||||
import {
|
import {
|
||||||
useEffect, useMemo, useState,
|
useEffect, useMemo, useState,
|
||||||
} from '../../../../lib/teact/teact';
|
} from '../../../../lib/teact/teact';
|
||||||
import useResizeObserver from '../../../../hooks/useResizeObserver';
|
|
||||||
import usePrevious from '../../../../hooks/usePrevious';
|
|
||||||
import useLastCallback from '../../../../hooks/useLastCallback';
|
import useLastCallback from '../../../../hooks/useLastCallback';
|
||||||
|
import usePrevious from '../../../../hooks/usePrevious';
|
||||||
|
import useResizeObserver from '../../../../hooks/useResizeObserver';
|
||||||
|
|
||||||
const PADDING_HORIZONTAL = 10;
|
const PADDING_HORIZONTAL = 10;
|
||||||
const PADDING_VERTICAL = 8;
|
const PADDING_VERTICAL = 8;
|
||||||
|
|||||||
@ -1,8 +1,10 @@
|
|||||||
import type { FC } from '../../../lib/teact/teact';
|
import type { FC } from '../../../lib/teact/teact';
|
||||||
import React from '../../../lib/teact/teact';
|
import React from '../../../lib/teact/teact';
|
||||||
import useModuleLoader from '../../../hooks/useModuleLoader';
|
|
||||||
import { Bundles } from '../../../util/moduleLoader';
|
import { Bundles } from '../../../util/moduleLoader';
|
||||||
|
|
||||||
|
import useModuleLoader from '../../../hooks/useModuleLoader';
|
||||||
|
|
||||||
type OwnProps = {
|
type OwnProps = {
|
||||||
isActive?: boolean;
|
isActive?: boolean;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -1,37 +1,39 @@
|
|||||||
|
import '../../../global/actions/calls';
|
||||||
|
|
||||||
import type { FC } from '../../../lib/teact/teact';
|
import type { FC } from '../../../lib/teact/teact';
|
||||||
import React, {
|
import React, {
|
||||||
memo, useCallback, useEffect, useMemo, useRef,
|
memo, useCallback, useEffect, useMemo, useRef,
|
||||||
} from '../../../lib/teact/teact';
|
} from '../../../lib/teact/teact';
|
||||||
import { getActions, withGlobal } from '../../../global';
|
import { getActions, withGlobal } from '../../../global';
|
||||||
import '../../../global/actions/calls';
|
|
||||||
|
|
||||||
import type { ApiPhoneCall, ApiUser } from '../../../api/types';
|
import type { ApiPhoneCall, ApiUser } from '../../../api/types';
|
||||||
|
|
||||||
|
import {
|
||||||
|
getStreams, IS_SCREENSHARE_SUPPORTED, switchCameraInputP2p, toggleStreamP2p,
|
||||||
|
} from '../../../lib/secret-sauce';
|
||||||
|
import { selectTabState } from '../../../global/selectors';
|
||||||
|
import { selectPhoneCallUser } from '../../../global/selectors/calls';
|
||||||
|
import buildClassName from '../../../util/buildClassName';
|
||||||
|
import { formatMediaDuration } from '../../../util/dateFormat';
|
||||||
import {
|
import {
|
||||||
IS_ANDROID,
|
IS_ANDROID,
|
||||||
IS_IOS,
|
IS_IOS,
|
||||||
IS_REQUEST_FULLSCREEN_SUPPORTED,
|
IS_REQUEST_FULLSCREEN_SUPPORTED,
|
||||||
} from '../../../util/windowEnvironment';
|
} from '../../../util/windowEnvironment';
|
||||||
import { LOCAL_TGS_URLS } from '../../common/helpers/animatedAssets';
|
import { LOCAL_TGS_URLS } from '../../common/helpers/animatedAssets';
|
||||||
import { selectTabState } from '../../../global/selectors';
|
|
||||||
import buildClassName from '../../../util/buildClassName';
|
|
||||||
import { selectPhoneCallUser } from '../../../global/selectors/calls';
|
|
||||||
import useLang from '../../../hooks/useLang';
|
|
||||||
import renderText from '../../common/helpers/renderText';
|
import renderText from '../../common/helpers/renderText';
|
||||||
import useFlag from '../../../hooks/useFlag';
|
|
||||||
import { formatMediaDuration } from '../../../util/dateFormat';
|
|
||||||
import {
|
|
||||||
getStreams, IS_SCREENSHARE_SUPPORTED, switchCameraInputP2p, toggleStreamP2p,
|
|
||||||
} from '../../../lib/secret-sauce';
|
|
||||||
import useInterval from '../../../hooks/useInterval';
|
|
||||||
import useForceUpdate from '../../../hooks/useForceUpdate';
|
|
||||||
import useAppLayout from '../../../hooks/useAppLayout';
|
|
||||||
|
|
||||||
import Modal from '../../ui/Modal';
|
import useAppLayout from '../../../hooks/useAppLayout';
|
||||||
|
import useFlag from '../../../hooks/useFlag';
|
||||||
|
import useForceUpdate from '../../../hooks/useForceUpdate';
|
||||||
|
import useInterval from '../../../hooks/useInterval';
|
||||||
|
import useLang from '../../../hooks/useLang';
|
||||||
|
|
||||||
|
import AnimatedIcon from '../../common/AnimatedIcon';
|
||||||
import Avatar from '../../common/Avatar';
|
import Avatar from '../../common/Avatar';
|
||||||
import Button from '../../ui/Button';
|
import Button from '../../ui/Button';
|
||||||
|
import Modal from '../../ui/Modal';
|
||||||
import PhoneCallButton from './PhoneCallButton';
|
import PhoneCallButton from './PhoneCallButton';
|
||||||
import AnimatedIcon from '../../common/AnimatedIcon';
|
|
||||||
|
|
||||||
import styles from './PhoneCall.module.scss';
|
import styles from './PhoneCall.module.scss';
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,7 @@ import type { FC } from '../../../lib/teact/teact';
|
|||||||
import React from '../../../lib/teact/teact';
|
import React from '../../../lib/teact/teact';
|
||||||
|
|
||||||
import type { OwnProps } from './RatePhoneCallModal';
|
import type { OwnProps } from './RatePhoneCallModal';
|
||||||
|
|
||||||
import { Bundles } from '../../../util/moduleLoader';
|
import { Bundles } from '../../../util/moduleLoader';
|
||||||
|
|
||||||
import useModuleLoader from '../../../hooks/useModuleLoader';
|
import useModuleLoader from '../../../hooks/useModuleLoader';
|
||||||
|
|||||||
@ -1,16 +1,16 @@
|
|||||||
|
import type { FC } from '../../../lib/teact/teact';
|
||||||
import React, {
|
import React, {
|
||||||
memo, useRef, useState, useCallback,
|
memo, useCallback, useRef, useState,
|
||||||
} from '../../../lib/teact/teact';
|
} from '../../../lib/teact/teact';
|
||||||
import { getActions } from '../../../global';
|
import { getActions } from '../../../global';
|
||||||
|
|
||||||
import type { FC } from '../../../lib/teact/teact';
|
|
||||||
|
|
||||||
import useLang from '../../../hooks/useLang';
|
|
||||||
import buildClassName from '../../../util/buildClassName';
|
import buildClassName from '../../../util/buildClassName';
|
||||||
|
|
||||||
import Modal from '../../ui/Modal';
|
import useLang from '../../../hooks/useLang';
|
||||||
|
|
||||||
import Button from '../../ui/Button';
|
import Button from '../../ui/Button';
|
||||||
import InputText from '../../ui/InputText';
|
import InputText from '../../ui/InputText';
|
||||||
|
import Modal from '../../ui/Modal';
|
||||||
|
|
||||||
import styles from './RatePhoneCallModal.module.scss';
|
import styles from './RatePhoneCallModal.module.scss';
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
import type { FC } from '../../lib/teact/teact';
|
import type { FC } from '../../lib/teact/teact';
|
||||||
import React from '../../lib/teact/teact';
|
import React from '../../lib/teact/teact';
|
||||||
|
|
||||||
import type { OwnProps } from './AboutAdsModal';
|
import type { OwnProps } from './AboutAdsModal';
|
||||||
|
|
||||||
import { Bundles } from '../../util/moduleLoader';
|
import { Bundles } from '../../util/moduleLoader';
|
||||||
|
|
||||||
import useModuleLoader from '../../hooks/useModuleLoader';
|
import useModuleLoader from '../../hooks/useModuleLoader';
|
||||||
|
|||||||
@ -2,10 +2,11 @@ import type { FC } from '../../lib/teact/teact';
|
|||||||
import React, { memo } from '../../lib/teact/teact';
|
import React, { memo } from '../../lib/teact/teact';
|
||||||
|
|
||||||
import renderText from './helpers/renderText';
|
import renderText from './helpers/renderText';
|
||||||
|
|
||||||
import useLang from '../../hooks/useLang';
|
import useLang from '../../hooks/useLang';
|
||||||
|
|
||||||
import Modal from '../ui/Modal';
|
|
||||||
import Button from '../ui/Button';
|
import Button from '../ui/Button';
|
||||||
|
import Modal from '../ui/Modal';
|
||||||
import SafeLink from './SafeLink';
|
import SafeLink from './SafeLink';
|
||||||
|
|
||||||
export type OwnProps = {
|
export type OwnProps = {
|
||||||
|
|||||||
@ -4,10 +4,11 @@ import React, {
|
|||||||
} from '../../lib/teact/teact';
|
} from '../../lib/teact/teact';
|
||||||
import { getGlobal } from '../../global';
|
import { getGlobal } from '../../global';
|
||||||
|
|
||||||
import buildClassName from '../../util/buildClassName';
|
|
||||||
import { selectCanAnimateInterface } from '../../global/selectors';
|
import { selectCanAnimateInterface } from '../../global/selectors';
|
||||||
import useLang from '../../hooks/useLang';
|
import buildClassName from '../../util/buildClassName';
|
||||||
|
|
||||||
import useFlag from '../../hooks/useFlag';
|
import useFlag from '../../hooks/useFlag';
|
||||||
|
import useLang from '../../hooks/useLang';
|
||||||
|
|
||||||
import styles from './AnimatedCounter.module.scss';
|
import styles from './AnimatedCounter.module.scss';
|
||||||
|
|
||||||
|
|||||||
@ -4,9 +4,9 @@ import type { OwnProps as AnimatedStickerProps } from './AnimatedSticker';
|
|||||||
|
|
||||||
import buildClassName from '../../util/buildClassName';
|
import buildClassName from '../../util/buildClassName';
|
||||||
|
|
||||||
|
import useFlag from '../../hooks/useFlag';
|
||||||
import useLastCallback from '../../hooks/useLastCallback';
|
import useLastCallback from '../../hooks/useLastCallback';
|
||||||
import useMediaTransition from '../../hooks/useMediaTransition';
|
import useMediaTransition from '../../hooks/useMediaTransition';
|
||||||
import useFlag from '../../hooks/useFlag';
|
|
||||||
|
|
||||||
import AnimatedSticker from './AnimatedSticker';
|
import AnimatedSticker from './AnimatedSticker';
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import React, { memo } from '../../lib/teact/teact';
|
import React, { memo } from '../../lib/teact/teact';
|
||||||
|
|
||||||
import type { OwnProps as AnimatedIconProps } from './AnimatedIcon';
|
|
||||||
import type { ApiSticker } from '../../api/types';
|
import type { ApiSticker } from '../../api/types';
|
||||||
|
import type { OwnProps as AnimatedIconProps } from './AnimatedIcon';
|
||||||
import { ApiMediaFormat } from '../../api/types';
|
import { ApiMediaFormat } from '../../api/types';
|
||||||
|
|
||||||
import { getStickerPreviewHash } from '../../global/helpers';
|
import { getStickerPreviewHash } from '../../global/helpers';
|
||||||
|
|||||||
@ -1,14 +1,15 @@
|
|||||||
import React, { memo } from '../../lib/teact/teact';
|
import React, { memo } from '../../lib/teact/teact';
|
||||||
|
|
||||||
import type { OwnProps as AnimatedIconProps } from './AnimatedIcon';
|
import type { OwnProps as AnimatedIconProps } from './AnimatedIcon';
|
||||||
import AnimatedIcon from './AnimatedIcon';
|
|
||||||
|
|
||||||
import buildClassName from '../../util/buildClassName';
|
import buildClassName from '../../util/buildClassName';
|
||||||
import buildStyle from '../../util/buildStyle';
|
import buildStyle from '../../util/buildStyle';
|
||||||
|
|
||||||
|
import useFlag from '../../hooks/useFlag';
|
||||||
import useLastCallback from '../../hooks/useLastCallback';
|
import useLastCallback from '../../hooks/useLastCallback';
|
||||||
import useMediaTransition from '../../hooks/useMediaTransition';
|
import useMediaTransition from '../../hooks/useMediaTransition';
|
||||||
import useFlag from '../../hooks/useFlag';
|
|
||||||
|
import AnimatedIcon from './AnimatedIcon';
|
||||||
|
|
||||||
import styles from './AnimatedIconWithPreview.module.scss';
|
import styles from './AnimatedIconWithPreview.module.scss';
|
||||||
|
|
||||||
|
|||||||
@ -1,30 +1,29 @@
|
|||||||
import type { RefObject } from 'react';
|
import type { RefObject } from 'react';
|
||||||
import type { FC } from '../../lib/teact/teact';
|
import type { FC } from '../../lib/teact/teact';
|
||||||
import type RLottieInstance from '../../lib/rlottie/RLottie';
|
|
||||||
import { requestMeasure } from '../../lib/fasterdom/fasterdom';
|
|
||||||
import { ensureRLottie, getRLottie } from '../../lib/rlottie/RLottie.async';
|
|
||||||
|
|
||||||
import React, {
|
import React, {
|
||||||
useEffect, useRef, memo, useState,
|
memo, useEffect, useRef, useState,
|
||||||
} from '../../lib/teact/teact';
|
} from '../../lib/teact/teact';
|
||||||
|
|
||||||
import { IS_ELECTRON } from '../../config';
|
import type RLottieInstance from '../../lib/rlottie/RLottie';
|
||||||
|
|
||||||
|
import { IS_ELECTRON } from '../../config';
|
||||||
|
import { requestMeasure } from '../../lib/fasterdom/fasterdom';
|
||||||
|
import { ensureRLottie, getRLottie } from '../../lib/rlottie/RLottie.async';
|
||||||
import buildClassName from '../../util/buildClassName';
|
import buildClassName from '../../util/buildClassName';
|
||||||
import buildStyle from '../../util/buildStyle';
|
import buildStyle from '../../util/buildStyle';
|
||||||
import generateUniqueId from '../../util/generateUniqueId';
|
import generateUniqueId from '../../util/generateUniqueId';
|
||||||
import { hexToRgb } from '../../util/switchTheme';
|
import { hexToRgb } from '../../util/switchTheme';
|
||||||
|
|
||||||
import useLastCallback from '../../hooks/useLastCallback';
|
import useColorFilter from '../../hooks/stickers/useColorFilter';
|
||||||
import useHeavyAnimationCheck, { isHeavyAnimating } from '../../hooks/useHeavyAnimationCheck';
|
|
||||||
import usePriorityPlaybackCheck, { isPriorityPlaybackActive } from '../../hooks/usePriorityPlaybackCheck';
|
|
||||||
import useBackgroundMode, { isBackgroundModeActive } from '../../hooks/useBackgroundMode';
|
import useBackgroundMode, { isBackgroundModeActive } from '../../hooks/useBackgroundMode';
|
||||||
import useEffectWithPrevDeps from '../../hooks/useEffectWithPrevDeps';
|
import useEffectWithPrevDeps from '../../hooks/useEffectWithPrevDeps';
|
||||||
import { useStateRef } from '../../hooks/useStateRef';
|
import useHeavyAnimationCheck, { isHeavyAnimating } from '../../hooks/useHeavyAnimationCheck';
|
||||||
|
import useLastCallback from '../../hooks/useLastCallback';
|
||||||
|
import usePriorityPlaybackCheck, { isPriorityPlaybackActive } from '../../hooks/usePriorityPlaybackCheck';
|
||||||
import useSharedIntersectionObserver from '../../hooks/useSharedIntersectionObserver';
|
import useSharedIntersectionObserver from '../../hooks/useSharedIntersectionObserver';
|
||||||
import useThrottledCallback from '../../hooks/useThrottledCallback';
|
import { useStateRef } from '../../hooks/useStateRef';
|
||||||
import useColorFilter from '../../hooks/stickers/useColorFilter';
|
|
||||||
import useSyncEffect from '../../hooks/useSyncEffect';
|
import useSyncEffect from '../../hooks/useSyncEffect';
|
||||||
|
import useThrottledCallback from '../../hooks/useThrottledCallback';
|
||||||
import useUniqueId from '../../hooks/useUniqueId';
|
import useUniqueId from '../../hooks/useUniqueId';
|
||||||
|
|
||||||
export type OwnProps = {
|
export type OwnProps = {
|
||||||
|
|||||||
@ -5,14 +5,12 @@ import React, {
|
|||||||
import { getActions } from '../../global';
|
import { getActions } from '../../global';
|
||||||
|
|
||||||
import type { ApiAudio, ApiMessage, ApiVoice } from '../../api/types';
|
import type { ApiAudio, ApiMessage, ApiVoice } from '../../api/types';
|
||||||
import { ApiMediaFormat } from '../../api/types';
|
import type { BufferedRange } from '../../hooks/useBuffering';
|
||||||
import type { ISettings } from '../../types';
|
|
||||||
import { AudioOrigin } from '../../types';
|
|
||||||
import type { LangFn } from '../../hooks/useLang';
|
import type { LangFn } from '../../hooks/useLang';
|
||||||
|
import type { ISettings } from '../../types';
|
||||||
|
import { ApiMediaFormat } from '../../api/types';
|
||||||
|
import { AudioOrigin } from '../../types';
|
||||||
|
|
||||||
import { MAX_EMPTY_WAVEFORM_POINTS, renderWaveform } from './helpers/waveform';
|
|
||||||
import renderText from './helpers/renderText';
|
|
||||||
import { getFileSizeString } from './helpers/documentInfo';
|
|
||||||
import {
|
import {
|
||||||
getMediaDuration,
|
getMediaDuration,
|
||||||
getMediaTransferState,
|
getMediaTransferState,
|
||||||
@ -21,25 +19,27 @@ import {
|
|||||||
isMessageLocal,
|
isMessageLocal,
|
||||||
isOwnMessage,
|
isOwnMessage,
|
||||||
} from '../../global/helpers';
|
} from '../../global/helpers';
|
||||||
|
import { makeTrackId } from '../../util/audioPlayer';
|
||||||
import buildClassName from '../../util/buildClassName';
|
import buildClassName from '../../util/buildClassName';
|
||||||
|
import { captureEvents } from '../../util/captureEvents';
|
||||||
import { formatMediaDateTime, formatMediaDuration, formatPastTimeShort } from '../../util/dateFormat';
|
import { formatMediaDateTime, formatMediaDuration, formatPastTimeShort } from '../../util/dateFormat';
|
||||||
import { decodeWaveform, interpolateArray } from '../../util/waveform';
|
import { decodeWaveform, interpolateArray } from '../../util/waveform';
|
||||||
import { makeTrackId } from '../../util/audioPlayer';
|
import { getFileSizeString } from './helpers/documentInfo';
|
||||||
|
import renderText from './helpers/renderText';
|
||||||
|
import { MAX_EMPTY_WAVEFORM_POINTS, renderWaveform } from './helpers/waveform';
|
||||||
|
|
||||||
|
import useAppLayout from '../../hooks/useAppLayout';
|
||||||
|
import useAudioPlayer from '../../hooks/useAudioPlayer';
|
||||||
|
import useBuffering from '../../hooks/useBuffering';
|
||||||
|
import useLang from '../../hooks/useLang';
|
||||||
import useLastCallback from '../../hooks/useLastCallback';
|
import useLastCallback from '../../hooks/useLastCallback';
|
||||||
|
import useMedia from '../../hooks/useMedia';
|
||||||
import useMediaWithLoadProgress from '../../hooks/useMediaWithLoadProgress';
|
import useMediaWithLoadProgress from '../../hooks/useMediaWithLoadProgress';
|
||||||
import useShowTransition from '../../hooks/useShowTransition';
|
import useShowTransition from '../../hooks/useShowTransition';
|
||||||
import type { BufferedRange } from '../../hooks/useBuffering';
|
|
||||||
import useBuffering from '../../hooks/useBuffering';
|
|
||||||
import useAudioPlayer from '../../hooks/useAudioPlayer';
|
|
||||||
import useLang from '../../hooks/useLang';
|
|
||||||
import { captureEvents } from '../../util/captureEvents';
|
|
||||||
import useMedia from '../../hooks/useMedia';
|
|
||||||
import useAppLayout from '../../hooks/useAppLayout';
|
|
||||||
|
|
||||||
import Button from '../ui/Button';
|
import Button from '../ui/Button';
|
||||||
import ProgressSpinner from '../ui/ProgressSpinner';
|
|
||||||
import Link from '../ui/Link';
|
import Link from '../ui/Link';
|
||||||
|
import ProgressSpinner from '../ui/ProgressSpinner';
|
||||||
|
|
||||||
import './Audio.scss';
|
import './Audio.scss';
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
import type { MouseEvent as ReactMouseEvent } from 'react';
|
import type { MouseEvent as ReactMouseEvent } from 'react';
|
||||||
|
import type { FC, TeactNode } from '../../lib/teact/teact';
|
||||||
import React, { memo, useRef } from '../../lib/teact/teact';
|
import React, { memo, useRef } from '../../lib/teact/teact';
|
||||||
import { getActions } from '../../global';
|
import { getActions } from '../../global';
|
||||||
|
|
||||||
import type { FC, TeactNode } from '../../lib/teact/teact';
|
|
||||||
import type { ApiChat, ApiPhoto, ApiUser } from '../../api/types';
|
import type { ApiChat, ApiPhoto, ApiUser } from '../../api/types';
|
||||||
import type { ObserveFn } from '../../hooks/useIntersectionObserver';
|
import type { ObserveFn } from '../../hooks/useIntersectionObserver';
|
||||||
import type { StoryViewerOrigin } from '../../types';
|
import type { StoryViewerOrigin } from '../../types';
|
||||||
@ -14,20 +14,20 @@ import {
|
|||||||
getChatTitle,
|
getChatTitle,
|
||||||
getUserColorKey,
|
getUserColorKey,
|
||||||
getUserFullName,
|
getUserFullName,
|
||||||
isUserId,
|
getUserStoryHtmlId,
|
||||||
isChatWithRepliesBot,
|
isChatWithRepliesBot,
|
||||||
isDeletedUser,
|
isDeletedUser,
|
||||||
getUserStoryHtmlId,
|
isUserId,
|
||||||
} from '../../global/helpers';
|
} from '../../global/helpers';
|
||||||
import { getFirstLetters } from '../../util/textFormat';
|
|
||||||
import buildClassName, { createClassNameBuilder } from '../../util/buildClassName';
|
import buildClassName, { createClassNameBuilder } from '../../util/buildClassName';
|
||||||
|
import { getFirstLetters } from '../../util/textFormat';
|
||||||
import renderText from './helpers/renderText';
|
import renderText from './helpers/renderText';
|
||||||
|
|
||||||
import useMedia from '../../hooks/useMedia';
|
import { useFastClick } from '../../hooks/useFastClick';
|
||||||
import useMediaTransition from '../../hooks/useMediaTransition';
|
|
||||||
import useLang from '../../hooks/useLang';
|
import useLang from '../../hooks/useLang';
|
||||||
import useLastCallback from '../../hooks/useLastCallback';
|
import useLastCallback from '../../hooks/useLastCallback';
|
||||||
import { useFastClick } from '../../hooks/useFastClick';
|
import useMedia from '../../hooks/useMedia';
|
||||||
|
import useMediaTransition from '../../hooks/useMediaTransition';
|
||||||
|
|
||||||
import OptimizedVideo from '../ui/OptimizedVideo';
|
import OptimizedVideo from '../ui/OptimizedVideo';
|
||||||
import AvatarStoryCircle from './AvatarStoryCircle';
|
import AvatarStoryCircle from './AvatarStoryCircle';
|
||||||
|
|||||||
@ -1,10 +1,11 @@
|
|||||||
import type { FC } from '../../lib/teact/teact';
|
import type { FC } from '../../lib/teact/teact';
|
||||||
import React, { memo } from '../../lib/teact/teact';
|
import React, { memo } from '../../lib/teact/teact';
|
||||||
|
|
||||||
import type { AvatarSize } from './Avatar';
|
|
||||||
import type { ApiChat, ApiUser } from '../../api/types';
|
import type { ApiChat, ApiUser } from '../../api/types';
|
||||||
|
import type { AvatarSize } from './Avatar';
|
||||||
|
|
||||||
import buildClassName from '../../util/buildClassName';
|
import buildClassName from '../../util/buildClassName';
|
||||||
|
|
||||||
import useLang from '../../hooks/useLang';
|
import useLang from '../../hooks/useLang';
|
||||||
|
|
||||||
import Avatar from './Avatar';
|
import Avatar from './Avatar';
|
||||||
|
|||||||
@ -3,13 +3,13 @@ import React, {
|
|||||||
} from '../../lib/teact/teact';
|
} from '../../lib/teact/teact';
|
||||||
import { withGlobal } from '../../global';
|
import { withGlobal } from '../../global';
|
||||||
|
|
||||||
import type { AvatarSize } from './Avatar';
|
|
||||||
import type { ThemeKey } from '../../types';
|
import type { ThemeKey } from '../../types';
|
||||||
|
import type { AvatarSize } from './Avatar';
|
||||||
|
|
||||||
import { REM } from './helpers/mediaDimensions';
|
|
||||||
import { DPR } from '../../util/windowEnvironment';
|
|
||||||
import { selectTheme, selectUser, selectUserStories } from '../../global/selectors';
|
import { selectTheme, selectUser, selectUserStories } from '../../global/selectors';
|
||||||
import buildClassName from '../../util/buildClassName';
|
import buildClassName from '../../util/buildClassName';
|
||||||
|
import { DPR } from '../../util/windowEnvironment';
|
||||||
|
import { REM } from './helpers/mediaDimensions';
|
||||||
|
|
||||||
interface OwnProps {
|
interface OwnProps {
|
||||||
// eslint-disable-next-line react/no-unused-prop-types
|
// eslint-disable-next-line react/no-unused-prop-types
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
import type { FC } from '../../lib/teact/teact';
|
import type { FC } from '../../lib/teact/teact';
|
||||||
import React from '../../lib/teact/teact';
|
import React from '../../lib/teact/teact';
|
||||||
|
|
||||||
import type { OwnProps } from './CalendarModal';
|
import type { OwnProps } from './CalendarModal';
|
||||||
|
|
||||||
import { Bundles } from '../../util/moduleLoader';
|
import { Bundles } from '../../util/moduleLoader';
|
||||||
|
|
||||||
import useModuleLoader from '../../hooks/useModuleLoader';
|
import useModuleLoader from '../../hooks/useModuleLoader';
|
||||||
|
|||||||
@ -1,18 +1,20 @@
|
|||||||
import type { FC } from '../../lib/teact/teact';
|
import type { FC } from '../../lib/teact/teact';
|
||||||
import React, {
|
import React, {
|
||||||
memo, useState, useEffect, useMemo, useCallback,
|
memo, useCallback, useEffect, useMemo, useState,
|
||||||
} from '../../lib/teact/teact';
|
} from '../../lib/teact/teact';
|
||||||
|
|
||||||
|
import type { LangFn } from '../../hooks/useLang';
|
||||||
|
|
||||||
import { MAX_INT_32 } from '../../config';
|
import { MAX_INT_32 } from '../../config';
|
||||||
import buildClassName from '../../util/buildClassName';
|
import buildClassName from '../../util/buildClassName';
|
||||||
import { formatTime, formatDateToString, getDayStart } from '../../util/dateFormat';
|
import { formatDateToString, formatTime, getDayStart } from '../../util/dateFormat';
|
||||||
import type { LangFn } from '../../hooks/useLang';
|
|
||||||
|
import useFlag from '../../hooks/useFlag';
|
||||||
import useLang from '../../hooks/useLang';
|
import useLang from '../../hooks/useLang';
|
||||||
import usePrevious from '../../hooks/usePrevious';
|
import usePrevious from '../../hooks/usePrevious';
|
||||||
import useFlag from '../../hooks/useFlag';
|
|
||||||
|
|
||||||
import Modal from '../ui/Modal';
|
|
||||||
import Button from '../ui/Button';
|
import Button from '../ui/Button';
|
||||||
|
import Modal from '../ui/Modal';
|
||||||
|
|
||||||
import './CalendarModal.scss';
|
import './CalendarModal.scss';
|
||||||
|
|
||||||
|
|||||||
@ -1,15 +1,24 @@
|
|||||||
|
import type { FC } from '../../lib/teact/teact';
|
||||||
import React, {
|
import React, {
|
||||||
memo, useEffect, useMemo, useState,
|
memo, useEffect, useMemo, useState,
|
||||||
} from '../../lib/teact/teact';
|
} from '../../lib/teact/teact';
|
||||||
import { getActions, withGlobal } from '../../global';
|
import { getActions, withGlobal } from '../../global';
|
||||||
|
|
||||||
import type { FC } from '../../lib/teact/teact';
|
|
||||||
import type {
|
import type {
|
||||||
ApiChat, ApiCountryCode, ApiUser, ApiUsername,
|
ApiChat, ApiCountryCode, ApiUser, ApiUsername,
|
||||||
} from '../../api/types';
|
} from '../../api/types';
|
||||||
import { MAIN_THREAD_ID } from '../../api/types';
|
import { MAIN_THREAD_ID } from '../../api/types';
|
||||||
|
|
||||||
import { TME_LINK_PREFIX } from '../../config';
|
import { TME_LINK_PREFIX } from '../../config';
|
||||||
|
import {
|
||||||
|
getChatLink,
|
||||||
|
getHasAdminRight,
|
||||||
|
getTopicLink,
|
||||||
|
isChatChannel,
|
||||||
|
isUserId,
|
||||||
|
isUserRightBanned,
|
||||||
|
selectIsChatMuted,
|
||||||
|
} from '../../global/helpers';
|
||||||
import {
|
import {
|
||||||
selectChat,
|
selectChat,
|
||||||
selectChatFullInfo,
|
selectChatFullInfo,
|
||||||
@ -19,23 +28,14 @@ import {
|
|||||||
selectUser,
|
selectUser,
|
||||||
selectUserFullInfo,
|
selectUserFullInfo,
|
||||||
} from '../../global/selectors';
|
} from '../../global/selectors';
|
||||||
import {
|
|
||||||
getChatLink,
|
|
||||||
getTopicLink,
|
|
||||||
getHasAdminRight,
|
|
||||||
isChatChannel,
|
|
||||||
isUserId,
|
|
||||||
isUserRightBanned,
|
|
||||||
selectIsChatMuted,
|
|
||||||
} from '../../global/helpers';
|
|
||||||
import renderText from './helpers/renderText';
|
|
||||||
import { copyTextToClipboard } from '../../util/clipboard';
|
import { copyTextToClipboard } from '../../util/clipboard';
|
||||||
import { formatPhoneNumberWithCode } from '../../util/phoneNumber';
|
import { formatPhoneNumberWithCode } from '../../util/phoneNumber';
|
||||||
import { debounce } from '../../util/schedulers';
|
import { debounce } from '../../util/schedulers';
|
||||||
import stopEvent from '../../util/stopEvent';
|
import stopEvent from '../../util/stopEvent';
|
||||||
|
import renderText from './helpers/renderText';
|
||||||
|
|
||||||
import useLastCallback from '../../hooks/useLastCallback';
|
|
||||||
import useLang from '../../hooks/useLang';
|
import useLang from '../../hooks/useLang';
|
||||||
|
import useLastCallback from '../../hooks/useLastCallback';
|
||||||
|
|
||||||
import ListItem from '../ui/ListItem';
|
import ListItem from '../ui/ListItem';
|
||||||
import Switcher from '../ui/Switcher';
|
import Switcher from '../ui/Switcher';
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
import type { FC } from '../../lib/teact/teact';
|
||||||
import React, {
|
import React, {
|
||||||
memo,
|
memo,
|
||||||
useEffect,
|
useEffect,
|
||||||
@ -7,18 +8,18 @@ import React, {
|
|||||||
} from '../../lib/teact/teact';
|
} from '../../lib/teact/teact';
|
||||||
import { getActions } from '../../global';
|
import { getActions } from '../../global';
|
||||||
|
|
||||||
import type { ObserveFn } from '../../hooks/useIntersectionObserver';
|
|
||||||
import type { FC } from '../../lib/teact/teact';
|
|
||||||
import type { ApiChat } from '../../api/types';
|
import type { ApiChat } from '../../api/types';
|
||||||
|
import type { ObserveFn } from '../../hooks/useIntersectionObserver';
|
||||||
|
|
||||||
import buildClassName from '../../util/buildClassName';
|
|
||||||
import { getOrderedTopics } from '../../global/helpers';
|
import { getOrderedTopics } from '../../global/helpers';
|
||||||
import { getIsMobile } from '../../hooks/useAppLayout';
|
import buildClassName from '../../util/buildClassName';
|
||||||
import useLang from '../../hooks/useLang';
|
|
||||||
import { useFastClick } from '../../hooks/useFastClick';
|
|
||||||
import { REM } from './helpers/mediaDimensions';
|
import { REM } from './helpers/mediaDimensions';
|
||||||
import renderText from './helpers/renderText';
|
import renderText from './helpers/renderText';
|
||||||
|
|
||||||
|
import { getIsMobile } from '../../hooks/useAppLayout';
|
||||||
|
import { useFastClick } from '../../hooks/useFastClick';
|
||||||
|
import useLang from '../../hooks/useLang';
|
||||||
|
|
||||||
import TopicIcon from './TopicIcon';
|
import TopicIcon from './TopicIcon';
|
||||||
|
|
||||||
import styles from './ChatForumLastMessage.module.scss';
|
import styles from './ChatForumLastMessage.module.scss';
|
||||||
|
|||||||
@ -1,8 +1,7 @@
|
|||||||
|
import type { FC } from '../../lib/teact/teact';
|
||||||
import React, { memo, useCallback } from '../../lib/teact/teact';
|
import React, { memo, useCallback } from '../../lib/teact/teact';
|
||||||
import { getActions } from '../../global';
|
import { getActions } from '../../global';
|
||||||
|
|
||||||
import type { FC } from '../../lib/teact/teact';
|
|
||||||
|
|
||||||
import buildClassName from '../../util/buildClassName';
|
import buildClassName from '../../util/buildClassName';
|
||||||
|
|
||||||
import Link from '../ui/Link';
|
import Link from '../ui/Link';
|
||||||
|
|||||||
@ -1,32 +1,32 @@
|
|||||||
import type { FC } from '../../lib/teact/teact';
|
import type { FC } from '../../lib/teact/teact';
|
||||||
import React, {
|
import React, {
|
||||||
memo, useRef, useState, useMemo,
|
memo, useMemo, useRef, useState,
|
||||||
} from '../../lib/teact/teact';
|
} from '../../lib/teact/teact';
|
||||||
import { getActions } from '../../global';
|
import { getActions } from '../../global';
|
||||||
|
|
||||||
import type { ApiChat, ApiTopic } from '../../api/types';
|
import type { ApiChat, ApiTopic } from '../../api/types';
|
||||||
|
|
||||||
import { REM } from './helpers/mediaDimensions';
|
|
||||||
import { CHAT_HEIGHT_PX } from '../../config';
|
import { CHAT_HEIGHT_PX } from '../../config';
|
||||||
import renderText from './helpers/renderText';
|
|
||||||
import { getCanPostInChat, isUserId } from '../../global/helpers';
|
import { getCanPostInChat, isUserId } from '../../global/helpers';
|
||||||
import buildClassName from '../../util/buildClassName';
|
import buildClassName from '../../util/buildClassName';
|
||||||
|
import { REM } from './helpers/mediaDimensions';
|
||||||
|
import renderText from './helpers/renderText';
|
||||||
|
|
||||||
import useLastCallback from '../../hooks/useLastCallback';
|
|
||||||
import useInfiniteScroll from '../../hooks/useInfiniteScroll';
|
import useInfiniteScroll from '../../hooks/useInfiniteScroll';
|
||||||
import useLang from '../../hooks/useLang';
|
|
||||||
import useKeyboardListNavigation from '../../hooks/useKeyboardListNavigation';
|
|
||||||
import useInputFocusOnOpen from '../../hooks/useInputFocusOnOpen';
|
import useInputFocusOnOpen from '../../hooks/useInputFocusOnOpen';
|
||||||
|
import useKeyboardListNavigation from '../../hooks/useKeyboardListNavigation';
|
||||||
|
import useLang from '../../hooks/useLang';
|
||||||
|
import useLastCallback from '../../hooks/useLastCallback';
|
||||||
|
|
||||||
import Loading from '../ui/Loading';
|
|
||||||
import Modal from '../ui/Modal';
|
|
||||||
import InputText from '../ui/InputText';
|
|
||||||
import Button from '../ui/Button';
|
import Button from '../ui/Button';
|
||||||
import InfiniteScroll from '../ui/InfiniteScroll';
|
import InfiniteScroll from '../ui/InfiniteScroll';
|
||||||
|
import InputText from '../ui/InputText';
|
||||||
import ListItem from '../ui/ListItem';
|
import ListItem from '../ui/ListItem';
|
||||||
|
import Loading from '../ui/Loading';
|
||||||
|
import Modal from '../ui/Modal';
|
||||||
|
import Transition from '../ui/Transition';
|
||||||
import GroupChatInfo from './GroupChatInfo';
|
import GroupChatInfo from './GroupChatInfo';
|
||||||
import PrivateChatInfo from './PrivateChatInfo';
|
import PrivateChatInfo from './PrivateChatInfo';
|
||||||
import Transition from '../ui/Transition';
|
|
||||||
import TopicIcon from './TopicIcon';
|
import TopicIcon from './TopicIcon';
|
||||||
|
|
||||||
import './ChatOrUserPicker.scss';
|
import './ChatOrUserPicker.scss';
|
||||||
|
|||||||
@ -1,16 +1,12 @@
|
|||||||
|
import type { FC } from '../../lib/teact/teact';
|
||||||
import React, {
|
import React, {
|
||||||
memo, useEffect, useMemo, useRef, useState,
|
memo, useEffect, useMemo, useRef, useState,
|
||||||
} from '../../lib/teact/teact';
|
} from '../../lib/teact/teact';
|
||||||
import { requestMeasure, requestNextMutation } from '../../lib/fasterdom/fasterdom';
|
|
||||||
import { getActions, getGlobal, withGlobal } from '../../global';
|
import { getActions, getGlobal, withGlobal } from '../../global';
|
||||||
|
|
||||||
import type { FC } from '../../lib/teact/teact';
|
|
||||||
import type {
|
import type {
|
||||||
TabState, MessageListType, GlobalState, ApiDraft, MessageList,
|
|
||||||
} from '../../global/types';
|
|
||||||
import type {
|
|
||||||
ApiAttachMenuPeerType,
|
|
||||||
ApiAttachment,
|
ApiAttachment,
|
||||||
|
ApiAttachMenuPeerType,
|
||||||
ApiAvailableReaction,
|
ApiAvailableReaction,
|
||||||
ApiBotCommand,
|
ApiBotCommand,
|
||||||
ApiBotInlineMediaResult,
|
ApiBotInlineMediaResult,
|
||||||
@ -29,7 +25,10 @@ import type {
|
|||||||
ApiUser,
|
ApiUser,
|
||||||
ApiVideo,
|
ApiVideo,
|
||||||
} from '../../api/types';
|
} from '../../api/types';
|
||||||
import type { InlineBotSettings, ISettings, IAnchorPosition } from '../../types';
|
import type {
|
||||||
|
ApiDraft, GlobalState, MessageList, MessageListType, TabState,
|
||||||
|
} from '../../global/types';
|
||||||
|
import type { IAnchorPosition, InlineBotSettings, ISettings } from '../../types';
|
||||||
|
|
||||||
import {
|
import {
|
||||||
BASE_EMOJI_KEYWORD_LANG,
|
BASE_EMOJI_KEYWORD_LANG,
|
||||||
@ -39,8 +38,14 @@ import {
|
|||||||
SCHEDULED_WHEN_ONLINE,
|
SCHEDULED_WHEN_ONLINE,
|
||||||
SEND_MESSAGE_ACTION_INTERVAL,
|
SEND_MESSAGE_ACTION_INTERVAL,
|
||||||
} from '../../config';
|
} from '../../config';
|
||||||
import { IS_VOICE_RECORDING_SUPPORTED, IS_IOS } from '../../util/windowEnvironment';
|
import { requestMeasure, requestNextMutation } from '../../lib/fasterdom/fasterdom';
|
||||||
import { MEMO_EMPTY_ARRAY } from '../../util/memo';
|
import {
|
||||||
|
getAllowedAttachmentOptions,
|
||||||
|
isChatAdmin,
|
||||||
|
isChatChannel,
|
||||||
|
isChatSuperGroup,
|
||||||
|
isUserId,
|
||||||
|
} from '../../global/helpers';
|
||||||
import {
|
import {
|
||||||
selectBot,
|
selectBot,
|
||||||
selectCanPlayAnimatedEmojis,
|
selectCanPlayAnimatedEmojis,
|
||||||
@ -71,84 +76,79 @@ import {
|
|||||||
selectUserFullInfo,
|
selectUserFullInfo,
|
||||||
selectUserStory,
|
selectUserStory,
|
||||||
} from '../../global/selectors';
|
} from '../../global/selectors';
|
||||||
import {
|
import { selectCurrentLimit } from '../../global/selectors/limits';
|
||||||
getAllowedAttachmentOptions,
|
import buildClassName from '../../util/buildClassName';
|
||||||
isChatAdmin,
|
import { processMessageInputForCustomEmoji } from '../../util/customEmojiManager';
|
||||||
isChatChannel,
|
|
||||||
isChatSuperGroup,
|
|
||||||
isUserId,
|
|
||||||
} from '../../global/helpers';
|
|
||||||
import { formatMediaDuration, formatVoiceRecordDuration } from '../../util/dateFormat';
|
import { formatMediaDuration, formatVoiceRecordDuration } from '../../util/dateFormat';
|
||||||
|
import deleteLastCharacterOutsideSelection from '../../util/deleteLastCharacterOutsideSelection';
|
||||||
import focusEditableElement from '../../util/focusEditableElement';
|
import focusEditableElement from '../../util/focusEditableElement';
|
||||||
|
import { MEMO_EMPTY_ARRAY } from '../../util/memo';
|
||||||
import parseMessageInput from '../../util/parseMessageInput';
|
import parseMessageInput from '../../util/parseMessageInput';
|
||||||
import { insertHtmlInSelection } from '../../util/selection';
|
import { insertHtmlInSelection } from '../../util/selection';
|
||||||
import deleteLastCharacterOutsideSelection from '../../util/deleteLastCharacterOutsideSelection';
|
|
||||||
import buildClassName from '../../util/buildClassName';
|
|
||||||
import windowSize from '../../util/windowSize';
|
|
||||||
import { getServerTime } from '../../util/serverTime';
|
import { getServerTime } from '../../util/serverTime';
|
||||||
import { selectCurrentLimit } from '../../global/selectors/limits';
|
import { IS_IOS, IS_VOICE_RECORDING_SUPPORTED } from '../../util/windowEnvironment';
|
||||||
import { processMessageInputForCustomEmoji } from '../../util/customEmojiManager';
|
import windowSize from '../../util/windowSize';
|
||||||
import { isSelectionInsideInput } from '../middle/composer/helpers/selection';
|
|
||||||
import { getTextWithEntitiesAsHtml } from './helpers/renderTextWithEntities';
|
|
||||||
import { buildCustomEmojiHtml } from '../middle/composer/helpers/customEmoji';
|
|
||||||
import buildAttachment, { prepareAttachmentsToSend } from '../middle/composer/helpers/buildAttachment';
|
|
||||||
import applyIosAutoCapitalizationFix from '../middle/composer/helpers/applyIosAutoCapitalizationFix';
|
import applyIosAutoCapitalizationFix from '../middle/composer/helpers/applyIosAutoCapitalizationFix';
|
||||||
import renderText from './helpers/renderText';
|
import buildAttachment, { prepareAttachmentsToSend } from '../middle/composer/helpers/buildAttachment';
|
||||||
|
import { buildCustomEmojiHtml } from '../middle/composer/helpers/customEmoji';
|
||||||
|
import { isSelectionInsideInput } from '../middle/composer/helpers/selection';
|
||||||
import { REM } from './helpers/mediaDimensions';
|
import { REM } from './helpers/mediaDimensions';
|
||||||
|
import renderText from './helpers/renderText';
|
||||||
|
import { getTextWithEntitiesAsHtml } from './helpers/renderTextWithEntities';
|
||||||
|
|
||||||
import useLastCallback from '../../hooks/useLastCallback';
|
|
||||||
import useSignal from '../../hooks/useSignal';
|
|
||||||
import useFlag from '../../hooks/useFlag';
|
|
||||||
import usePrevious from '../../hooks/usePrevious';
|
|
||||||
import useContextMenuHandlers from '../../hooks/useContextMenuHandlers';
|
import useContextMenuHandlers from '../../hooks/useContextMenuHandlers';
|
||||||
import useLang from '../../hooks/useLang';
|
|
||||||
import useSendMessageAction from '../../hooks/useSendMessageAction';
|
|
||||||
import useInterval from '../../hooks/useInterval';
|
|
||||||
import useSyncEffect from '../../hooks/useSyncEffect';
|
|
||||||
import useGetSelectionRange from '../../hooks/useGetSelectionRange';
|
|
||||||
import useDerivedState from '../../hooks/useDerivedState';
|
import useDerivedState from '../../hooks/useDerivedState';
|
||||||
import { useStateRef } from '../../hooks/useStateRef';
|
|
||||||
import useEffectWithPrevDeps from '../../hooks/useEffectWithPrevDeps';
|
import useEffectWithPrevDeps from '../../hooks/useEffectWithPrevDeps';
|
||||||
import useTimeout from '../../hooks/useTimeout';
|
import useFlag from '../../hooks/useFlag';
|
||||||
|
import useGetSelectionRange from '../../hooks/useGetSelectionRange';
|
||||||
|
import useInterval from '../../hooks/useInterval';
|
||||||
|
import useLang from '../../hooks/useLang';
|
||||||
|
import useLastCallback from '../../hooks/useLastCallback';
|
||||||
|
import usePrevious from '../../hooks/usePrevious';
|
||||||
import useSchedule from '../../hooks/useSchedule';
|
import useSchedule from '../../hooks/useSchedule';
|
||||||
|
import useSendMessageAction from '../../hooks/useSendMessageAction';
|
||||||
|
import useShowTransition from '../../hooks/useShowTransition';
|
||||||
|
import useSignal from '../../hooks/useSignal';
|
||||||
|
import { useStateRef } from '../../hooks/useStateRef';
|
||||||
|
import useSyncEffect from '../../hooks/useSyncEffect';
|
||||||
|
import useTimeout from '../../hooks/useTimeout';
|
||||||
import useAttachmentModal from '../middle/composer/hooks/useAttachmentModal';
|
import useAttachmentModal from '../middle/composer/hooks/useAttachmentModal';
|
||||||
import useVoiceRecording from '../middle/composer/hooks/useVoiceRecording';
|
|
||||||
import useEmojiTooltip from '../middle/composer/hooks/useEmojiTooltip';
|
|
||||||
import useCustomEmojiTooltip from '../middle/composer/hooks/useCustomEmojiTooltip';
|
|
||||||
import useStickerTooltip from '../middle/composer/hooks/useStickerTooltip';
|
|
||||||
import useMentionTooltip from '../middle/composer/hooks/useMentionTooltip';
|
|
||||||
import useInlineBotTooltip from '../middle/composer/hooks/useInlineBotTooltip';
|
|
||||||
import useBotCommandTooltip from '../middle/composer/hooks/useBotCommandTooltip';
|
import useBotCommandTooltip from '../middle/composer/hooks/useBotCommandTooltip';
|
||||||
|
import useClipboardPaste from '../middle/composer/hooks/useClipboardPaste';
|
||||||
|
import useCustomEmojiTooltip from '../middle/composer/hooks/useCustomEmojiTooltip';
|
||||||
import useDraft from '../middle/composer/hooks/useDraft';
|
import useDraft from '../middle/composer/hooks/useDraft';
|
||||||
import useEditing from '../middle/composer/hooks/useEditing';
|
import useEditing from '../middle/composer/hooks/useEditing';
|
||||||
import useClipboardPaste from '../middle/composer/hooks/useClipboardPaste';
|
import useEmojiTooltip from '../middle/composer/hooks/useEmojiTooltip';
|
||||||
import useShowTransition from '../../hooks/useShowTransition';
|
import useInlineBotTooltip from '../middle/composer/hooks/useInlineBotTooltip';
|
||||||
|
import useMentionTooltip from '../middle/composer/hooks/useMentionTooltip';
|
||||||
|
import useStickerTooltip from '../middle/composer/hooks/useStickerTooltip';
|
||||||
|
import useVoiceRecording from '../middle/composer/hooks/useVoiceRecording';
|
||||||
|
|
||||||
import DropArea, { DropAreaState } from '../middle/composer/DropArea.async';
|
|
||||||
import AttachmentModal from '../middle/composer/AttachmentModal.async';
|
import AttachmentModal from '../middle/composer/AttachmentModal.async';
|
||||||
import PollModal from '../middle/composer/PollModal.async';
|
|
||||||
import DeleteMessageModal from './DeleteMessageModal.async';
|
|
||||||
import SendAsMenu from '../middle/composer/SendAsMenu.async';
|
|
||||||
import MentionTooltip from '../middle/composer/MentionTooltip.async';
|
|
||||||
import BotCommandTooltip from '../middle/composer/BotCommandTooltip.async';
|
|
||||||
import InlineBotTooltip from '../middle/composer/InlineBotTooltip.async';
|
|
||||||
import ComposerEmbeddedMessage from '../middle/composer/ComposerEmbeddedMessage';
|
|
||||||
import WebPagePreview from '../middle/composer/WebPagePreview';
|
|
||||||
import BotMenuButton from '../middle/composer/BotMenuButton';
|
|
||||||
import ResponsiveHoverButton from '../ui/ResponsiveHoverButton';
|
|
||||||
import Button from '../ui/Button';
|
|
||||||
import Avatar from './Avatar';
|
|
||||||
import SymbolMenuButton from '../middle/composer/SymbolMenuButton';
|
|
||||||
import MessageInput from '../middle/composer/MessageInput';
|
|
||||||
import Spinner from '../ui/Spinner';
|
|
||||||
import AttachMenu from '../middle/composer/AttachMenu';
|
import AttachMenu from '../middle/composer/AttachMenu';
|
||||||
import BotKeyboardMenu from '../middle/composer/BotKeyboardMenu';
|
|
||||||
import BotCommandMenu from '../middle/composer/BotCommandMenu.async';
|
import BotCommandMenu from '../middle/composer/BotCommandMenu.async';
|
||||||
|
import BotCommandTooltip from '../middle/composer/BotCommandTooltip.async';
|
||||||
|
import BotKeyboardMenu from '../middle/composer/BotKeyboardMenu';
|
||||||
|
import BotMenuButton from '../middle/composer/BotMenuButton';
|
||||||
|
import ComposerEmbeddedMessage from '../middle/composer/ComposerEmbeddedMessage';
|
||||||
import CustomEmojiTooltip from '../middle/composer/CustomEmojiTooltip.async';
|
import CustomEmojiTooltip from '../middle/composer/CustomEmojiTooltip.async';
|
||||||
import StickerTooltip from '../middle/composer/StickerTooltip.async';
|
|
||||||
import EmojiTooltip from '../middle/composer/EmojiTooltip.async';
|
|
||||||
import CustomSendMenu from '../middle/composer/CustomSendMenu.async';
|
import CustomSendMenu from '../middle/composer/CustomSendMenu.async';
|
||||||
|
import DropArea, { DropAreaState } from '../middle/composer/DropArea.async';
|
||||||
|
import EmojiTooltip from '../middle/composer/EmojiTooltip.async';
|
||||||
|
import InlineBotTooltip from '../middle/composer/InlineBotTooltip.async';
|
||||||
|
import MentionTooltip from '../middle/composer/MentionTooltip.async';
|
||||||
|
import MessageInput from '../middle/composer/MessageInput';
|
||||||
|
import PollModal from '../middle/composer/PollModal.async';
|
||||||
|
import SendAsMenu from '../middle/composer/SendAsMenu.async';
|
||||||
|
import StickerTooltip from '../middle/composer/StickerTooltip.async';
|
||||||
|
import SymbolMenuButton from '../middle/composer/SymbolMenuButton';
|
||||||
|
import WebPagePreview from '../middle/composer/WebPagePreview';
|
||||||
import ReactionSelector from '../middle/message/ReactionSelector';
|
import ReactionSelector from '../middle/message/ReactionSelector';
|
||||||
|
import Button from '../ui/Button';
|
||||||
|
import ResponsiveHoverButton from '../ui/ResponsiveHoverButton';
|
||||||
|
import Spinner from '../ui/Spinner';
|
||||||
|
import Avatar from './Avatar';
|
||||||
|
import DeleteMessageModal from './DeleteMessageModal.async';
|
||||||
import ReactionStaticEmoji from './ReactionStaticEmoji';
|
import ReactionStaticEmoji from './ReactionStaticEmoji';
|
||||||
|
|
||||||
import './Composer.scss';
|
import './Composer.scss';
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user