Search: fix unknown dialogs
This commit is contained in:
parent
70324b96ad
commit
3e8468735a
@ -312,7 +312,11 @@ export class AppDialogsManager {
|
||||
return this.doms[peerID] as DialogDom;
|
||||
}
|
||||
|
||||
public addDialog(dialog: any, container?: HTMLUListElement, drawStatus = true) {
|
||||
public addDialog(dialog: {
|
||||
peerID: number,
|
||||
pFlags: any,
|
||||
peer: any
|
||||
}, container?: HTMLUListElement, drawStatus = true) {
|
||||
let peerID: number = dialog.peerID;
|
||||
|
||||
if((peerID in this.doms) && !container) return;
|
||||
|
@ -744,7 +744,7 @@ export class AppImManager {
|
||||
let status = message.pFlags.unread ? 'sent' : 'read';
|
||||
bubble.classList.add(status);
|
||||
} else {
|
||||
this.log('not our message', message, message.pFlags.unread);
|
||||
//this.log('not our message', message, message.pFlags.unread);
|
||||
if(message.pFlags.unread) this.unreaded.push(message.mid);
|
||||
}
|
||||
|
||||
|
@ -1845,7 +1845,7 @@ export class AppMessagesManager {
|
||||
if(error.code == 400) {
|
||||
error.handled = true;
|
||||
}
|
||||
|
||||
|
||||
return Promise.reject(error);
|
||||
});
|
||||
}
|
||||
|
@ -90,6 +90,7 @@ class AppSidebarLeft {
|
||||
this.toolsBtn.classList.add('tgico-menu');
|
||||
this.toolsBtn.classList.remove('tgico-back');
|
||||
this.searchContainer.classList.remove('active');
|
||||
this.peerID = 0;
|
||||
}
|
||||
});
|
||||
|
||||
@ -133,7 +134,7 @@ class AppSidebarLeft {
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
let maxID = 0;//appMessagesIDsManager.getMessageIDInfo(this.minMsgID)[0] - 1;
|
||||
let maxID = appMessagesIDsManager.getMessageIDInfo(this.minMsgID)[0];
|
||||
|
||||
return this.searchPromise = appMessagesManager.getSearch(this.peerID, query, null, maxID, 20, this.offsetRate).then(res => {
|
||||
this.searchPromise = null;
|
||||
@ -155,8 +156,13 @@ class AppSidebarLeft {
|
||||
let originalDialog = appMessagesManager.getDialogByPeerID(message.peerID)[0];
|
||||
|
||||
if(!originalDialog) {
|
||||
this.log.warn('no original dialog by message:', msgID);
|
||||
return;
|
||||
this.log('no original dialog by message:', message);
|
||||
|
||||
originalDialog = {
|
||||
peerID: message.peerID,
|
||||
pFlags: {},
|
||||
peer: message.to_id
|
||||
};
|
||||
}
|
||||
|
||||
let {dialog, dom} = appDialogsManager.addDialog(originalDialog, this.searchMessagesList, false);
|
||||
|
@ -1070,7 +1070,7 @@ $width: 100px;
|
||||
height: 100%;
|
||||
position: fixed!important;
|
||||
background-color: rgba(0, 0, 0, .2);
|
||||
z-index: 3;
|
||||
z-index: 4;
|
||||
display: none;
|
||||
|
||||
&.active {
|
||||
|
Loading…
x
Reference in New Issue
Block a user