Improved send order
This commit is contained in:
parent
9a44924421
commit
697d7ec9b3
@ -913,9 +913,18 @@ angular.module('myApp.controllers', [])
|
||||
return all;
|
||||
});
|
||||
|
||||
var timeout = 0;
|
||||
do {
|
||||
AppMessagesManager.sendText($scope.curDialog.peerID, text.substr(0, 4096));
|
||||
|
||||
(function (peerID, curText, curTimeout) {
|
||||
setTimeout(function () {
|
||||
AppMessagesManager.sendText(peerID, curText);
|
||||
}, curTimeout)
|
||||
})($scope.curDialog.peerID, text.substr(0, 4096), timeout);
|
||||
|
||||
text = text.substr(4096);
|
||||
timeout += 100;
|
||||
|
||||
} while (text.length);
|
||||
|
||||
resetDraft();
|
||||
|
@ -2623,7 +2623,7 @@ factory('MtpApiManager', function (AppConfigManager, MtpAuthorizer, MtpNetworker
|
||||
|
||||
if (!options.noErrorBox) {
|
||||
error.input = method;
|
||||
error.stack = error.stack || stack;
|
||||
error.stack = error.stack || (new Error()).stack;
|
||||
setTimeout(function () {
|
||||
if (!error.handled) {
|
||||
ErrorService.show({error: error});
|
||||
|
@ -1191,9 +1191,6 @@ angular.module('myApp.services', [])
|
||||
message: text,
|
||||
random_id: randomID
|
||||
}, sentRequestOptions).then(function (result) {
|
||||
if (pendingAfterMsgs[peerID] === sentRequestOptions) {
|
||||
delete pendingAfterMsgs[peerID];
|
||||
}
|
||||
if (ApiUpdatesManager.saveSeq(result.seq)) {
|
||||
ApiUpdatesManager.saveUpdate({
|
||||
_: 'updateMessageID',
|
||||
@ -1211,6 +1208,10 @@ angular.module('myApp.services', [])
|
||||
}
|
||||
}, function (error) {
|
||||
toggleError(true);
|
||||
})['finally'](function () {
|
||||
if (pendingAfterMsgs[peerID] === sentRequestOptions) {
|
||||
delete pendingAfterMsgs[peerID];
|
||||
}
|
||||
});
|
||||
|
||||
pendingAfterMsgs[peerID] = sentRequestOptions;
|
||||
@ -1475,6 +1476,8 @@ angular.module('myApp.services', [])
|
||||
}
|
||||
|
||||
function forwardMessages (peerID, msgIDs) {
|
||||
msgIDs = $filter('orderBy')(msgIDs);
|
||||
|
||||
return MtpApiManager.invokeApi('messages.forwardMessages', {
|
||||
peer: AppPeersManager.getInputPeerByID(peerID),
|
||||
id: msgIDs
|
||||
|
Loading…
x
Reference in New Issue
Block a user