Round Video: Disable captions
This commit is contained in:
parent
f2510d9b65
commit
417941f5f3
@ -116,20 +116,7 @@ export function buildApiMessageFromNotification(
|
|||||||
currentDate: number,
|
currentDate: number,
|
||||||
): ApiMessage {
|
): ApiMessage {
|
||||||
const localId = localMessageCounter++;
|
const localId = localMessageCounter++;
|
||||||
let content: ApiMessage['content'] = {};
|
const content = buildMessageContent(notification);
|
||||||
|
|
||||||
if (notification.media) {
|
|
||||||
content = {
|
|
||||||
...buildMessageMediaContent(notification.media),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
if (notification.message && !content.sticker && !content.poll && !content.contact) {
|
|
||||||
content = {
|
|
||||||
...content,
|
|
||||||
text: buildMessageTextContent(notification.message, notification.entities),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
id: localId,
|
id: localId,
|
||||||
@ -154,22 +141,7 @@ export function buildApiMessageWithChatId(chatId: string, mtpMessage: UniversalM
|
|||||||
const peerId = mtpMessage.peerId ? getApiChatIdFromMtpPeer(mtpMessage.peerId) : undefined;
|
const peerId = mtpMessage.peerId ? getApiChatIdFromMtpPeer(mtpMessage.peerId) : undefined;
|
||||||
const isChatWithSelf = !fromId && chatId === currentUserId;
|
const isChatWithSelf = !fromId && chatId === currentUserId;
|
||||||
const isOutgoing = (mtpMessage.out && !mtpMessage.post) || (isChatWithSelf && !mtpMessage.fwdFrom);
|
const isOutgoing = (mtpMessage.out && !mtpMessage.post) || (isChatWithSelf && !mtpMessage.fwdFrom);
|
||||||
|
const content = buildMessageContent(mtpMessage);
|
||||||
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 action = mtpMessage.action
|
const action = mtpMessage.action
|
||||||
&& buildAction(mtpMessage.action, fromId, peerId, Boolean(mtpMessage.post), isOutgoing);
|
&& buildAction(mtpMessage.action, fromId, peerId, Boolean(mtpMessage.post), isOutgoing);
|
||||||
if (action) {
|
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(
|
export function buildMessageTextContent(
|
||||||
message: string,
|
message: string,
|
||||||
entities?: GramJs.TypeMessageEntity[],
|
entities?: GramJs.TypeMessageEntity[],
|
||||||
|
|||||||
@ -576,7 +576,6 @@
|
|||||||
|
|
||||||
.message-content.custom-shape {
|
.message-content.custom-shape {
|
||||||
line-height: 1.2;
|
line-height: 1.2;
|
||||||
font-size: 10rem;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
align-items: flex-end;
|
align-items: flex-end;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user