Fix editing old messages in chats/channels
This commit is contained in:
parent
6c55fbb85d
commit
443822884d
@ -42,7 +42,7 @@ import LazyLoadQueue from "../lazyLoadQueue";
|
||||
import ListenerSetter from "../../helpers/listenerSetter";
|
||||
import PollElement from "../poll";
|
||||
import AudioElement from "../audio";
|
||||
import { Message, MessageEntity, MessageMedia, MessageReplyHeader, Photo, PhotoSize, ReplyMarkup, Update, WebPage } from "../../layer";
|
||||
import { Message, MessageEntity, MessageMedia, MessageReplyHeader, Photo, PhotoSize, ReplyMarkup, SponsoredMessage, Update, WebPage } from "../../layer";
|
||||
import { NULL_PEER_ID, REPLIES_PEER_ID } from "../../lib/mtproto/mtproto_config";
|
||||
import { FocusDirection } from "../../helpers/fastSmoothScroll";
|
||||
import useHeavyAnimationCheck, { getHeavyAnimationPromise, dispatchHeavyAnimationEvent, interruptHeavyAnimation } from "../../hooks/useHeavyAnimationCheck";
|
||||
@ -194,7 +194,7 @@ export default class ChatBubbles {
|
||||
private getSponsoredMessagePromise: Promise<void>;
|
||||
|
||||
private previousStickyDate: HTMLElement;
|
||||
sponsoredMessage: import("/Users/kuzmenko/Documents/projects/tweb/src/layer").SponsoredMessage.sponsoredMessage;
|
||||
private sponsoredMessage: SponsoredMessage.sponsoredMessage;
|
||||
|
||||
constructor(
|
||||
private chat: Chat,
|
||||
|
@ -3446,7 +3446,7 @@ export class AppMessagesManager {
|
||||
return true;
|
||||
}
|
||||
|
||||
public canEditMessage(message: any, kind: 'text' | 'poll' = 'text') {
|
||||
public canEditMessage(message: Message.message | Message.messageService, kind: 'text' | 'poll' = 'text') {
|
||||
if(!message || !this.canMessageBeEdited(message, kind)) {
|
||||
return false;
|
||||
}
|
||||
@ -3456,8 +3456,12 @@ export class AppMessagesManager {
|
||||
return true;
|
||||
}
|
||||
|
||||
if((message.date < (tsNow(true) - rootScope.config.edit_time_limit) &&
|
||||
message.media?._ !== 'messageMediaPoll') || !message.pFlags.out) {
|
||||
if(!message.pFlags.out || (
|
||||
message.peerId.isUser() &&
|
||||
message.date < (tsNow(true) - rootScope.config.edit_time_limit) &&
|
||||
(message as Message.message).media?._ !== 'messageMediaPoll'
|
||||
)
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user