Browse Source

Fix displaying broken comments

master
Eduard Kuzmenko 3 years ago
parent
commit
5c179c9222
  1. 4
      src/lib/appManagers/appMessagesManager.ts
  2. 1
      src/lib/mtproto/mtproto_config.ts

4
src/lib/appManagers/appMessagesManager.ts

@ -48,7 +48,7 @@ import appNotificationsManager, { NotifyOptions } from "./appNotificationsManage
import PeerTitle from "../../components/peerTitle"; import PeerTitle from "../../components/peerTitle";
import htmlToDocumentFragment from "../../helpers/dom/htmlToDocumentFragment"; import htmlToDocumentFragment from "../../helpers/dom/htmlToDocumentFragment";
import htmlToSpan from "../../helpers/dom/htmlToSpan"; import htmlToSpan from "../../helpers/dom/htmlToSpan";
import { MUTE_UNTIL, NULL_PEER_ID, REPLIES_PEER_ID, SERVICE_PEER_ID } from "../mtproto/mtproto_config"; import { MUTE_UNTIL, NULL_PEER_ID, REPLIES_HIDDEN_PEER_ID, REPLIES_PEER_ID, SERVICE_PEER_ID } from "../mtproto/mtproto_config";
import formatCallDuration from "../../helpers/formatCallDuration"; import formatCallDuration from "../../helpers/formatCallDuration";
import appAvatarsManager from "./appAvatarsManager"; import appAvatarsManager from "./appAvatarsManager";
import telegramMeWebManager from "../mtproto/telegramMeWebManager"; import telegramMeWebManager from "../mtproto/telegramMeWebManager";
@ -5756,7 +5756,7 @@ export class AppMessagesManager {
public getMessageWithReplies(message: Message.message) { public getMessageWithReplies(message: Message.message) {
if(message.peerId !== REPLIES_PEER_ID) { if(message.peerId !== REPLIES_PEER_ID) {
message = this.filterMessages(message, message => !!(message as Message.message).replies)[0] as any; message = this.filterMessages(message, message => !!(message as Message.message).replies)[0] as any;
if(!(message && message.replies && message.replies.pFlags.comments && message.replies.channel_id !== '777')) { if(!(message && message.replies && message.replies.pFlags.comments && message.replies.channel_id.toPeerId() !== REPLIES_HIDDEN_PEER_ID)) {
return; return;
} }
} }

1
src/lib/mtproto/mtproto_config.ts

@ -12,6 +12,7 @@ export type UserAuth = {dcID: number | string, date: number, id: PeerId};
export const NULL_PEER_ID: PeerId = 0; export const NULL_PEER_ID: PeerId = 0;
export const REPLIES_PEER_ID: PeerId = 1271266957; export const REPLIES_PEER_ID: PeerId = 1271266957;
export const REPLIES_HIDDEN_PEER_ID: PeerId = 777;
export const SERVICE_PEER_ID: PeerId = 777000; export const SERVICE_PEER_ID: PeerId = 777000;
export const MUTE_UNTIL = 0x7FFFFFFF; export const MUTE_UNTIL = 0x7FFFFFFF;
export const BOT_START_PARAM = ''; export const BOT_START_PARAM = '';

Loading…
Cancel
Save