misc
This commit is contained in:
parent
50d2d807b8
commit
21a39414c0
@ -2160,15 +2160,8 @@ export default class ChatBubbles {
|
||||
bubble.classList.add(status);
|
||||
}
|
||||
|
||||
let messageWithReplies: Message.message;
|
||||
let withReplies: boolean;
|
||||
if(this.peerId === REPLIES_PEER_ID) {
|
||||
messageWithReplies = message;
|
||||
withReplies = true;
|
||||
} else {
|
||||
messageWithReplies = this.appMessagesManager.filterMessages(message, message => !!(message as Message.message).replies)[0] as any;
|
||||
withReplies = messageWithReplies && messageWithReplies.replies && messageWithReplies.replies.pFlags.comments && messageWithReplies.replies.channel_id !== 777;
|
||||
}
|
||||
const messageWithReplies = this.appMessagesManager.getMessageWithReplies(message);
|
||||
const withReplies = !!messageWithReplies;
|
||||
|
||||
if(withReplies) {
|
||||
bubble.classList.add('with-replies');
|
||||
|
@ -190,6 +190,7 @@ export class AppImManager {
|
||||
const href = element.href;
|
||||
|
||||
const a = element.cloneNode(true) as HTMLAnchorElement;
|
||||
a.className = 'anchor-url';
|
||||
a.innerText = href;
|
||||
a.removeAttribute('onclick');
|
||||
|
||||
|
@ -51,6 +51,7 @@ import PeerTitle from "../../components/peerTitle";
|
||||
import { forEachReverse } from "../../helpers/array";
|
||||
import htmlToDocumentFragment from "../../helpers/dom/htmlToDocumentFragment";
|
||||
import htmlToSpan from "../../helpers/dom/htmlToSpan";
|
||||
import { REPLIES_PEER_ID } from "../mtproto/mtproto_config";
|
||||
|
||||
//console.trace('include');
|
||||
// TODO: если удалить сообщение в непрогруженном диалоге, то при обновлении, из-за стейта, последнего сообщения в чатлисте не будет
|
||||
@ -4510,6 +4511,17 @@ export class AppMessagesManager {
|
||||
});
|
||||
}
|
||||
|
||||
public getMessageWithReplies(message: Message.message) {
|
||||
if(message.peerId !== REPLIES_PEER_ID) {
|
||||
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)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
return message;
|
||||
}
|
||||
|
||||
public isFetchIntervalNeeded(peerId: number) {
|
||||
return peerId < 0 && !appChatsManager.isInChat(peerId);
|
||||
}
|
||||
|
@ -238,7 +238,12 @@ export class AppPhotosManager {
|
||||
boxSize = size = size.aspectCovered(makeMediaSize(200, 200));
|
||||
}
|
||||
|
||||
if(message && (message.message || message.media.webpage || message.replies)) { // make sure that bubble block is human-readable
|
||||
if(message &&
|
||||
(message.message ||
|
||||
message.media.webpage ||
|
||||
(message.replies && message.replies.pFlags.comments && message.replies.channel_id !== 777)
|
||||
)
|
||||
) { // make sure that bubble block is human-readable
|
||||
if(boxSize.width < 320) {
|
||||
boxSize = makeMediaSize(320, boxSize.height);
|
||||
isFit = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user