Browse Source

Fix sending message due to camelCase update name

master
Eduard Kuzmenko 4 years ago
parent
commit
f00be24bb2
  1. 4
      src/lib/appManagers/apiUpdatesManager.ts
  2. 20
      src/lib/appManagers/appMessagesManager.ts

4
src/lib/appManagers/apiUpdatesManager.ts

@ -239,7 +239,7 @@ export class ApiUpdatesManager { @@ -239,7 +239,7 @@ export class ApiUpdatesManager {
appUsersManager.saveApiUsers(differenceResult.users);
appChatsManager.saveApiChats(differenceResult.chats);
// Should be first because of updateMessageId
// Should be first because of updateMessageID
// this.log('applying', differenceResult.other_updates.length, 'other updates')
differenceResult.other_updates.forEach((update) => {
@ -329,7 +329,7 @@ export class ApiUpdatesManager { @@ -329,7 +329,7 @@ export class ApiUpdatesManager {
appUsersManager.saveApiUsers(differenceResult.users);
appChatsManager.saveApiChats(differenceResult.chats);
// Should be first because of updateMessageId
// Should be first because of updateMessageID
this.log('applying', differenceResult.other_updates.length, 'channel other updates');
differenceResult.other_updates.forEach((update) => {
this.saveUpdate(update);

20
src/lib/appManagers/appMessagesManager.ts

@ -513,7 +513,7 @@ export class AppMessagesManager { @@ -513,7 +513,7 @@ export class AppMessagesManager {
chats: [],
seq: 0,
updates: [{
_: 'updateMessageId',
_: 'updateMessageID',
random_id: randomIdS,
id: updates.id
}, {
@ -3012,7 +3012,7 @@ export class AppMessagesManager { @@ -3012,7 +3012,7 @@ export class AppMessagesManager {
case 'updateMessageID': {
const randomId = update.random_id;
const pendingData = this.pendingByRandomId[randomId];
//this.log('AMM updateMessageId:', update, pendingData);
//this.log('AMM updateMessageID:', update, pendingData);
if(pendingData) {
const peerId: number = pendingData[0];
const tempId = pendingData[1];
@ -3827,22 +3827,22 @@ export class AppMessagesManager { @@ -3827,22 +3827,22 @@ export class AppMessagesManager {
}
public finalizePendingMessage(randomId: number, finalMessage: any) {
var pendingData = this.pendingByRandomId[randomId];
const pendingData = this.pendingByRandomId[randomId];
// this.log('pdata', randomID, pendingData)
if(pendingData) {
var peerId = pendingData[0];
var tempId = pendingData[1];
var historyStorage = this.historiesStorage[peerId],
message;
const peerId = pendingData[0];
const tempId = pendingData[1];
const historyStorage = this.historiesStorage[peerId];
// this.log('pending', randomID, historyStorage.pending)
var pos = historyStorage.pending.indexOf(tempId);
const pos = historyStorage.pending.indexOf(tempId);
if(pos != -1) {
historyStorage.pending.splice(pos, 1);
}
if(message = this.messagesStorage[tempId]) {
const message = this.messagesStorage[tempId];
if(message) {
delete message.pending;
delete message.error;
delete message.random_id;
@ -3858,7 +3858,7 @@ export class AppMessagesManager { @@ -3858,7 +3858,7 @@ export class AppMessagesManager {
return message;
}
return false
return false;
}
public finalizePendingMessageCallbacks(tempId: number, mid: number) {

Loading…
Cancel
Save