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

4
src/lib/appManagers/appDialogsManager.ts

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

4
src/lib/appManagers/appDownloadManager.ts

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

4
src/lib/appManagers/appStickersManager.ts

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

2
src/lib/mtproto/apiFileManager.ts

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

Loading…
Cancel
Save