|
|
@ -2797,13 +2797,14 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) |
|
|
|
|
|
|
|
|
|
|
|
// Should be first because of updateMessageID
|
|
|
|
// Should be first because of updateMessageID
|
|
|
|
// console.log(dT(), 'applying', differenceResult.other_updates.length, 'other updates');
|
|
|
|
// console.log(dT(), 'applying', differenceResult.other_updates.length, 'other updates');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var channelsUpdates = []; |
|
|
|
angular.forEach(differenceResult.other_updates, function(update) { |
|
|
|
angular.forEach(differenceResult.other_updates, function(update) { |
|
|
|
if (update._ == 'updateChannelTooLong') { |
|
|
|
switch (update._) { |
|
|
|
var channelID = update.channel_id; |
|
|
|
case 'updateChannelTooLong': |
|
|
|
var channelState = channelStates[channelID]; |
|
|
|
case 'updateNewChannelMessage': |
|
|
|
if (channelState !== undefined && !channelState.syncLoading) { |
|
|
|
case 'updateEditChannelMessage': |
|
|
|
getChannelDifference(channelID); |
|
|
|
processUpdate(update); |
|
|
|
} |
|
|
|
|
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
saveUpdate(update); |
|
|
|
saveUpdate(update); |
|
|
@ -2927,6 +2928,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function processUpdate (update, options) { |
|
|
|
function processUpdate (update, options) { |
|
|
|
|
|
|
|
options = options || {}; |
|
|
|
var channelID = false; |
|
|
|
var channelID = false; |
|
|
|
switch (update._) { |
|
|
|
switch (update._) { |
|
|
|
case 'updateNewChannelMessage': |
|
|
|
case 'updateNewChannelMessage': |
|
|
@ -2935,6 +2937,12 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) |
|
|
|
case 'updateDeleteChannelMessages': |
|
|
|
case 'updateDeleteChannelMessages': |
|
|
|
channelID = update.channel_id; |
|
|
|
channelID = update.channel_id; |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
case 'updateChannelTooLong': |
|
|
|
|
|
|
|
channelID = update.channel_id; |
|
|
|
|
|
|
|
if (channelStates[channelID] === undefined) { |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
if (channelID && !AppChatsManager.hasChat(channelID)) { |
|
|
|
if (channelID && !AppChatsManager.hasChat(channelID)) { |
|
|
|
// console.log(dT(), 'skip update, missing channel', channelID, update);
|
|
|
|
// console.log(dT(), 'skip update, missing channel', channelID, update);
|
|
|
@ -2963,6 +2971,10 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (update._ == 'updateChannelTooLong' && |
|
|
|
|
|
|
|
!channelState.syncLoading) { |
|
|
|
|
|
|
|
getChannelDifference(channelID); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var popPts, popSeq; |
|
|
|
var popPts, popSeq; |
|
|
|
|
|
|
|
|
|
|
|