Browse Source

Rollback offset applying

master
Eduard Kuzmenko 3 years ago
parent
commit
df3af46377
  1. 21
      src/lib/mtproto/networker.ts

21
src/lib/mtproto/networker.ts

@ -184,7 +184,7 @@ export default class MTPNetworker { @@ -184,7 +184,7 @@ export default class MTPNetworker {
//private debugRequests: Array<{before: Uint8Array, after: Uint8Array}> = [];
private delays: typeof delays[keyof typeof delays];
private getNewTimeOffset: boolean;
// private getNewTimeOffset: boolean;
constructor(
public dcId: number,
@ -891,7 +891,7 @@ export default class MTPNetworker { @@ -891,7 +891,7 @@ export default class MTPNetworker {
this.sendPingDelayDisconnect();
}
this.getNewTimeOffset = true;
// this.getNewTimeOffset = true;
}
/* if(this.onConnectionStatusChange) {
this.onConnectionStatusChange(this.isOnline);
@ -1672,11 +1672,11 @@ export default class MTPNetworker { @@ -1672,11 +1672,11 @@ export default class MTPNetworker {
this.pingDelayDisconnectDeferred.resolve('any message');
}
let changedTimeOffset: boolean;
if(this.getNewTimeOffset) {
changedTimeOffset = this.applyServerTime(messageId);
this.getNewTimeOffset = undefined;
}
// let changedTimeOffset: boolean;
// if(this.getNewTimeOffset) {
// changedTimeOffset = this.applyServerTime(messageId);
// this.getNewTimeOffset = undefined;
// }
switch(message._) {
case 'msg_container': {
@ -1719,10 +1719,11 @@ export default class MTPNetworker { @@ -1719,10 +1719,11 @@ export default class MTPNetworker {
case 32: // * msg_seqno too low
case 33: // * msg_seqno too high
case 64: { // * invalid container
if(changedTimeOffset === undefined) {
changedTimeOffset = this.applyServerTime(messageId);
}
// if(changedTimeOffset === undefined) {
// changedTimeOffset = this.applyServerTime(messageId);
// }
const changedTimeOffset = this.applyServerTime(messageId);
if(message.error_code === 17 || changedTimeOffset) {
this.log('Update session');
this.updateSession();

Loading…
Cancel
Save