|
|
@ -1042,6 +1042,9 @@ export default class ChatBubbles { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const SINGLE_MEDIA_CLASSNAME = 'webpage'; |
|
|
|
|
|
|
|
const isSingleMedia = bubble.classList.contains(SINGLE_MEDIA_CLASSNAME); |
|
|
|
|
|
|
|
|
|
|
|
const f = documentDiv ? (media: any) => { |
|
|
|
const f = documentDiv ? (media: any) => { |
|
|
|
return AppMediaViewer.isMediaCompatibleForDocumentViewer(media); |
|
|
|
return AppMediaViewer.isMediaCompatibleForDocumentViewer(media); |
|
|
|
} : (media: any) => { |
|
|
|
} : (media: any) => { |
|
|
@ -1049,7 +1052,10 @@ export default class ChatBubbles { |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const targets: {element: HTMLElement, mid: number, peerId: PeerId}[] = []; |
|
|
|
const targets: {element: HTMLElement, mid: number, peerId: PeerId}[] = []; |
|
|
|
const ids = Object.keys(this.bubbles).map(k => +k).filter(id => { |
|
|
|
const ids = isSingleMedia ? [messageId] : Object.keys(this.bubbles).map(k => +k).filter(id => { |
|
|
|
|
|
|
|
/* if(isSingleMedia && !this.bubbles[id].classList.contains(SINGLE_MEDIA_CLASSNAME)) { |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} */ |
|
|
|
//if(!this.scrollable.visibleElements.find(e => e.element === this.bubbles[id])) return false;
|
|
|
|
//if(!this.scrollable.visibleElements.find(e => e.element === this.bubbles[id])) return false;
|
|
|
|
|
|
|
|
|
|
|
|
const message = this.chat.getMessage(id); |
|
|
|
const message = this.chat.getMessage(id); |
|
|
@ -1117,7 +1123,7 @@ export default class ChatBubbles { |
|
|
|
threadId: this.chat.threadId, |
|
|
|
threadId: this.chat.threadId, |
|
|
|
peerId: this.peerId, |
|
|
|
peerId: this.peerId, |
|
|
|
inputFilter: {_: documentDiv ? 'inputMessagesFilterDocument' : 'inputMessagesFilterPhotoVideo'}, |
|
|
|
inputFilter: {_: documentDiv ? 'inputMessagesFilterDocument' : 'inputMessagesFilterPhotoVideo'}, |
|
|
|
useSearch: this.chat.type !== 'scheduled', |
|
|
|
useSearch: this.chat.type !== 'scheduled' && !isSingleMedia, |
|
|
|
isScheduled: this.chat.type === 'scheduled' |
|
|
|
isScheduled: this.chat.type === 'scheduled' |
|
|
|
}) |
|
|
|
}) |
|
|
|
.openMedia(message, targets[idx].element, 0, true, targets.slice(0, idx), targets.slice(idx + 1)); |
|
|
|
.openMedia(message, targets[idx].element, 0, true, targets.slice(0, idx), targets.slice(idx + 1)); |
|
|
@ -2707,15 +2713,21 @@ export default class ChatBubbles { |
|
|
|
|
|
|
|
|
|
|
|
const doc = webpage.document as MyDocument; |
|
|
|
const doc = webpage.document as MyDocument; |
|
|
|
if(doc) { |
|
|
|
if(doc) { |
|
|
|
if(doc.type === 'gif' || doc.type === 'video') { |
|
|
|
if(doc.type === 'gif' || doc.type === 'video' || doc.type === 'round') { |
|
|
|
//if(doc.size <= 20e6) {
|
|
|
|
//if(doc.size <= 20e6) {
|
|
|
|
|
|
|
|
const mediaSize = doc.type === 'round' ? mediaSizes.active.round : mediaSizes.active.webpage; |
|
|
|
|
|
|
|
if(doc.type === 'round') { |
|
|
|
|
|
|
|
bubble.classList.add('round'); |
|
|
|
|
|
|
|
preview.classList.add('is-round'); |
|
|
|
|
|
|
|
} else { |
|
|
|
bubble.classList.add('video'); |
|
|
|
bubble.classList.add('video'); |
|
|
|
|
|
|
|
} |
|
|
|
wrapVideo({ |
|
|
|
wrapVideo({ |
|
|
|
doc, |
|
|
|
doc, |
|
|
|
container: preview, |
|
|
|
container: preview, |
|
|
|
message, |
|
|
|
message, |
|
|
|
boxWidth: mediaSizes.active.webpage.width, |
|
|
|
boxWidth: mediaSize.width, |
|
|
|
boxHeight: mediaSizes.active.webpage.height, |
|
|
|
boxHeight: mediaSize.height, |
|
|
|
lazyLoadQueue: this.lazyLoadQueue, |
|
|
|
lazyLoadQueue: this.lazyLoadQueue, |
|
|
|
middleware: this.getMiddleware(), |
|
|
|
middleware: this.getMiddleware(), |
|
|
|
isOut, |
|
|
|
isOut, |
|
|
|