Round Video: Disable captions

This commit is contained in:
Alexander Zinchuk 2022-01-25 03:24:40 +01:00
parent f2510d9b65
commit 417941f5f3
2 changed files with 23 additions and 31 deletions

View File

@ -116,20 +116,7 @@ export function buildApiMessageFromNotification(
currentDate: number,
): ApiMessage {
const localId = localMessageCounter++;
let content: ApiMessage['content'] = {};
if (notification.media) {
content = {
...buildMessageMediaContent(notification.media),
};
}
if (notification.message && !content.sticker && !content.poll && !content.contact) {
content = {
...content,
text: buildMessageTextContent(notification.message, notification.entities),
};
}
const content = buildMessageContent(notification);
return {
id: localId,
@ -154,22 +141,7 @@ export function buildApiMessageWithChatId(chatId: string, mtpMessage: UniversalM
const peerId = mtpMessage.peerId ? getApiChatIdFromMtpPeer(mtpMessage.peerId) : undefined;
const isChatWithSelf = !fromId && chatId === currentUserId;
const isOutgoing = (mtpMessage.out && !mtpMessage.post) || (isChatWithSelf && !mtpMessage.fwdFrom);
let content: ApiMessage['content'] = {};
if (mtpMessage.media) {
content = {
...buildMessageMediaContent(mtpMessage.media),
};
}
if (mtpMessage.message && !content.sticker && !content.poll && !content.contact) {
content = {
...content,
text: buildMessageTextContent(mtpMessage.message, mtpMessage.entities),
};
}
const content = buildMessageContent(mtpMessage);
const action = mtpMessage.action
&& buildAction(mtpMessage.action, fromId, peerId, Boolean(mtpMessage.post), isOutgoing);
if (action) {
@ -267,6 +239,27 @@ export function buildApiAvailableReaction(availableReaction: GramJs.AvailableRea
};
}
export function buildMessageContent(
mtpMessage: UniversalMessage | GramJs.UpdateServiceNotification,
) {
let content: ApiMessage['content'] = {};
if (mtpMessage.media) {
content = {
...buildMessageMediaContent(mtpMessage.media),
};
}
if (mtpMessage.message && !content.sticker && !content.poll && !content.contact && !(content.video?.isRound)) {
content = {
...content,
text: buildMessageTextContent(mtpMessage.message, mtpMessage.entities),
};
}
return content;
}
export function buildMessageTextContent(
message: string,
entities?: GramJs.TypeMessageEntity[],

View File

@ -576,7 +576,6 @@
.message-content.custom-shape {
line-height: 1.2;
font-size: 10rem;
display: flex;
flex-wrap: wrap;
align-items: flex-end;