|
|
@ -185,6 +185,15 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) |
|
|
|
return users[id] || {id: id, deleted: true, num: 1}; |
|
|
|
return users[id] || {id: id, deleted: true, num: 1}; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function getUserFull (id) { |
|
|
|
|
|
|
|
return MtpApiManager.invokeApi('users.getFullUser', { |
|
|
|
|
|
|
|
id: getUserInput(id) |
|
|
|
|
|
|
|
}).then(function (userFullResult) { |
|
|
|
|
|
|
|
saveApiUser(userFullResult.user, true); |
|
|
|
|
|
|
|
return userFullResult; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function getSelf() { |
|
|
|
function getSelf() { |
|
|
|
return getUser(myID); |
|
|
|
return getUser(myID); |
|
|
|
} |
|
|
|
} |
|
|
@ -451,6 +460,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) |
|
|
|
getUserString: getUserString, |
|
|
|
getUserString: getUserString, |
|
|
|
getUserSearchText: getUserSearchText, |
|
|
|
getUserSearchText: getUserSearchText, |
|
|
|
hasUser: hasUser, |
|
|
|
hasUser: hasUser, |
|
|
|
|
|
|
|
getUserFull: getUserFull, |
|
|
|
importContact: importContact, |
|
|
|
importContact: importContact, |
|
|
|
importContacts: importContacts, |
|
|
|
importContacts: importContacts, |
|
|
|
deleteContacts: deleteContacts, |
|
|
|
deleteContacts: deleteContacts, |
|
|
@ -823,6 +833,36 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils']) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.service('AppBotsManager', function (AppUsersManager, AppChatsManager) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return { |
|
|
|
|
|
|
|
getPeerBots: function (peerID) { |
|
|
|
|
|
|
|
var peerBots = []; |
|
|
|
|
|
|
|
if (peerID > 0) { |
|
|
|
|
|
|
|
var user = AppUsersManager.getUser(peerID); |
|
|
|
|
|
|
|
if (!user.pFlags.bot) { |
|
|
|
|
|
|
|
return $q.when(peerBots); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return AppUsersManager.getUserFull(peerID).then(function (userFull) { |
|
|
|
|
|
|
|
var botInfo = userFull.bot_info; |
|
|
|
|
|
|
|
if (botInfo && botInfo._ != 'botInfoEmpty') { |
|
|
|
|
|
|
|
peerBots.push(botInfo); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return peerBots; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return AppChatsManager.getFullChat(-peerID).then(function (chatFull) { |
|
|
|
|
|
|
|
angular.forEach(chatFull.bot_info, function (botInfo) { |
|
|
|
|
|
|
|
peerBots.push(botInfo); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
return peerBots; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
|
|
.service('AppMessagesManager', function ($q, $rootScope, $location, $filter, $timeout, $sce, ApiUpdatesManager, AppUsersManager, AppChatsManager, AppPeersManager, AppPhotosManager, AppVideoManager, AppDocsManager, AppAudioManager, AppWebPagesManager, MtpApiManager, MtpApiFileManager, RichTextProcessor, NotificationsManager, PeersSelectService, Storage, FileManager, TelegramMeWebService, ErrorService, StatusManager, _) { |
|
|
|
.service('AppMessagesManager', function ($q, $rootScope, $location, $filter, $timeout, $sce, ApiUpdatesManager, AppUsersManager, AppChatsManager, AppPeersManager, AppPhotosManager, AppVideoManager, AppDocsManager, AppAudioManager, AppWebPagesManager, MtpApiManager, MtpApiFileManager, RichTextProcessor, NotificationsManager, PeersSelectService, Storage, FileManager, TelegramMeWebService, ErrorService, StatusManager, _) { |
|
|
|
|
|
|
|
|
|
|
|
var messagesStorage = {}; |
|
|
|
var messagesStorage = {}; |
|
|
|