Increase media size

This commit is contained in:
Eduard Kuzmenko 2021-07-02 01:39:50 +03:00
parent 655e161e33
commit 706bf9fd27
3 changed files with 15 additions and 13 deletions

View File

@ -70,8 +70,8 @@ class MediaSizes extends EventListenerBase<{
emojiSticker: makeMediaSize(112, 112)
},
desktop: {
regular: makeMediaSize(400, 320),
webpage: makeMediaSize(400, 320),
regular: makeMediaSize(420, 340),
webpage: makeMediaSize(420, 340),
album: makeMediaSize(420, 0),
esgSticker: makeMediaSize(80, 80),
animatedSticker: makeMediaSize(200, 200),

View File

@ -658,24 +658,22 @@ namespace RichTextProcessor {
lol.sort((a, b) => a.offset - b.offset);
let out = '';
const arr: string[] = [];
let usedLength = 0;
for(const {part, offset} of lol) {
if(offset > usedLength) {
out += encodeEntities(text.slice(usedLength, offset));
arr.push(encodeEntities(text.slice(usedLength, offset)));
usedLength = offset;
}
out += part;
arr.push(part);
}
if(usedLength < text.length) {
out += encodeEntities(text.slice(usedLength));
arr.push(encodeEntities(text.slice(usedLength)));
}
return out;
return arr.join('');
}
export function fixEmoji(text: string, entities?: MessageEntity[]) {

View File

@ -414,6 +414,10 @@ $bubble-margin: .25rem;
/* width: min-content; */
max-width: 100%;
}
.message {
max-width: 420px;
}
}
&.webpage {
@ -626,8 +630,8 @@ $bubble-margin: .25rem;
&:not(.sticker) {
.attachment {
max-width: unquote('min(480px, 100%)');
max-height: unquote('min(480px, 100%)');
max-width: unquote('min(420px, 100%)');
max-height: unquote('min(340px, 100%)');
width: max-content;
}
@ -725,8 +729,8 @@ $bubble-margin: .25rem;
overflow: hidden;
.preview {
max-height: unquote('min(400px, 100%)');
max-width: unquote('min(480px, 100%)');
max-width: unquote('min(420px, 100%)');
max-height: unquote('min(340px, 100%)');
border-radius: 4px;
margin-bottom: 3px;
overflow: hidden;