|
|
@ -3417,22 +3417,21 @@ angular.module('myApp.controllers', ['myApp.i18n']) |
|
|
|
return MtpApiManager.invokeApi('messages.createChat', { |
|
|
|
return MtpApiManager.invokeApi('messages.createChat', { |
|
|
|
title: $scope.group.name, |
|
|
|
title: $scope.group.name, |
|
|
|
users: inputUsers |
|
|
|
users: inputUsers |
|
|
|
}).then(function (createdResult) { |
|
|
|
}).then(function (updates) { |
|
|
|
ApiUpdatesManager.processUpdateMessage({ |
|
|
|
ApiUpdatesManager.processUpdateMessage(updates); |
|
|
|
_: 'updates', |
|
|
|
|
|
|
|
users: createdResult.users, |
|
|
|
if (updates.updates && updates.updates.length) { |
|
|
|
chats: createdResult.chats, |
|
|
|
for (var i = 0, len = updates.updates.length, update; i < len; i++) { |
|
|
|
seq: 0, |
|
|
|
update = updates.updates[i]; |
|
|
|
updates: [{ |
|
|
|
if (update._ == 'updateNewMessage') { |
|
|
|
_: 'updateNewMessage', |
|
|
|
$rootScope.$broadcast('history_focus', {peerString: AppChatsManager.getChatString(update.message.to_id.chat_id) |
|
|
|
message: createdResult.message, |
|
|
|
}); |
|
|
|
pts: createdResult.pts, |
|
|
|
break; |
|
|
|
pts_count: createdResult.pts_count |
|
|
|
} |
|
|
|
}] |
|
|
|
} |
|
|
|
}); |
|
|
|
$modalInstance.close(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var peerString = AppChatsManager.getChatString(createdResult.message.to_id.chat_id); |
|
|
|
|
|
|
|
$rootScope.$broadcast('history_focus', {peerString: peerString}); |
|
|
|
|
|
|
|
})['finally'](function () { |
|
|
|
})['finally'](function () { |
|
|
|
delete $scope.group.creating; |
|
|
|
delete $scope.group.creating; |
|
|
|
}); |
|
|
|
}); |
|
|
|