Browse Source

Fix displaying private search results

Fix autodownloading files
Fix reporting messages
master
Eduard Kuzmenko 2 years ago
parent
commit
2aa743b8cc
  1. 2
      src/components/wrappers/document.ts
  2. 4
      src/lib/appManagers/appDialogsManager.ts
  3. 4
      src/lib/appManagers/appDownloadManager.ts
  4. 4
      src/lib/appManagers/appStickersManager.ts
  5. 2
      src/lib/mtproto/apiFileManager.ts

2
src/components/wrappers/document.ts

@ -121,7 +121,7 @@ export default async function wrapDocument({message, withTime, fontWeight, voice
size: choosePhotoSize(doc, 54, 54, true), size: choosePhotoSize(doc, 54, 54, true),
managers managers
}); });
console.log('was wrapping photo', performance.now() - perf); // console.log('was wrapping photo', performance.now() - perf);
icoDiv.style.width = icoDiv.style.height = ''; icoDiv.style.width = icoDiv.style.height = '';
if(wrapped.images.thumb) imgs.push(wrapped.images.thumb); if(wrapped.images.thumb) imgs.push(wrapped.images.thumb);
if(wrapped.images.full) imgs.push(wrapped.images.full); if(wrapped.images.full) imgs.push(wrapped.images.full);

4
src/lib/appManagers/appDialogsManager.ts

@ -1965,7 +1965,7 @@ export class AppDialogsManager {
peerId, peerId,
}); });
// this.setLastMessage(ret.dialog, message, ret.dom, query); this.setLastMessage({_: 'dialog', peerId} as any, message, ret.dom, query);
if(message.peerId !== peerId) { if(message.peerId !== peerId) {
ret.dom.listEl.dataset.peerId = '' + message.peerId; ret.dom.listEl.dataset.peerId = '' + message.peerId;
@ -2060,7 +2060,7 @@ export class AppDialogsManager {
const li = document.createElement(DIALOG_LIST_ELEMENT_TAG); const li = document.createElement(DIALOG_LIST_ELEMENT_TAG);
li.classList.add('chatlist-chat'); li.classList.add('chatlist-chat');
(li as HTMLAnchorElement).href = '#' + peerId; if(!autonomous) (li as HTMLAnchorElement).href = '#' + peerId;
if(rippleEnabled) { if(rippleEnabled) {
ripple(li); ripple(li);
} }

4
src/lib/appManagers/appDownloadManager.ts

@ -159,6 +159,10 @@ export class AppDownloadManager {
public downloadMedia(options: DownloadMediaOptions, type: DownloadType = 'blob'): DownloadBlob { public downloadMedia(options: DownloadMediaOptions, type: DownloadType = 'blob'): DownloadBlob {
const {downloadOptions, fileName} = getDownloadMediaDetails(options); const {downloadOptions, fileName} = getDownloadMediaDetails(options);
if(fileName === 'document_5307720352468571676') {
debugger;
}
return this.d(fileName, () => { return this.d(fileName, () => {
const cb = type === 'url' ? this.managers.apiFileManager.downloadMediaURL : (type === 'void' ? this.managers.apiFileManager.downloadMediaVoid : this.managers.apiFileManager.downloadMedia); const cb = type === 'url' ? this.managers.apiFileManager.downloadMediaURL : (type === 'void' ? this.managers.apiFileManager.downloadMediaVoid : this.managers.apiFileManager.downloadMedia);
return cb(options); return cb(options);

4
src/lib/appManagers/appStickersManager.ts

@ -271,8 +271,8 @@ export class AppStickersManager extends AppManager {
]).then(([doc, a]) => { ]).then(([doc, a]) => {
return { return {
doc: doc, doc: doc,
animation: a.doc, animation: a?.doc,
sound: a.sound sound: a?.sound
}; };
}); });
} }

2
src/lib/mtproto/apiFileManager.ts

@ -613,7 +613,7 @@ export class ApiFileManager extends AppManager {
if(!promise) { if(!promise) {
promise = this.download(downloadOptions); promise = this.download(downloadOptions);
if(isDocument) { if(isDocument && !thumb) {
this.rootScope.dispatchEvent('document_downloading', media.id); this.rootScope.dispatchEvent('document_downloading', media.id);
promise.catch(noop).finally(() => { promise.catch(noop).finally(() => {
this.rootScope.dispatchEvent('document_downloaded', media.id); this.rootScope.dispatchEvent('document_downloaded', media.id);

Loading…
Cancel
Save