mirror of
https://github.com/danog/telegram-tt.git
synced 2024-11-30 04:39:00 +01:00
Support opening chat by phone number; New reporting reasons; GramJs: Update to layer 139 (#1741)
This commit is contained in:
parent
a215aa1083
commit
40889f6d1f
@ -8,19 +8,20 @@ import { buildApiThumbnailFromCached, buildApiThumbnailFromPath } from './common
|
||||
import localDb from '../localDb';
|
||||
|
||||
const LOTTIE_STICKER_MIME_TYPE = 'application/x-tgsticker';
|
||||
const GIF_STICKER_MIME_TYPE = 'video/webm';
|
||||
const VIDEO_STICKER_MIME_TYPE = 'video/webm';
|
||||
|
||||
export function buildStickerFromDocument(document: GramJs.TypeDocument): ApiSticker | undefined {
|
||||
if (document instanceof GramJs.DocumentEmpty) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const { mimeType } = document;
|
||||
const stickerAttribute = document.attributes
|
||||
.find((attr: any): attr is GramJs.DocumentAttributeSticker => (
|
||||
attr instanceof GramJs.DocumentAttributeSticker
|
||||
));
|
||||
|
||||
const fileAttribute = (document.mimeType === LOTTIE_STICKER_MIME_TYPE || document.mimeType === GIF_STICKER_MIME_TYPE)
|
||||
const fileAttribute = (mimeType === LOTTIE_STICKER_MIME_TYPE || mimeType === VIDEO_STICKER_MIME_TYPE)
|
||||
&& document.attributes
|
||||
.find((attr: any): attr is GramJs.DocumentAttributeFilename => (
|
||||
attr instanceof GramJs.DocumentAttributeFilename
|
||||
@ -30,8 +31,8 @@ export function buildStickerFromDocument(document: GramJs.TypeDocument): ApiStic
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const isLottie = document.mimeType === LOTTIE_STICKER_MIME_TYPE;
|
||||
const isGif = document.mimeType === GIF_STICKER_MIME_TYPE;
|
||||
const isLottie = mimeType === LOTTIE_STICKER_MIME_TYPE;
|
||||
const isVideo = mimeType === VIDEO_STICKER_MIME_TYPE;
|
||||
|
||||
const imageSizeAttribute = document.attributes
|
||||
.find((attr: any): attr is GramJs.DocumentAttributeImageSize => (
|
||||
@ -55,7 +56,7 @@ export function buildStickerFromDocument(document: GramJs.TypeDocument): ApiStic
|
||||
);
|
||||
|
||||
// eslint-disable-next-line no-restricted-globals
|
||||
if (document.mimeType === GIF_STICKER_MIME_TYPE && !(self as any).isWebmSupported && !cachedThumb) {
|
||||
if (mimeType === VIDEO_STICKER_MIME_TYPE && !(self as any).isWebmSupported && !cachedThumb) {
|
||||
const staticThumb = document.thumbs && document.thumbs.find(
|
||||
(s): s is GramJs.PhotoSize => s instanceof GramJs.PhotoSize,
|
||||
);
|
||||
@ -83,7 +84,7 @@ export function buildStickerFromDocument(document: GramJs.TypeDocument): ApiStic
|
||||
stickerSetAccessHash: stickerSetInfo && String(stickerSetInfo.accessHash),
|
||||
emoji,
|
||||
isLottie,
|
||||
isGif,
|
||||
isVideo,
|
||||
width,
|
||||
height,
|
||||
thumbnail,
|
||||
@ -95,7 +96,7 @@ export function buildStickerSet(set: GramJs.StickerSet): ApiStickerSet {
|
||||
archived,
|
||||
animated,
|
||||
installedDate,
|
||||
gifs,
|
||||
videos,
|
||||
id,
|
||||
accessHash,
|
||||
title,
|
||||
@ -107,7 +108,7 @@ export function buildStickerSet(set: GramJs.StickerSet): ApiStickerSet {
|
||||
return {
|
||||
archived,
|
||||
isLottie: animated,
|
||||
isGifs: gifs,
|
||||
isVideos: videos,
|
||||
installedDate,
|
||||
id: String(id),
|
||||
accessHash: String(accessHash),
|
||||
|
@ -420,6 +420,10 @@ export function buildInputReportReason(reason: ApiReportReason) {
|
||||
return new GramJs.InputReportReasonFake();
|
||||
case 'geoIrrelevant':
|
||||
return new GramJs.InputReportReasonGeoIrrelevant();
|
||||
case 'illegalDrugs':
|
||||
return new GramJs.InputReportReasonIllegalDrugs();
|
||||
case 'personalDetails':
|
||||
return new GramJs.InputReportReasonPersonalDetails();
|
||||
case 'other':
|
||||
return new GramJs.InputReportReasonOther();
|
||||
}
|
||||
|
@ -796,11 +796,23 @@ export async function toggleDialogUnread({
|
||||
}
|
||||
}
|
||||
|
||||
export async function getChatByPhoneNumber(phoneNumber: string) {
|
||||
const result = await invokeRequest(new GramJs.contacts.ResolvePhone({
|
||||
phone: phoneNumber,
|
||||
}));
|
||||
|
||||
return processResolvedPeer(result);
|
||||
}
|
||||
|
||||
export async function getChatByUsername(username: string) {
|
||||
const result = await invokeRequest(new GramJs.contacts.ResolveUsername({
|
||||
username,
|
||||
}));
|
||||
|
||||
return processResolvedPeer(result);
|
||||
}
|
||||
|
||||
function processResolvedPeer(result?: GramJs.contacts.TypeResolvedPeer) {
|
||||
if (!result) {
|
||||
return undefined;
|
||||
}
|
||||
|
@ -15,6 +15,7 @@ export {
|
||||
getChatByUsername, togglePreHistoryHidden, updateChatDefaultBannedRights, updateChatMemberBannedRights,
|
||||
updateChatTitle, updateChatAbout, toggleSignatures, updateChatAdmin, fetchGroupsForDiscussion, setDiscussionGroup,
|
||||
migrateChat, openChatByInvite, fetchMembers, importChatInvite, addChatMembers, deleteChatMember, toggleIsProtected,
|
||||
getChatByPhoneNumber,
|
||||
} from './chats';
|
||||
|
||||
export {
|
||||
|
@ -26,7 +26,7 @@ export interface ApiSticker {
|
||||
stickerSetAccessHash?: string;
|
||||
emoji?: string;
|
||||
isLottie: boolean;
|
||||
isGif: boolean;
|
||||
isVideo: boolean;
|
||||
width?: number;
|
||||
height?: number;
|
||||
thumbnail?: ApiThumbnail;
|
||||
@ -36,7 +36,7 @@ export interface ApiSticker {
|
||||
export interface ApiStickerSet {
|
||||
archived?: true;
|
||||
isLottie?: true;
|
||||
isGifs?: true;
|
||||
isVideos?: true;
|
||||
installedDate?: number;
|
||||
id: string;
|
||||
accessHash: string;
|
||||
@ -382,7 +382,7 @@ export type ApiMessageSearchType = 'text' | 'media' | 'documents' | 'links' | 'a
|
||||
export type ApiGlobalMessageSearchType = 'text' | 'media' | 'documents' | 'links' | 'audio' | 'voice';
|
||||
|
||||
export type ApiReportReason = 'spam' | 'violence' | 'pornography' | 'childAbuse'
|
||||
| 'copyright' | 'geoIrrelevant' | 'fake' | 'other';
|
||||
| 'copyright' | 'geoIrrelevant' | 'fake' | 'illegalDrugs' | 'personalDetails' | 'other';
|
||||
|
||||
export type ApiSendMessageAction = {
|
||||
type: 'cancel' | 'typing' | 'recordAudio' | 'chooseSticker';
|
||||
|
@ -55,6 +55,8 @@ const ReportMessageModal: FC<OwnProps> = ({
|
||||
{ value: 'pornography', label: lang('lng_report_reason_pornography') },
|
||||
{ value: 'childAbuse', label: lang('lng_report_reason_child_abuse') },
|
||||
{ value: 'copyright', label: lang('ReportPeer.ReasonCopyright') },
|
||||
{ value: 'illegalDrugs', label: 'Illegal Drugs' },
|
||||
{ value: 'personalDetails', label: 'Personal Details' },
|
||||
{ value: 'other', label: lang('lng_report_reason_other') },
|
||||
];
|
||||
|
||||
|
@ -49,9 +49,9 @@ const StickerButton: FC<OwnProps> = ({
|
||||
const lottieData = useMedia(sticker.isLottie && localMediaHash, !shouldPlay, ApiMediaFormat.Lottie);
|
||||
const [isLottieLoaded, markLoaded, unmarkLoaded] = useFlag(Boolean(lottieData));
|
||||
const canLottiePlay = isLottieLoaded && shouldPlay;
|
||||
const isGif = sticker.isGif && IS_WEBM_SUPPORTED;
|
||||
const gifBlobUrl = useMedia(isGif && localMediaHash, !shouldPlay, ApiMediaFormat.BlobUrl);
|
||||
const canGifPlay = Boolean(isGif && gifBlobUrl && shouldPlay);
|
||||
const isVideo = sticker.isVideo && IS_WEBM_SUPPORTED;
|
||||
const videoBlobUrl = useMedia(isVideo && localMediaHash, !shouldPlay, ApiMediaFormat.BlobUrl);
|
||||
const canVideoPlay = Boolean(isVideo && videoBlobUrl && shouldPlay);
|
||||
|
||||
const { transitionClassNames: previewTransitionClassNames } = useShowTransition(
|
||||
Boolean(previewBlobUrl || canLottiePlay),
|
||||
@ -68,15 +68,15 @@ const StickerButton: FC<OwnProps> = ({
|
||||
}, [unmarkLoaded, shouldPlay]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!isGif || !ref.current) return;
|
||||
if (!isVideo || !ref.current) return;
|
||||
const video = ref.current.querySelector('video');
|
||||
if (!video) return;
|
||||
if (canGifPlay) {
|
||||
if (canVideoPlay) {
|
||||
safePlay(video);
|
||||
} else {
|
||||
video.pause();
|
||||
}
|
||||
}, [isGif, canGifPlay]);
|
||||
}, [isVideo, canVideoPlay]);
|
||||
|
||||
function handleClick() {
|
||||
if (onClick) {
|
||||
@ -98,7 +98,7 @@ const StickerButton: FC<OwnProps> = ({
|
||||
className,
|
||||
);
|
||||
|
||||
const style = (thumbDataUri && !canLottiePlay && !canGifPlay) ? `background-image: url('${thumbDataUri}');` : '';
|
||||
const style = (thumbDataUri && !canLottiePlay && !canVideoPlay) ? `background-image: url('${thumbDataUri}');` : '';
|
||||
|
||||
return (
|
||||
<div
|
||||
@ -110,15 +110,15 @@ const StickerButton: FC<OwnProps> = ({
|
||||
onMouseDown={preventMessageInputBlurWithBubbling}
|
||||
onClick={handleClick}
|
||||
>
|
||||
{!canLottiePlay && !canGifPlay && (
|
||||
{!canLottiePlay && !canVideoPlay && (
|
||||
// eslint-disable-next-line jsx-a11y/alt-text
|
||||
<img src={previewBlobUrl} className={previewTransitionClassNames} />
|
||||
)}
|
||||
{isGif && (
|
||||
{isVideo && (
|
||||
<video
|
||||
className={previewTransitionClassNames}
|
||||
src={gifBlobUrl}
|
||||
autoPlay={canGifPlay}
|
||||
src={videoBlobUrl}
|
||||
autoPlay={canVideoPlay}
|
||||
loop
|
||||
playsInline
|
||||
muted
|
||||
|
@ -23,16 +23,16 @@ const StickerSetCover: FC<OwnProps> = ({ stickerSet, observeIntersection }) => {
|
||||
|
||||
const mediaData = useMedia(stickerSet.hasThumbnail && `stickerSet${stickerSet.id}`, !isIntersecting);
|
||||
const transitionClassNames = useMediaTransition(mediaData);
|
||||
const isGif = stickerSet.isGifs;
|
||||
const isVideo = stickerSet.isVideos;
|
||||
|
||||
const firstLetters = useMemo(() => {
|
||||
if ((isGif && !IS_WEBM_SUPPORTED) || !mediaData) return getFirstLetters(stickerSet.title, 2);
|
||||
}, [isGif, mediaData, stickerSet.title]);
|
||||
if ((isVideo && !IS_WEBM_SUPPORTED) || !mediaData) return getFirstLetters(stickerSet.title, 2);
|
||||
}, [isVideo, mediaData, stickerSet.title]);
|
||||
|
||||
return (
|
||||
<div ref={ref} className="sticker-set-cover">
|
||||
{firstLetters}
|
||||
{isGif ? (
|
||||
{isVideo ? (
|
||||
<video src={mediaData} className={transitionClassNames} loop autoPlay />
|
||||
) : (
|
||||
<img src={mediaData} className={transitionClassNames} alt="" />
|
||||
|
@ -36,15 +36,15 @@ const Sticker: FC<OwnProps> = ({
|
||||
const [isModalOpen, openModal, closeModal] = useFlag();
|
||||
|
||||
const sticker = message.content.sticker!;
|
||||
const { isLottie, stickerSetId, isGif } = sticker;
|
||||
const canDisplayGif = IS_WEBM_SUPPORTED;
|
||||
const { isLottie, stickerSetId, isVideo } = sticker;
|
||||
const canDisplayVideo = IS_WEBM_SUPPORTED;
|
||||
const isMemojiSticker = stickerSetId === NO_STICKER_SET_ID;
|
||||
|
||||
const shouldLoad = useIsIntersecting(ref, observeIntersection);
|
||||
const shouldPlay = useIsIntersecting(ref, observeIntersectionForPlaying);
|
||||
|
||||
const mediaHash = sticker.isPreloadedGlobally ? `sticker${sticker.id}` : getMessageMediaHash(message, 'inline')!;
|
||||
const previewMediaHash = isGif && !canDisplayGif && (
|
||||
const previewMediaHash = isVideo && !canDisplayVideo && (
|
||||
sticker.isPreloadedGlobally ? `sticker${sticker.id}?size=m` : getMessageMediaHash(message, 'pictogram'));
|
||||
const previewBlobUrl = useMedia(previewMediaHash);
|
||||
const thumbDataUri = useWebpThumbnail(message);
|
||||
@ -71,7 +71,7 @@ const Sticker: FC<OwnProps> = ({
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
if (!isGif || !ref.current) return;
|
||||
if (!isVideo || !ref.current) return;
|
||||
const video = ref.current.querySelector('video');
|
||||
if (!video) return;
|
||||
if (shouldPlay) {
|
||||
@ -79,11 +79,11 @@ const Sticker: FC<OwnProps> = ({
|
||||
} else {
|
||||
video.pause();
|
||||
}
|
||||
}, [isGif, shouldPlay]);
|
||||
}, [isVideo, shouldPlay]);
|
||||
|
||||
return (
|
||||
<div ref={ref} className={stickerClassName} onClick={!isMemojiSticker ? openModal : undefined}>
|
||||
{(!isMediaReady || (isGif && !canDisplayGif)) && (
|
||||
{(!isMediaReady || (isVideo && !canDisplayVideo)) && (
|
||||
<img
|
||||
id={`sticker-thumb-${message.id}`}
|
||||
src={previewUrl}
|
||||
@ -93,7 +93,7 @@ const Sticker: FC<OwnProps> = ({
|
||||
className={thumbClassName}
|
||||
/>
|
||||
)}
|
||||
{!isLottie && !isGif && (
|
||||
{!isLottie && !isVideo && (
|
||||
<img
|
||||
id={`sticker-${message.id}`}
|
||||
src={mediaData as string}
|
||||
@ -103,7 +103,7 @@ const Sticker: FC<OwnProps> = ({
|
||||
className={buildClassName('full-media', transitionClassNames)}
|
||||
/>
|
||||
)}
|
||||
{isGif && canDisplayGif && isMediaReady && (
|
||||
{isVideo && canDisplayVideo && isMediaReady && (
|
||||
<video
|
||||
id={`sticker-${message.id}`}
|
||||
src={mediaData as string}
|
||||
|
@ -33,7 +33,7 @@ export const MEDIA_PROGRESSIVE_CACHE_DISABLED = false;
|
||||
export const MEDIA_PROGRESSIVE_CACHE_NAME = 'tt-media-progressive';
|
||||
export const MEDIA_CACHE_MAX_BYTES = 512 * 1024; // 512 KB
|
||||
export const CUSTOM_BG_CACHE_NAME = 'tt-custom-bg';
|
||||
export const LANG_CACHE_NAME = 'tt-lang-packs-v7';
|
||||
export const LANG_CACHE_NAME = 'tt-lang-packs-v8';
|
||||
export const ASSET_CACHE_NAME = 'tt-assets';
|
||||
export const AUTODOWNLOAD_FILESIZE_MB_LIMITS = [1, 5, 10, 50, 100, 500];
|
||||
|
||||
|
@ -515,7 +515,7 @@ export type ActionTypes = (
|
||||
'setAuthRememberMe' | 'clearAuthError' | 'uploadProfilePhoto' | 'goToAuthQrCode' | 'clearCache' |
|
||||
// chats
|
||||
'preloadTopChatMessages' | 'loadAllChats' | 'openChat' | 'openChatWithInfo' | 'openLinkedChat' |
|
||||
'openSupportChat' | 'openTipsChat' | 'focusMessageInComments' |
|
||||
'openSupportChat' | 'openTipsChat' | 'focusMessageInComments' | 'openChatByPhoneNumber' |
|
||||
'loadFullChat' | 'loadTopChats' | 'requestChatUpdate' | 'updateChatMutedState' |
|
||||
'joinChannel' | 'leaveChannel' | 'deleteChannel' | 'toggleChatPinned' | 'toggleChatArchived' | 'toggleChatUnread' |
|
||||
'loadChatFolders' | 'loadRecommendedChatFolders' | 'editChatFolder' | 'addChatFolder' | 'deleteChatFolder' |
|
||||
|
@ -1,6 +1,6 @@
|
||||
const api = require('./api');
|
||||
|
||||
const LAYER = 138;
|
||||
const LAYER = 139;
|
||||
const tlobjects = {};
|
||||
|
||||
for (const tl of Object.values(api)) {
|
||||
|
72
src/lib/gramjs/tl/api.d.ts
vendored
72
src/lib/gramjs/tl/api.d.ts
vendored
@ -80,7 +80,7 @@ namespace Api {
|
||||
export type TypePeerNotifySettings = PeerNotifySettings;
|
||||
export type TypePeerSettings = PeerSettings;
|
||||
export type TypeWallPaper = WallPaper | WallPaperNoFile;
|
||||
export type TypeReportReason = InputReportReasonSpam | InputReportReasonViolence | InputReportReasonPornography | InputReportReasonChildAbuse | InputReportReasonOther | InputReportReasonCopyright | InputReportReasonGeoIrrelevant | InputReportReasonFake;
|
||||
export type TypeReportReason = InputReportReasonSpam | InputReportReasonViolence | InputReportReasonPornography | InputReportReasonChildAbuse | InputReportReasonOther | InputReportReasonCopyright | InputReportReasonGeoIrrelevant | InputReportReasonFake | InputReportReasonIllegalDrugs | InputReportReasonPersonalDetails;
|
||||
export type TypeUserFull = UserFull;
|
||||
export type TypeContact = Contact;
|
||||
export type TypeImportedContact = ImportedContact;
|
||||
@ -269,6 +269,7 @@ namespace Api {
|
||||
export type TypeMessageReactions = MessageReactions;
|
||||
export type TypeAvailableReaction = AvailableReaction;
|
||||
export type TypeMessagePeerReaction = MessagePeerReaction;
|
||||
export type TypeGroupCallStreamChannel = GroupCallStreamChannel;
|
||||
export type TypeResPQ = ResPQ;
|
||||
export type TypeP_Q_inner_data = PQInnerData | PQInnerDataDc | PQInnerDataTemp | PQInnerDataTempDc;
|
||||
export type TypeServer_DH_Params = ServerDHParamsFail | ServerDHParamsOk;
|
||||
@ -442,6 +443,8 @@ namespace Api {
|
||||
export type TypeGroupParticipants = phone.GroupParticipants;
|
||||
export type TypeJoinAsPeers = phone.JoinAsPeers;
|
||||
export type TypeExportedGroupCallInvite = phone.ExportedGroupCallInvite;
|
||||
export type TypeGroupCallStreamChannels = phone.GroupCallStreamChannels;
|
||||
export type TypeGroupCallStreamRtmpUrl = phone.GroupCallStreamRtmpUrl;
|
||||
}
|
||||
|
||||
export namespace stats {
|
||||
@ -1896,6 +1899,8 @@ namespace Api {
|
||||
export class InputReportReasonCopyright extends VirtualClass<void> {};
|
||||
export class InputReportReasonGeoIrrelevant extends VirtualClass<void> {};
|
||||
export class InputReportReasonFake extends VirtualClass<void> {};
|
||||
export class InputReportReasonIllegalDrugs extends VirtualClass<void> {};
|
||||
export class InputReportReasonPersonalDetails extends VirtualClass<void> {};
|
||||
export class UserFull extends VirtualClass<{
|
||||
// flags: undefined;
|
||||
blocked?: true;
|
||||
@ -3652,7 +3657,7 @@ namespace Api {
|
||||
official?: true;
|
||||
masks?: true;
|
||||
animated?: true;
|
||||
gifs?: true;
|
||||
videos?: true;
|
||||
installedDate?: int;
|
||||
id: long;
|
||||
accessHash: long;
|
||||
@ -3669,7 +3674,7 @@ namespace Api {
|
||||
official?: true;
|
||||
masks?: true;
|
||||
animated?: true;
|
||||
gifs?: true;
|
||||
videos?: true;
|
||||
installedDate?: int;
|
||||
id: long;
|
||||
accessHash: long;
|
||||
@ -6801,6 +6806,8 @@ namespace Api {
|
||||
scheduleStartSubscribed?: true;
|
||||
canStartVideo?: true;
|
||||
recordVideoActive?: true;
|
||||
rtmpStream?: true;
|
||||
listenersHidden?: true;
|
||||
id: long;
|
||||
accessHash: long;
|
||||
participantsCount: int;
|
||||
@ -6819,6 +6826,8 @@ namespace Api {
|
||||
scheduleStartSubscribed?: true;
|
||||
canStartVideo?: true;
|
||||
recordVideoActive?: true;
|
||||
rtmpStream?: true;
|
||||
listenersHidden?: true;
|
||||
id: long;
|
||||
accessHash: long;
|
||||
participantsCount: int;
|
||||
@ -7053,6 +7062,15 @@ namespace Api {
|
||||
peerId: Api.TypePeer;
|
||||
reaction: string;
|
||||
};
|
||||
export class GroupCallStreamChannel extends VirtualClass<{
|
||||
channel: int;
|
||||
scale: int;
|
||||
lastTimestampMs: long;
|
||||
}> {
|
||||
channel: int;
|
||||
scale: int;
|
||||
lastTimestampMs: long;
|
||||
};
|
||||
export class ResPQ extends VirtualClass<{
|
||||
nonce: int128;
|
||||
serverNonce: int128;
|
||||
@ -8819,6 +8837,18 @@ namespace Api {
|
||||
}> {
|
||||
link: string;
|
||||
};
|
||||
export class GroupCallStreamChannels extends VirtualClass<{
|
||||
channels: Api.TypeGroupCallStreamChannel[];
|
||||
}> {
|
||||
channels: Api.TypeGroupCallStreamChannel[];
|
||||
};
|
||||
export class GroupCallStreamRtmpUrl extends VirtualClass<{
|
||||
url: string;
|
||||
key: string;
|
||||
}> {
|
||||
url: string;
|
||||
key: string;
|
||||
};
|
||||
}
|
||||
|
||||
export namespace stats {
|
||||
@ -9806,6 +9836,11 @@ namespace Api {
|
||||
reportSpam?: true;
|
||||
msgId: int;
|
||||
};
|
||||
export class ResolvePhone extends Request<Partial<{
|
||||
phone: string;
|
||||
}>, contacts.TypeResolvedPeer> {
|
||||
phone: string;
|
||||
};
|
||||
}
|
||||
|
||||
export namespace messages {
|
||||
@ -11321,6 +11356,15 @@ namespace Api {
|
||||
}>, messages.TypeAffectedHistory> {
|
||||
peer: Api.TypeInputPeer;
|
||||
};
|
||||
export class SearchSentMedia extends Request<Partial<{
|
||||
q: string;
|
||||
filter: Api.TypeMessagesFilter;
|
||||
limit: int;
|
||||
}>, messages.TypeMessages> {
|
||||
q: string;
|
||||
filter: Api.TypeMessagesFilter;
|
||||
limit: int;
|
||||
};
|
||||
}
|
||||
|
||||
export namespace updates {
|
||||
@ -11963,6 +12007,7 @@ namespace Api {
|
||||
// flags: undefined;
|
||||
masks?: true;
|
||||
animated?: true;
|
||||
videos?: true;
|
||||
userId: Api.TypeInputUser;
|
||||
title: string;
|
||||
shortName: string;
|
||||
@ -11973,6 +12018,7 @@ namespace Api {
|
||||
// flags: undefined;
|
||||
masks?: true;
|
||||
animated?: true;
|
||||
videos?: true;
|
||||
userId: Api.TypeInputUser;
|
||||
title: string;
|
||||
shortName: string;
|
||||
@ -12104,12 +12150,14 @@ namespace Api {
|
||||
};
|
||||
export class CreateGroupCall extends Request<Partial<{
|
||||
// flags: undefined;
|
||||
rtmpStream?: true;
|
||||
peer: Api.TypeInputPeer;
|
||||
randomId: int;
|
||||
title?: string;
|
||||
scheduleDate?: int;
|
||||
}>, Api.TypeUpdates> {
|
||||
// flags: undefined;
|
||||
rtmpStream?: true;
|
||||
peer: Api.TypeInputPeer;
|
||||
randomId: int;
|
||||
title?: string;
|
||||
@ -12277,6 +12325,18 @@ namespace Api {
|
||||
}>, Api.TypeUpdates> {
|
||||
call: Api.TypeInputGroupCall;
|
||||
};
|
||||
export class GetGroupCallStreamChannels extends Request<Partial<{
|
||||
call: Api.TypeInputGroupCall;
|
||||
}>, phone.TypeGroupCallStreamChannels> {
|
||||
call: Api.TypeInputGroupCall;
|
||||
};
|
||||
export class GetGroupCallStreamRtmpUrl extends Request<Partial<{
|
||||
peer: Api.TypeInputPeer;
|
||||
revoke: Bool;
|
||||
}>, phone.TypeGroupCallStreamRtmpUrl> {
|
||||
peer: Api.TypeInputPeer;
|
||||
revoke: Bool;
|
||||
};
|
||||
}
|
||||
|
||||
export namespace langpack {
|
||||
@ -12392,8 +12452,8 @@ namespace Api {
|
||||
| auth.SendCode | auth.SignUp | auth.SignIn | auth.LogOut | auth.ResetAuthorizations | auth.ExportAuthorization | auth.ImportAuthorization | auth.BindTempAuthKey | auth.ImportBotAuthorization | auth.CheckPassword | auth.RequestPasswordRecovery | auth.RecoverPassword | auth.ResendCode | auth.CancelCode | auth.DropTempAuthKeys | auth.ExportLoginToken | auth.ImportLoginToken | auth.AcceptLoginToken | auth.CheckRecoveryPassword
|
||||
| account.RegisterDevice | account.UnregisterDevice | account.UpdateNotifySettings | account.GetNotifySettings | account.ResetNotifySettings | account.UpdateProfile | account.UpdateStatus | account.GetWallPapers | account.ReportPeer | account.CheckUsername | account.UpdateUsername | account.GetPrivacy | account.SetPrivacy | account.DeleteAccount | account.GetAccountTTL | account.SetAccountTTL | account.SendChangePhoneCode | account.ChangePhone | account.UpdateDeviceLocked | account.GetAuthorizations | account.ResetAuthorization | account.GetPassword | account.GetPasswordSettings | account.UpdatePasswordSettings | account.SendConfirmPhoneCode | account.ConfirmPhone | account.GetTmpPassword | account.GetWebAuthorizations | account.ResetWebAuthorization | account.ResetWebAuthorizations | account.GetAllSecureValues | account.GetSecureValue | account.SaveSecureValue | account.DeleteSecureValue | account.GetAuthorizationForm | account.AcceptAuthorization | account.SendVerifyPhoneCode | account.VerifyPhone | account.SendVerifyEmailCode | account.VerifyEmail | account.InitTakeoutSession | account.FinishTakeoutSession | account.ConfirmPasswordEmail | account.ResendPasswordEmail | account.CancelPasswordEmail | account.GetContactSignUpNotification | account.SetContactSignUpNotification | account.GetNotifyExceptions | account.GetWallPaper | account.UploadWallPaper | account.SaveWallPaper | account.InstallWallPaper | account.ResetWallPapers | account.GetAutoDownloadSettings | account.SaveAutoDownloadSettings | account.UploadTheme | account.CreateTheme | account.UpdateTheme | account.SaveTheme | account.InstallTheme | account.GetTheme | account.GetThemes | account.SetContentSettings | account.GetContentSettings | account.GetMultiWallPapers | account.GetGlobalPrivacySettings | account.SetGlobalPrivacySettings | account.ReportProfilePhoto | account.ResetPassword | account.DeclinePasswordReset | account.GetChatThemes | account.SetAuthorizationTTL | account.ChangeAuthorizationSettings
|
||||
| users.GetUsers | users.GetFullUser | users.SetSecureValueErrors
|
||||
| contacts.GetContactIDs | contacts.GetStatuses | contacts.GetContacts | contacts.ImportContacts | contacts.DeleteContacts | contacts.DeleteByPhones | contacts.Block | contacts.Unblock | contacts.GetBlocked | contacts.Search | contacts.ResolveUsername | contacts.GetTopPeers | contacts.ResetTopPeerRating | contacts.ResetSaved | contacts.GetSaved | contacts.ToggleTopPeers | contacts.AddContact | contacts.AcceptContact | contacts.GetLocated | contacts.BlockFromReplies
|
||||
| messages.GetMessages | messages.GetDialogs | messages.GetHistory | messages.Search | messages.ReadHistory | messages.DeleteHistory | messages.DeleteMessages | messages.ReceivedMessages | messages.SetTyping | messages.SendMessage | messages.SendMedia | messages.ForwardMessages | messages.ReportSpam | messages.GetPeerSettings | messages.Report | messages.GetChats | messages.GetFullChat | messages.EditChatTitle | messages.EditChatPhoto | messages.AddChatUser | messages.DeleteChatUser | messages.CreateChat | messages.GetDhConfig | messages.RequestEncryption | messages.AcceptEncryption | messages.DiscardEncryption | messages.SetEncryptedTyping | messages.ReadEncryptedHistory | messages.SendEncrypted | messages.SendEncryptedFile | messages.SendEncryptedService | messages.ReceivedQueue | messages.ReportEncryptedSpam | messages.ReadMessageContents | messages.GetStickers | messages.GetAllStickers | messages.GetWebPagePreview | messages.ExportChatInvite | messages.CheckChatInvite | messages.ImportChatInvite | messages.GetStickerSet | messages.InstallStickerSet | messages.UninstallStickerSet | messages.StartBot | messages.GetMessagesViews | messages.EditChatAdmin | messages.MigrateChat | messages.SearchGlobal | messages.ReorderStickerSets | messages.GetDocumentByHash | messages.GetSavedGifs | messages.SaveGif | messages.GetInlineBotResults | messages.SetInlineBotResults | messages.SendInlineBotResult | messages.GetMessageEditData | messages.EditMessage | messages.EditInlineBotMessage | messages.GetBotCallbackAnswer | messages.SetBotCallbackAnswer | messages.GetPeerDialogs | messages.SaveDraft | messages.GetAllDrafts | messages.GetFeaturedStickers | messages.ReadFeaturedStickers | messages.GetRecentStickers | messages.SaveRecentSticker | messages.ClearRecentStickers | messages.GetArchivedStickers | messages.GetMaskStickers | messages.GetAttachedStickers | messages.SetGameScore | messages.SetInlineGameScore | messages.GetGameHighScores | messages.GetInlineGameHighScores | messages.GetCommonChats | messages.GetAllChats | messages.GetWebPage | messages.ToggleDialogPin | messages.ReorderPinnedDialogs | messages.GetPinnedDialogs | messages.SetBotShippingResults | messages.SetBotPrecheckoutResults | messages.UploadMedia | messages.SendScreenshotNotification | messages.GetFavedStickers | messages.FaveSticker | messages.GetUnreadMentions | messages.ReadMentions | messages.GetRecentLocations | messages.SendMultiMedia | messages.UploadEncryptedFile | messages.SearchStickerSets | messages.GetSplitRanges | messages.MarkDialogUnread | messages.GetDialogUnreadMarks | messages.ClearAllDrafts | messages.UpdatePinnedMessage | messages.SendVote | messages.GetPollResults | messages.GetOnlines | messages.EditChatAbout | messages.EditChatDefaultBannedRights | messages.GetEmojiKeywords | messages.GetEmojiKeywordsDifference | messages.GetEmojiKeywordsLanguages | messages.GetEmojiURL | messages.GetSearchCounters | messages.RequestUrlAuth | messages.AcceptUrlAuth | messages.HidePeerSettingsBar | messages.GetScheduledHistory | messages.GetScheduledMessages | messages.SendScheduledMessages | messages.DeleteScheduledMessages | messages.GetPollVotes | messages.ToggleStickerSets | messages.GetDialogFilters | messages.GetSuggestedDialogFilters | messages.UpdateDialogFilter | messages.UpdateDialogFiltersOrder | messages.GetOldFeaturedStickers | messages.GetReplies | messages.GetDiscussionMessage | messages.ReadDiscussion | messages.UnpinAllMessages | messages.DeleteChat | messages.DeletePhoneCallHistory | messages.CheckHistoryImport | messages.InitHistoryImport | messages.UploadImportedMedia | messages.StartHistoryImport | messages.GetExportedChatInvites | messages.GetExportedChatInvite | messages.EditExportedChatInvite | messages.DeleteRevokedExportedChatInvites | messages.DeleteExportedChatInvite | messages.GetAdminsWithInvites | messages.GetChatInviteImporters | messages.SetHistoryTTL | messages.CheckHistoryImportPeer | messages.SetChatTheme | messages.GetMessageReadParticipants | messages.GetSearchResultsCalendar | messages.GetSearchResultsPositions | messages.HideChatJoinRequest | messages.HideAllChatJoinRequests | messages.ToggleNoForwards | messages.SaveDefaultSendAs | messages.SendReaction | messages.GetMessagesReactions | messages.GetMessageReactionsList | messages.SetChatAvailableReactions | messages.GetAvailableReactions | messages.SetDefaultReaction | messages.TranslateText | messages.GetUnreadReactions | messages.ReadReactions
|
||||
| contacts.GetContactIDs | contacts.GetStatuses | contacts.GetContacts | contacts.ImportContacts | contacts.DeleteContacts | contacts.DeleteByPhones | contacts.Block | contacts.Unblock | contacts.GetBlocked | contacts.Search | contacts.ResolveUsername | contacts.GetTopPeers | contacts.ResetTopPeerRating | contacts.ResetSaved | contacts.GetSaved | contacts.ToggleTopPeers | contacts.AddContact | contacts.AcceptContact | contacts.GetLocated | contacts.BlockFromReplies | contacts.ResolvePhone
|
||||
| messages.GetMessages | messages.GetDialogs | messages.GetHistory | messages.Search | messages.ReadHistory | messages.DeleteHistory | messages.DeleteMessages | messages.ReceivedMessages | messages.SetTyping | messages.SendMessage | messages.SendMedia | messages.ForwardMessages | messages.ReportSpam | messages.GetPeerSettings | messages.Report | messages.GetChats | messages.GetFullChat | messages.EditChatTitle | messages.EditChatPhoto | messages.AddChatUser | messages.DeleteChatUser | messages.CreateChat | messages.GetDhConfig | messages.RequestEncryption | messages.AcceptEncryption | messages.DiscardEncryption | messages.SetEncryptedTyping | messages.ReadEncryptedHistory | messages.SendEncrypted | messages.SendEncryptedFile | messages.SendEncryptedService | messages.ReceivedQueue | messages.ReportEncryptedSpam | messages.ReadMessageContents | messages.GetStickers | messages.GetAllStickers | messages.GetWebPagePreview | messages.ExportChatInvite | messages.CheckChatInvite | messages.ImportChatInvite | messages.GetStickerSet | messages.InstallStickerSet | messages.UninstallStickerSet | messages.StartBot | messages.GetMessagesViews | messages.EditChatAdmin | messages.MigrateChat | messages.SearchGlobal | messages.ReorderStickerSets | messages.GetDocumentByHash | messages.GetSavedGifs | messages.SaveGif | messages.GetInlineBotResults | messages.SetInlineBotResults | messages.SendInlineBotResult | messages.GetMessageEditData | messages.EditMessage | messages.EditInlineBotMessage | messages.GetBotCallbackAnswer | messages.SetBotCallbackAnswer | messages.GetPeerDialogs | messages.SaveDraft | messages.GetAllDrafts | messages.GetFeaturedStickers | messages.ReadFeaturedStickers | messages.GetRecentStickers | messages.SaveRecentSticker | messages.ClearRecentStickers | messages.GetArchivedStickers | messages.GetMaskStickers | messages.GetAttachedStickers | messages.SetGameScore | messages.SetInlineGameScore | messages.GetGameHighScores | messages.GetInlineGameHighScores | messages.GetCommonChats | messages.GetAllChats | messages.GetWebPage | messages.ToggleDialogPin | messages.ReorderPinnedDialogs | messages.GetPinnedDialogs | messages.SetBotShippingResults | messages.SetBotPrecheckoutResults | messages.UploadMedia | messages.SendScreenshotNotification | messages.GetFavedStickers | messages.FaveSticker | messages.GetUnreadMentions | messages.ReadMentions | messages.GetRecentLocations | messages.SendMultiMedia | messages.UploadEncryptedFile | messages.SearchStickerSets | messages.GetSplitRanges | messages.MarkDialogUnread | messages.GetDialogUnreadMarks | messages.ClearAllDrafts | messages.UpdatePinnedMessage | messages.SendVote | messages.GetPollResults | messages.GetOnlines | messages.EditChatAbout | messages.EditChatDefaultBannedRights | messages.GetEmojiKeywords | messages.GetEmojiKeywordsDifference | messages.GetEmojiKeywordsLanguages | messages.GetEmojiURL | messages.GetSearchCounters | messages.RequestUrlAuth | messages.AcceptUrlAuth | messages.HidePeerSettingsBar | messages.GetScheduledHistory | messages.GetScheduledMessages | messages.SendScheduledMessages | messages.DeleteScheduledMessages | messages.GetPollVotes | messages.ToggleStickerSets | messages.GetDialogFilters | messages.GetSuggestedDialogFilters | messages.UpdateDialogFilter | messages.UpdateDialogFiltersOrder | messages.GetOldFeaturedStickers | messages.GetReplies | messages.GetDiscussionMessage | messages.ReadDiscussion | messages.UnpinAllMessages | messages.DeleteChat | messages.DeletePhoneCallHistory | messages.CheckHistoryImport | messages.InitHistoryImport | messages.UploadImportedMedia | messages.StartHistoryImport | messages.GetExportedChatInvites | messages.GetExportedChatInvite | messages.EditExportedChatInvite | messages.DeleteRevokedExportedChatInvites | messages.DeleteExportedChatInvite | messages.GetAdminsWithInvites | messages.GetChatInviteImporters | messages.SetHistoryTTL | messages.CheckHistoryImportPeer | messages.SetChatTheme | messages.GetMessageReadParticipants | messages.GetSearchResultsCalendar | messages.GetSearchResultsPositions | messages.HideChatJoinRequest | messages.HideAllChatJoinRequests | messages.ToggleNoForwards | messages.SaveDefaultSendAs | messages.SendReaction | messages.GetMessagesReactions | messages.GetMessageReactionsList | messages.SetChatAvailableReactions | messages.GetAvailableReactions | messages.SetDefaultReaction | messages.TranslateText | messages.GetUnreadReactions | messages.ReadReactions | messages.SearchSentMedia
|
||||
| updates.GetState | updates.GetDifference | updates.GetChannelDifference
|
||||
| photos.UpdateProfilePhoto | photos.UploadProfilePhoto | photos.DeletePhotos | photos.GetUserPhotos
|
||||
| upload.SaveFilePart | upload.GetFile | upload.SaveBigFilePart | upload.GetWebFile | upload.GetCdnFile | upload.ReuploadCdnFile | upload.GetCdnFileHashes | upload.GetFileHashes
|
||||
@ -12402,7 +12462,7 @@ namespace Api {
|
||||
| bots.SendCustomRequest | bots.AnswerWebhookJSONQuery | bots.SetBotCommands | bots.ResetBotCommands | bots.GetBotCommands
|
||||
| payments.GetPaymentForm | payments.GetPaymentReceipt | payments.ValidateRequestedInfo | payments.SendPaymentForm | payments.GetSavedInfo | payments.ClearSavedInfo | payments.GetBankCardData
|
||||
| stickers.CreateStickerSet | stickers.RemoveStickerFromSet | stickers.ChangeStickerPosition | stickers.AddStickerToSet | stickers.SetStickerSetThumb | stickers.CheckShortName | stickers.SuggestShortName
|
||||
| phone.GetCallConfig | phone.RequestCall | phone.AcceptCall | phone.ConfirmCall | phone.ReceivedCall | phone.DiscardCall | phone.SetCallRating | phone.SaveCallDebug | phone.SendSignalingData | phone.CreateGroupCall | phone.JoinGroupCall | phone.LeaveGroupCall | phone.InviteToGroupCall | phone.DiscardGroupCall | phone.ToggleGroupCallSettings | phone.GetGroupCall | phone.GetGroupParticipants | phone.CheckGroupCall | phone.ToggleGroupCallRecord | phone.EditGroupCallParticipant | phone.EditGroupCallTitle | phone.GetGroupCallJoinAs | phone.ExportGroupCallInvite | phone.ToggleGroupCallStartSubscription | phone.StartScheduledGroupCall | phone.SaveDefaultGroupCallJoinAs | phone.JoinGroupCallPresentation | phone.LeaveGroupCallPresentation
|
||||
| phone.GetCallConfig | phone.RequestCall | phone.AcceptCall | phone.ConfirmCall | phone.ReceivedCall | phone.DiscardCall | phone.SetCallRating | phone.SaveCallDebug | phone.SendSignalingData | phone.CreateGroupCall | phone.JoinGroupCall | phone.LeaveGroupCall | phone.InviteToGroupCall | phone.DiscardGroupCall | phone.ToggleGroupCallSettings | phone.GetGroupCall | phone.GetGroupParticipants | phone.CheckGroupCall | phone.ToggleGroupCallRecord | phone.EditGroupCallParticipant | phone.EditGroupCallTitle | phone.GetGroupCallJoinAs | phone.ExportGroupCallInvite | phone.ToggleGroupCallStartSubscription | phone.StartScheduledGroupCall | phone.SaveDefaultGroupCallJoinAs | phone.JoinGroupCallPresentation | phone.LeaveGroupCallPresentation | phone.GetGroupCallStreamChannels | phone.GetGroupCallStreamRtmpUrl
|
||||
| langpack.GetLangPack | langpack.GetStrings | langpack.GetDifference | langpack.GetLanguages | langpack.GetLanguage
|
||||
| folders.EditPeerFolders | folders.DeleteFolder
|
||||
| stats.GetBroadcastStats | stats.LoadAsyncGraph | stats.GetMegagroupStats | stats.GetMessagePublicForwards | stats.GetMessageStats;
|
||||
|
@ -166,6 +166,8 @@ inputReportReasonOther#c1e4a2b1 = ReportReason;
|
||||
inputReportReasonCopyright#9b89f93a = ReportReason;
|
||||
inputReportReasonGeoIrrelevant#dbd4feed = ReportReason;
|
||||
inputReportReasonFake#f5ddd6e7 = ReportReason;
|
||||
inputReportReasonIllegalDrugs#a8eb2be = ReportReason;
|
||||
inputReportReasonPersonalDetails#9ec7863d = ReportReason;
|
||||
userFull#cf366521 flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true has_scheduled:flags.12?true video_calls_available:flags.13?true id:long about:flags.1?string settings:PeerSettings profile_photo:flags.2?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int ttl_period:flags.14?int theme_emoticon:flags.15?string private_forward_name:flags.16?string = UserFull;
|
||||
contact#145ade0b user_id:long mutual:Bool = Contact;
|
||||
importedContact#c13e3c50 user_id:long client_id:long = ImportedContact;
|
||||
@ -436,7 +438,7 @@ inputStickerSetShortName#861cc8a0 short_name:string = InputStickerSet;
|
||||
inputStickerSetAnimatedEmoji#28703c8 = InputStickerSet;
|
||||
inputStickerSetDice#e67f520e emoticon:string = InputStickerSet;
|
||||
inputStickerSetAnimatedEmojiAnimations#cde3739 = InputStickerSet;
|
||||
stickerSet#d7df217a flags:# archived:flags.1?true official:flags.2?true masks:flags.3?true animated:flags.5?true gifs:flags.6?true installed_date:flags.0?int id:long access_hash:long title:string short_name:string thumbs:flags.4?Vector<PhotoSize> thumb_dc_id:flags.4?int thumb_version:flags.4?int count:int hash:int = StickerSet;
|
||||
stickerSet#d7df217a flags:# archived:flags.1?true official:flags.2?true masks:flags.3?true animated:flags.5?true videos:flags.6?true installed_date:flags.0?int id:long access_hash:long title:string short_name:string thumbs:flags.4?Vector<PhotoSize> thumb_dc_id:flags.4?int thumb_version:flags.4?int count:int hash:int = StickerSet;
|
||||
messages.stickerSet#b60a24a6 set:StickerSet packs:Vector<StickerPack> documents:Vector<Document> = messages.StickerSet;
|
||||
messages.stickerSetNotModified#d3f924eb = messages.StickerSet;
|
||||
botCommand#c27ac8c7 command:string description:string = BotCommand;
|
||||
@ -897,7 +899,7 @@ messageReplies#83d60fc2 flags:# comments:flags.0?true replies:int replies_pts:in
|
||||
peerBlocked#e8fd8014 peer_id:Peer date:int = PeerBlocked;
|
||||
stats.messageStats#8999f295 views_graph:StatsGraph = stats.MessageStats;
|
||||
groupCallDiscarded#7780bcb4 id:long access_hash:long duration:int = GroupCall;
|
||||
groupCall#d597650c flags:# join_muted:flags.1?true can_change_join_muted:flags.2?true join_date_asc:flags.6?true schedule_start_subscribed:flags.8?true can_start_video:flags.9?true record_video_active:flags.11?true id:long access_hash:long participants_count:int title:flags.3?string stream_dc_id:flags.4?int record_start_date:flags.5?int schedule_date:flags.7?int unmuted_video_count:flags.10?int unmuted_video_limit:int version:int = GroupCall;
|
||||
groupCall#d597650c flags:# join_muted:flags.1?true can_change_join_muted:flags.2?true join_date_asc:flags.6?true schedule_start_subscribed:flags.8?true can_start_video:flags.9?true record_video_active:flags.11?true rtmp_stream:flags.12?true listeners_hidden:flags.13?true id:long access_hash:long participants_count:int title:flags.3?string stream_dc_id:flags.4?int record_start_date:flags.5?int schedule_date:flags.7?int unmuted_video_count:flags.10?int unmuted_video_limit:int version:int = GroupCall;
|
||||
inputGroupCall#d8aa840f id:long access_hash:long = InputGroupCall;
|
||||
groupCallParticipant#eba636fe flags:# muted:flags.0?true left:flags.1?true can_self_unmute:flags.2?true just_joined:flags.4?true versioned:flags.5?true min:flags.8?true muted_by_you:flags.9?true volume_by_admin:flags.10?true self:flags.12?true video_joined:flags.15?true peer:Peer date:int active_date:flags.3?int source:int volume:flags.7?int about:flags.11?string raise_hand_rating:flags.13?long video:flags.6?GroupCallParticipantVideo presentation:flags.14?GroupCallParticipantVideo = GroupCallParticipant;
|
||||
phone.groupCall#9e727aad call:GroupCall participants:Vector<GroupCallParticipant> participants_next_offset:string chats:Vector<Chat> users:Vector<User> = phone.GroupCall;
|
||||
@ -952,6 +954,9 @@ messages.availableReactions#768e3aad hash:int reactions:Vector<AvailableReaction
|
||||
messages.translateNoResult#67ca4737 = messages.TranslatedText;
|
||||
messages.translateResultText#a214f7d0 text:string = messages.TranslatedText;
|
||||
messagePeerReaction#51b67eff flags:# big:flags.0?true unread:flags.1?true peer_id:Peer reaction:string = MessagePeerReaction;
|
||||
groupCallStreamChannel#80eb48af channel:int scale:int last_timestamp_ms:long = GroupCallStreamChannel;
|
||||
phone.groupCallStreamChannels#d0e482b2 channels:Vector<GroupCallStreamChannel> = phone.GroupCallStreamChannels;
|
||||
phone.groupCallStreamRtmpUrl#2dbf3432 url:string key:string = phone.GroupCallStreamRtmpUrl;
|
||||
---functions---
|
||||
initConnection#c1cd5ea9 {X:Type} flags:# api_id:int device_model:string system_version:string app_version:string system_lang_code:string lang_pack:string lang_code:string proxy:flags.0?InputClientProxy params:flags.1?JSONValue query:!X = X;
|
||||
invokeWithLayer#da9b0d0d {X:Type} layer:int query:!X = X;
|
||||
@ -1009,6 +1014,7 @@ contacts.search#11f812d8 q:string limit:int = contacts.Found;
|
||||
contacts.resolveUsername#f93ccba3 username:string = contacts.ResolvedPeer;
|
||||
contacts.getTopPeers#973478b6 flags:# correspondents:flags.0?true bots_pm:flags.1?true bots_inline:flags.2?true phone_calls:flags.3?true forward_users:flags.4?true forward_chats:flags.5?true groups:flags.10?true channels:flags.15?true offset:int limit:int hash:long = contacts.TopPeers;
|
||||
contacts.addContact#e8f463d0 flags:# add_phone_privacy_exception:flags.0?true id:InputUser first_name:string last_name:string phone:string = Updates;
|
||||
contacts.resolvePhone#8af94344 phone:string = contacts.ResolvedPeer;
|
||||
messages.getMessages#63c66506 id:Vector<InputMessage> = messages.Messages;
|
||||
messages.getDialogs#a0f4cb4f flags:# exclude_pinned:flags.0?true folder_id:flags.1?int offset_date:int offset_id:int offset_peer:InputPeer limit:int hash:long = messages.Dialogs;
|
||||
messages.getHistory#4423e6c5 peer:InputPeer offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int hash:long = messages.Messages;
|
||||
@ -1145,7 +1151,7 @@ payments.getPaymentReceipt#2478d1cc peer:InputPeer msg_id:int = payments.Payment
|
||||
payments.validateRequestedInfo#db103170 flags:# save:flags.0?true peer:InputPeer msg_id:int info:PaymentRequestedInfo = payments.ValidatedRequestedInfo;
|
||||
payments.sendPaymentForm#30c3bc9d flags:# form_id:long peer:InputPeer msg_id:int requested_info_id:flags.0?string shipping_option_id:flags.1?string credentials:InputPaymentCredentials tip_amount:flags.2?long = payments.PaymentResult;
|
||||
payments.getSavedInfo#227d824b = payments.SavedInfo;
|
||||
phone.createGroupCall#48cdc6d8 flags:# peer:InputPeer random_id:int title:flags.0?string schedule_date:flags.1?int = Updates;
|
||||
phone.createGroupCall#48cdc6d8 flags:# rtmp_stream:flags.2?true peer:InputPeer random_id:int title:flags.0?string schedule_date:flags.1?int = Updates;
|
||||
phone.joinGroupCall#b132ff7b flags:# muted:flags.0?true video_stopped:flags.2?true call:InputGroupCall join_as:InputPeer invite_hash:flags.1?string params:DataJSON = Updates;
|
||||
phone.leaveGroupCall#500377f9 call:InputGroupCall source:int = Updates;
|
||||
phone.discardGroupCall#7a777135 call:InputGroupCall = Updates;
|
||||
|
@ -55,6 +55,7 @@
|
||||
"contacts.resolveUsername",
|
||||
"contacts.getTopPeers",
|
||||
"contacts.addContact",
|
||||
"contacts.resolvePhone",
|
||||
"messages.getMessages",
|
||||
"messages.getDialogs",
|
||||
"messages.getHistory",
|
||||
|
@ -235,6 +235,8 @@ inputReportReasonOther#c1e4a2b1 = ReportReason;
|
||||
inputReportReasonCopyright#9b89f93a = ReportReason;
|
||||
inputReportReasonGeoIrrelevant#dbd4feed = ReportReason;
|
||||
inputReportReasonFake#f5ddd6e7 = ReportReason;
|
||||
inputReportReasonIllegalDrugs#a8eb2be = ReportReason;
|
||||
inputReportReasonPersonalDetails#9ec7863d = ReportReason;
|
||||
|
||||
userFull#cf366521 flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true has_scheduled:flags.12?true video_calls_available:flags.13?true id:long about:flags.1?string settings:PeerSettings profile_photo:flags.2?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int ttl_period:flags.14?int theme_emoticon:flags.15?string private_forward_name:flags.16?string = UserFull;
|
||||
|
||||
@ -566,7 +568,7 @@ inputStickerSetAnimatedEmoji#28703c8 = InputStickerSet;
|
||||
inputStickerSetDice#e67f520e emoticon:string = InputStickerSet;
|
||||
inputStickerSetAnimatedEmojiAnimations#cde3739 = InputStickerSet;
|
||||
|
||||
stickerSet#d7df217a flags:# archived:flags.1?true official:flags.2?true masks:flags.3?true animated:flags.5?true gifs:flags.6?true installed_date:flags.0?int id:long access_hash:long title:string short_name:string thumbs:flags.4?Vector<PhotoSize> thumb_dc_id:flags.4?int thumb_version:flags.4?int count:int hash:int = StickerSet;
|
||||
stickerSet#d7df217a flags:# archived:flags.1?true official:flags.2?true masks:flags.3?true animated:flags.5?true videos:flags.6?true installed_date:flags.0?int id:long access_hash:long title:string short_name:string thumbs:flags.4?Vector<PhotoSize> thumb_dc_id:flags.4?int thumb_version:flags.4?int count:int hash:int = StickerSet;
|
||||
|
||||
messages.stickerSet#b60a24a6 set:StickerSet packs:Vector<StickerPack> documents:Vector<Document> = messages.StickerSet;
|
||||
messages.stickerSetNotModified#d3f924eb = messages.StickerSet;
|
||||
@ -1226,7 +1228,7 @@ peerBlocked#e8fd8014 peer_id:Peer date:int = PeerBlocked;
|
||||
stats.messageStats#8999f295 views_graph:StatsGraph = stats.MessageStats;
|
||||
|
||||
groupCallDiscarded#7780bcb4 id:long access_hash:long duration:int = GroupCall;
|
||||
groupCall#d597650c flags:# join_muted:flags.1?true can_change_join_muted:flags.2?true join_date_asc:flags.6?true schedule_start_subscribed:flags.8?true can_start_video:flags.9?true record_video_active:flags.11?true id:long access_hash:long participants_count:int title:flags.3?string stream_dc_id:flags.4?int record_start_date:flags.5?int schedule_date:flags.7?int unmuted_video_count:flags.10?int unmuted_video_limit:int version:int = GroupCall;
|
||||
groupCall#d597650c flags:# join_muted:flags.1?true can_change_join_muted:flags.2?true join_date_asc:flags.6?true schedule_start_subscribed:flags.8?true can_start_video:flags.9?true record_video_active:flags.11?true rtmp_stream:flags.12?true listeners_hidden:flags.13?true id:long access_hash:long participants_count:int title:flags.3?string stream_dc_id:flags.4?int record_start_date:flags.5?int schedule_date:flags.7?int unmuted_video_count:flags.10?int unmuted_video_limit:int version:int = GroupCall;
|
||||
|
||||
inputGroupCall#d8aa840f id:long access_hash:long = InputGroupCall;
|
||||
|
||||
@ -1321,6 +1323,12 @@ messages.translateResultText#a214f7d0 text:string = messages.TranslatedText;
|
||||
|
||||
messagePeerReaction#51b67eff flags:# big:flags.0?true unread:flags.1?true peer_id:Peer reaction:string = MessagePeerReaction;
|
||||
|
||||
groupCallStreamChannel#80eb48af channel:int scale:int last_timestamp_ms:long = GroupCallStreamChannel;
|
||||
|
||||
phone.groupCallStreamChannels#d0e482b2 channels:Vector<GroupCallStreamChannel> = phone.GroupCallStreamChannels;
|
||||
|
||||
phone.groupCallStreamRtmpUrl#2dbf3432 url:string key:string = phone.GroupCallStreamRtmpUrl;
|
||||
|
||||
---functions---
|
||||
|
||||
invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X;
|
||||
@ -1449,6 +1457,7 @@ contacts.addContact#e8f463d0 flags:# add_phone_privacy_exception:flags.0?true id
|
||||
contacts.acceptContact#f831a20f id:InputUser = Updates;
|
||||
contacts.getLocated#d348bc44 flags:# background:flags.1?true geo_point:InputGeoPoint self_expires:flags.0?int = Updates;
|
||||
contacts.blockFromReplies#29a8962c flags:# delete_message:flags.0?true delete_history:flags.1?true report_spam:flags.2?true msg_id:int = Updates;
|
||||
contacts.resolvePhone#8af94344 phone:string = contacts.ResolvedPeer;
|
||||
|
||||
messages.getMessages#63c66506 id:Vector<InputMessage> = messages.Messages;
|
||||
messages.getDialogs#a0f4cb4f flags:# exclude_pinned:flags.0?true folder_id:flags.1?int offset_date:int offset_id:int offset_peer:InputPeer limit:int hash:long = messages.Dialogs;
|
||||
@ -1608,6 +1617,7 @@ messages.setDefaultReaction#d960c4d4 reaction:string = Bool;
|
||||
messages.translateText#24ce6dee flags:# peer:flags.0?InputPeer msg_id:flags.0?int text:flags.1?string from_lang:flags.2?string to_lang:string = messages.TranslatedText;
|
||||
messages.getUnreadReactions#e85bae1a peer:InputPeer offset_id:int add_offset:int limit:int max_id:int min_id:int = messages.Messages;
|
||||
messages.readReactions#82e251d7 peer:InputPeer = messages.AffectedHistory;
|
||||
messages.searchSentMedia#107e31a0 q:string filter:MessagesFilter limit:int = messages.Messages;
|
||||
|
||||
updates.getState#edd4882a = updates.State;
|
||||
updates.getDifference#25939651 flags:# pts:int pts_total_limit:flags.0?int date:int qts:int = updates.Difference;
|
||||
@ -1704,7 +1714,7 @@ payments.getSavedInfo#227d824b = payments.SavedInfo;
|
||||
payments.clearSavedInfo#d83d70c1 flags:# credentials:flags.0?true info:flags.1?true = Bool;
|
||||
payments.getBankCardData#2e79d779 number:string = payments.BankCardData;
|
||||
|
||||
stickers.createStickerSet#9021ab67 flags:# masks:flags.0?true animated:flags.1?true user_id:InputUser title:string short_name:string thumb:flags.2?InputDocument stickers:Vector<InputStickerSetItem> software:flags.3?string = messages.StickerSet;
|
||||
stickers.createStickerSet#9021ab67 flags:# masks:flags.0?true animated:flags.1?true videos:flags.4?true user_id:InputUser title:string short_name:string thumb:flags.2?InputDocument stickers:Vector<InputStickerSetItem> software:flags.3?string = messages.StickerSet;
|
||||
stickers.removeStickerFromSet#f7760f51 sticker:InputDocument = messages.StickerSet;
|
||||
stickers.changeStickerPosition#ffb6d4ca sticker:InputDocument position:int = messages.StickerSet;
|
||||
stickers.addStickerToSet#8653febe stickerset:InputStickerSet sticker:InputStickerSetItem = messages.StickerSet;
|
||||
@ -1721,7 +1731,7 @@ phone.discardCall#b2cbc1c0 flags:# video:flags.0?true peer:InputPhoneCall durati
|
||||
phone.setCallRating#59ead627 flags:# user_initiative:flags.0?true peer:InputPhoneCall rating:int comment:string = Updates;
|
||||
phone.saveCallDebug#277add7e peer:InputPhoneCall debug:DataJSON = Bool;
|
||||
phone.sendSignalingData#ff7a9383 peer:InputPhoneCall data:bytes = Bool;
|
||||
phone.createGroupCall#48cdc6d8 flags:# peer:InputPeer random_id:int title:flags.0?string schedule_date:flags.1?int = Updates;
|
||||
phone.createGroupCall#48cdc6d8 flags:# rtmp_stream:flags.2?true peer:InputPeer random_id:int title:flags.0?string schedule_date:flags.1?int = Updates;
|
||||
phone.joinGroupCall#b132ff7b flags:# muted:flags.0?true video_stopped:flags.2?true call:InputGroupCall join_as:InputPeer invite_hash:flags.1?string params:DataJSON = Updates;
|
||||
phone.leaveGroupCall#500377f9 call:InputGroupCall source:int = Updates;
|
||||
phone.inviteToGroupCall#7b393160 call:InputGroupCall users:Vector<InputUser> = Updates;
|
||||
@ -1740,6 +1750,8 @@ phone.startScheduledGroupCall#5680e342 call:InputGroupCall = Updates;
|
||||
phone.saveDefaultGroupCallJoinAs#575e1f8c peer:InputPeer join_as:InputPeer = Bool;
|
||||
phone.joinGroupCallPresentation#cbea6bc4 call:InputGroupCall params:DataJSON = Updates;
|
||||
phone.leaveGroupCallPresentation#1c50d144 call:InputGroupCall = Updates;
|
||||
phone.getGroupCallStreamChannels#1ab21940 call:InputGroupCall = phone.GroupCallStreamChannels;
|
||||
phone.getGroupCallStreamRtmpUrl#deb3abbf peer:InputPeer revoke:Bool = phone.GroupCallStreamRtmpUrl;
|
||||
|
||||
langpack.getLangPack#f2f2330a lang_pack:string lang_code:string = LangPackDifference;
|
||||
langpack.getStrings#efea3803 lang_pack:string lang_code:string keys:Vector<string> = Vector<LangPackString>;
|
||||
@ -1756,4 +1768,4 @@ stats.getMegagroupStats#dcdf8607 flags:# dark:flags.0?true channel:InputChannel
|
||||
stats.getMessagePublicForwards#5630281b channel:InputChannel msg_id:int offset_rate:int offset_peer:InputPeer offset_id:int limit:int = messages.Messages;
|
||||
stats.getMessageStats#b6e0a3f5 flags:# dark:flags.0?true channel:InputChannel msg_id:int = stats.MessageStats;
|
||||
|
||||
// LAYER 138
|
||||
// LAYER 139
|
||||
|
@ -29,7 +29,7 @@ import {
|
||||
selectChat, selectUser, selectChatListType, selectIsChatPinned,
|
||||
selectChatFolder, selectSupportChat, selectChatByUsername, selectThreadTopMessageId,
|
||||
selectCurrentMessageList, selectThreadInfo, selectCurrentChat, selectLastServiceNotification,
|
||||
selectVisibleUsers,
|
||||
selectVisibleUsers, selectUserByPhoneNumber,
|
||||
} from '../../selectors';
|
||||
import { buildCollectionByKey, omit } from '../../../util/iteratees';
|
||||
import { debounce, pause, throttle } from '../../../util/schedulers';
|
||||
@ -40,6 +40,7 @@ import { processDeepLink } from '../../../util/deeplink';
|
||||
import { updateGroupCall } from '../../reducers/calls';
|
||||
import { selectGroupCall } from '../../selectors/calls';
|
||||
import { getOrderedIds } from '../../../util/folderManager';
|
||||
import * as langProvider from '../../../util/langProvider';
|
||||
|
||||
const TOP_CHAT_MESSAGES_PRELOAD_INTERVAL = 100;
|
||||
const INFINITE_LOOP_MARKER = 100;
|
||||
@ -514,6 +515,26 @@ addReducer('openChatByInvite', (global, actions, payload) => {
|
||||
})();
|
||||
});
|
||||
|
||||
addReducer('openChatByPhoneNumber', (global, actions, payload) => {
|
||||
const { phoneNumber } = payload!;
|
||||
|
||||
(async () => {
|
||||
// Open temporary empty chat to make the click response feel faster
|
||||
actions.openChat({ id: TMP_CHAT_ID });
|
||||
|
||||
const chat = await fetchChatByPhoneNumber(phoneNumber);
|
||||
if (!chat) {
|
||||
actions.openPreviousChat();
|
||||
actions.showNotification({
|
||||
message: langProvider.getTranslation('lng_username_by_phone_not_found').replace('{phone}', phoneNumber),
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
actions.openChat({ id: chat.id });
|
||||
})();
|
||||
});
|
||||
|
||||
addReducer('openTelegramLink', (global, actions, payload) => {
|
||||
const { url } = payload!;
|
||||
if (url.match(RE_TG_LINK)) {
|
||||
@ -530,6 +551,11 @@ addReducer('openTelegramLink', (global, actions, payload) => {
|
||||
hash = part2;
|
||||
}
|
||||
|
||||
if (part1.match(/^\+([0-9]+)(\?|$)/)) {
|
||||
actions.openChatByPhoneNumber({ phoneNumber: part1.substr(1, part1.length - 1) });
|
||||
return;
|
||||
}
|
||||
|
||||
if (part1.startsWith(' ') || part1.startsWith('+')) {
|
||||
hash = part1.substr(1, part1.length - 1);
|
||||
}
|
||||
@ -1285,6 +1311,23 @@ export async function fetchChatByUsername(
|
||||
return chat;
|
||||
}
|
||||
|
||||
export async function fetchChatByPhoneNumber(phoneNumber: string) {
|
||||
const global = getGlobal();
|
||||
const localUser = selectUserByPhoneNumber(global, phoneNumber);
|
||||
if (localUser && !localUser.isMin) {
|
||||
return selectChat(global, localUser.id);
|
||||
}
|
||||
|
||||
const chat = await callApi('getChatByPhoneNumber', phoneNumber);
|
||||
if (!chat) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
setGlobal(updateChat(getGlobal(), chat.id, chat));
|
||||
|
||||
return chat;
|
||||
}
|
||||
|
||||
async function openChatByUsername(
|
||||
actions: GlobalActions,
|
||||
username: string,
|
||||
|
@ -191,7 +191,7 @@ export function getMessageContentFilename(message: ApiMessage) {
|
||||
}
|
||||
|
||||
if (content.sticker) {
|
||||
const extension = content.sticker.isLottie ? 'tgs' : content.sticker.isGif
|
||||
const extension = content.sticker.isLottie ? 'tgs' : content.sticker.isVideo
|
||||
? 'webm' : isWebpSupported() ? 'webp' : 'png';
|
||||
return `${content.sticker.id}.${extension}`;
|
||||
}
|
||||
|
@ -23,6 +23,13 @@ export function selectUserByUsername(global: GlobalState, username: string) {
|
||||
);
|
||||
}
|
||||
|
||||
// Slow, not to be used in `withGlobal`
|
||||
export function selectUserByPhoneNumber(global: GlobalState, phoneNumber: string) {
|
||||
const phoneNumberCleaned = phoneNumber.replace(/[^0-9]/g, '');
|
||||
|
||||
return Object.values(global.users.byId).find((user) => user?.phoneNumber === phoneNumberCleaned);
|
||||
}
|
||||
|
||||
export function selectIsUserOrChatContact(global: GlobalState, userOrChat: ApiUser | ApiChat) {
|
||||
return global.contactList && global.contactList.userIds.includes(userOrChat.id);
|
||||
}
|
||||
|
@ -208,7 +208,7 @@ export enum SettingsScreens {
|
||||
}
|
||||
|
||||
export type StickerSetOrRecent = Pick<ApiStickerSet, (
|
||||
'id' | 'title' | 'count' | 'stickers' | 'hasThumbnail' | 'isLottie' | 'isGifs'
|
||||
'id' | 'title' | 'count' | 'stickers' | 'hasThumbnail' | 'isLottie' | 'isVideos'
|
||||
)>;
|
||||
|
||||
export enum LeftColumnContent {
|
||||
|
@ -14,6 +14,7 @@ export const processDeepLink = (url: string) => {
|
||||
const {
|
||||
openChatByInvite,
|
||||
openChatByUsername,
|
||||
openChatByPhoneNumber,
|
||||
openStickerSetShortName,
|
||||
focusMessage,
|
||||
joinVoiceChatByLink,
|
||||
@ -29,7 +30,7 @@ export const processDeepLink = (url: string) => {
|
||||
switch (method) {
|
||||
case 'resolve': {
|
||||
const {
|
||||
domain, post, comment, voicechat, livestream, start,
|
||||
domain, phone, post, comment, voicechat, livestream, start,
|
||||
} = params;
|
||||
|
||||
if (domain !== 'telegrampassport') {
|
||||
@ -38,6 +39,8 @@ export const processDeepLink = (url: string) => {
|
||||
username: domain,
|
||||
inviteHash: voicechat || livestream,
|
||||
});
|
||||
} else if (phone) {
|
||||
openChatByPhoneNumber({ phone });
|
||||
} else {
|
||||
openChatByUsername({
|
||||
username: domain,
|
||||
|
Loading…
Reference in New Issue
Block a user