|
|
@ -1,7 +1,7 @@ |
|
|
|
import ProgressivePreloader from "../../components/preloader"; |
|
|
|
import ProgressivePreloader from "../../components/preloader"; |
|
|
|
import { CancellablePromise, deferredPromise } from "../../helpers/cancellablePromise"; |
|
|
|
import { CancellablePromise, deferredPromise } from "../../helpers/cancellablePromise"; |
|
|
|
import { randomLong } from "../../helpers/random"; |
|
|
|
import { randomLong } from "../../helpers/random"; |
|
|
|
import { Dialog as MTDialog, DialogFilter, DialogPeer, DocumentAttribute, InputMessage, Message, MessagesDialogs, MessagesFilter, MessagesMessages, MessagesPeerDialogs, MethodDeclMap, PhotoSize, SendMessageAction, Update } from "../../layer"; |
|
|
|
import { Dialog as MTDialog, DialogFilter, DialogPeer, DocumentAttribute, InputMessage, Message, MessageAction, MessagesDialogs, MessagesFilter, MessagesMessages, MessagesPeerDialogs, MethodDeclMap, PhotoSize, SendMessageAction, Update } from "../../layer"; |
|
|
|
import { InvokeApiOptions, Modify } from "../../types"; |
|
|
|
import { InvokeApiOptions, Modify } from "../../types"; |
|
|
|
import { langPack } from "../langPack"; |
|
|
|
import { langPack } from "../langPack"; |
|
|
|
import { logger, LogLevels } from "../logger"; |
|
|
|
import { logger, LogLevels } from "../logger"; |
|
|
@ -2506,11 +2506,11 @@ export class AppMessagesManager { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public wrapMessageActionText(message: any) { |
|
|
|
public wrapMessageActionText(message: any) { |
|
|
|
const action = message.action; |
|
|
|
const action = message.action as MessageAction; |
|
|
|
|
|
|
|
|
|
|
|
let str = ''; |
|
|
|
let str = ''; |
|
|
|
if(action.message) { |
|
|
|
if((action as MessageAction.messageActionCustomAction).message) { |
|
|
|
str = RichTextProcessor.wrapRichText(action.message, {noLinebreaks: true}); |
|
|
|
str = RichTextProcessor.wrapRichText((action as MessageAction.messageActionCustomAction).message, {noLinebreaks: true}); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
let _ = action._; |
|
|
|
let _ = action._; |
|
|
|
let suffix = ''; |
|
|
|
let suffix = ''; |
|
|
@ -2521,9 +2521,9 @@ export class AppMessagesManager { |
|
|
|
return title ? `<div class="name inline" data-peer-i-d="${peerID}">${title}</div> ` : ''; |
|
|
|
return title ? `<div class="name inline" data-peer-i-d="${peerID}">${title}</div> ` : ''; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
switch(_) { |
|
|
|
switch(action._) { |
|
|
|
case "messageActionPhoneCall": { |
|
|
|
case "messageActionPhoneCall": { |
|
|
|
_ += '.' + action.type; |
|
|
|
_ += '.' + (action as any).type; |
|
|
|
|
|
|
|
|
|
|
|
const duration = action.duration; |
|
|
|
const duration = action.duration; |
|
|
|
if(duration) { |
|
|
|
if(duration) { |
|
|
@ -2539,14 +2539,28 @@ export class AppMessagesManager { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
case 'messageActionChatDeleteUser': |
|
|
|
case 'messageActionChatDeleteUser': |
|
|
|
|
|
|
|
// @ts-ignore
|
|
|
|
case 'messageActionChatAddUsers': |
|
|
|
case 'messageActionChatAddUsers': |
|
|
|
case 'messageActionChatAddUser': { |
|
|
|
case 'messageActionChatAddUser': { |
|
|
|
let users: number[] = action.users || [action.user_id]; |
|
|
|
const users: number[] = (action as MessageAction.messageActionChatAddUser).users || [(action as MessageAction.messageActionChatDeleteUser).user_id]; |
|
|
|
|
|
|
|
|
|
|
|
l = langPack[_].replace('{}', users.map((userID: number) => getNameDivHTML(userID)).join(', ')); |
|
|
|
l = langPack[_].replace('{}', users.map((userID: number) => getNameDivHTML(userID)).join(', ')); |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case 'messageActionBotAllowed': { |
|
|
|
|
|
|
|
const anchorHTML = RichTextProcessor.wrapRichText(action.domain, { |
|
|
|
|
|
|
|
entities: [{ |
|
|
|
|
|
|
|
_: 'messageEntityUrl', |
|
|
|
|
|
|
|
length: action.domain.length, |
|
|
|
|
|
|
|
offset: 0 |
|
|
|
|
|
|
|
}] |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
l = langPack[_].replace('{}', anchorHTML); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
default: |
|
|
|
default: |
|
|
|
str = langPack[_] || `[${action._}]`; |
|
|
|
str = langPack[_] || `[${action._}]`; |
|
|
|
break; |
|
|
|
break; |
|
|
|