Fixed user access hash
This commit is contained in:
parent
02516bbbec
commit
3238b93b67
@ -1493,7 +1493,7 @@ angular.module('myApp.controllers', ['myApp.i18n'])
|
|||||||
updateChannelActions();
|
updateChannelActions();
|
||||||
|
|
||||||
}, function () {
|
}, function () {
|
||||||
safeReplaceObject($scope.state, {error: true});
|
safeReplaceObject($scope.state, {error: true, loaded: true});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -14,6 +14,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
|
|||||||
.service('AppUsersManager', function ($rootScope, $modal, $modalStack, $filter, $q, qSync, MtpApiFileManager, MtpApiManager, RichTextProcessor, ErrorService, Storage, _) {
|
.service('AppUsersManager', function ($rootScope, $modal, $modalStack, $filter, $q, qSync, MtpApiFileManager, MtpApiManager, RichTextProcessor, ErrorService, Storage, _) {
|
||||||
var users = {},
|
var users = {},
|
||||||
usernames = {},
|
usernames = {},
|
||||||
|
userAccess = {},
|
||||||
cachedPhotoLocations = {},
|
cachedPhotoLocations = {},
|
||||||
contactsFillPromise,
|
contactsFillPromise,
|
||||||
contactsList,
|
contactsList,
|
||||||
@ -151,6 +152,10 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function saveUserAccess (id, accessHash) {
|
||||||
|
userAccess[id] = accessHash;
|
||||||
|
}
|
||||||
|
|
||||||
function getUserStatusForSort(status) {
|
function getUserStatusForSort(status) {
|
||||||
if (status) {
|
if (status) {
|
||||||
var expires = status.expires || status.was_online;
|
var expires = status.expires || status.was_online;
|
||||||
@ -175,7 +180,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
|
|||||||
if (angular.isObject(id)) {
|
if (angular.isObject(id)) {
|
||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
return users[id] || {id: id, deleted: true, num: 1};
|
return users[id] || {id: id, deleted: true, num: 1, access_hash: userAccess[id]};
|
||||||
}
|
}
|
||||||
|
|
||||||
function getSelf() {
|
function getSelf() {
|
||||||
@ -464,6 +469,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
|
|||||||
getContacts: getContacts,
|
getContacts: getContacts,
|
||||||
saveApiUsers: saveApiUsers,
|
saveApiUsers: saveApiUsers,
|
||||||
saveApiUser: saveApiUser,
|
saveApiUser: saveApiUser,
|
||||||
|
saveUserAccess: saveUserAccess,
|
||||||
getUser: getUser,
|
getUser: getUser,
|
||||||
getSelf: getSelf,
|
getSelf: getSelf,
|
||||||
getUserInput: getUserInput,
|
getUserInput: getUserInput,
|
||||||
@ -834,6 +840,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
|
|||||||
peerParams = peerString.substr(1).split('_');
|
peerParams = peerString.substr(1).split('_');
|
||||||
|
|
||||||
if (firstChar == 'u') {
|
if (firstChar == 'u') {
|
||||||
|
AppUsersManager.saveUserAccess(peerParams[0], peerParams[1]);
|
||||||
return {
|
return {
|
||||||
_: 'inputPeerUser',
|
_: 'inputPeerUser',
|
||||||
user_id: peerParams[0],
|
user_id: peerParams[0],
|
||||||
|
Loading…
Reference in New Issue
Block a user