Bugfixes
This commit is contained in:
parent
629d49b445
commit
d946e85a47
@ -871,10 +871,10 @@ angular.module('myApp.controllers', [])
|
|||||||
});
|
});
|
||||||
|
|
||||||
ContactsSelectService.selectContacts({disabled: disabled}).then(function (userIDs) {
|
ContactsSelectService.selectContacts({disabled: disabled}).then(function (userIDs) {
|
||||||
angular.forEach(userIDs, function () {
|
angular.forEach(userIDs, function (userID) {
|
||||||
MtpApiManager.invokeApi('messages.addChatUser', {
|
MtpApiManager.invokeApi('messages.addChatUser', {
|
||||||
chat_id: $scope.chatID,
|
chat_id: $scope.chatID,
|
||||||
user_id: {_: 'inputUserContact', user_id: userIDs},
|
user_id: {_: 'inputUserContact', user_id: userID},
|
||||||
fwd_limit: 100
|
fwd_limit: 100
|
||||||
}).then(function (addResult) {
|
}).then(function (addResult) {
|
||||||
AppUsersManager.saveApiUsers(addResult.users);
|
AppUsersManager.saveApiUsers(addResult.users);
|
||||||
@ -1049,7 +1049,6 @@ angular.module('myApp.controllers', [])
|
|||||||
$scope.disabledContacts[$scope.disabled[i]] = true;
|
$scope.disabledContacts[$scope.disabled[i]] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console.log($scope.disabled, $scope.disabledContacts);
|
|
||||||
|
|
||||||
if ($scope.selected) {
|
if ($scope.selected) {
|
||||||
for (var i = 0; i < $scope.selected.length; i++) {
|
for (var i = 0; i < $scope.selected.length; i++) {
|
||||||
@ -1111,7 +1110,7 @@ angular.module('myApp.controllers', [])
|
|||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
.controller('ChatCreateModalController', function ($scope, $modalInstance, $rootScope, MtpApiManager, AppChatsManager) {
|
.controller('ChatCreateModalController', function ($scope, $modalInstance, $rootScope, MtpApiManager, AppUsersManager, AppChatsManager, ApiUpdatesManager) {
|
||||||
$scope.group = {name: ''};
|
$scope.group = {name: ''};
|
||||||
|
|
||||||
$scope.createGroup = function () {
|
$scope.createGroup = function () {
|
||||||
@ -1126,8 +1125,6 @@ angular.module('myApp.controllers', [])
|
|||||||
title: $scope.group.name,
|
title: $scope.group.name,
|
||||||
users: inputUsers
|
users: inputUsers
|
||||||
}).then(function (createdResult) {
|
}).then(function (createdResult) {
|
||||||
$modalInstance.close();
|
|
||||||
|
|
||||||
AppUsersManager.saveApiUsers(createdResult.users);
|
AppUsersManager.saveApiUsers(createdResult.users);
|
||||||
AppChatsManager.saveApiChats(createdResult.chats);
|
AppChatsManager.saveApiChats(createdResult.chats);
|
||||||
|
|
||||||
@ -1139,7 +1136,7 @@ angular.module('myApp.controllers', [])
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
var peerString = AppChatsManager.getChatString(message.to_id.chat_id);
|
var peerString = AppChatsManager.getChatString(createdResult.message.to_id.chat_id);
|
||||||
$rootScope.$broadcast('history_focus', {peerString: peerString});
|
$rootScope.$broadcast('history_focus', {peerString: peerString});
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -1507,6 +1507,8 @@ factory('MtpNetworkerFactory', function (MtpDcConfigurator, MtpMessageIdGenerato
|
|||||||
offline;
|
offline;
|
||||||
|
|
||||||
$rootScope.offline = true;
|
$rootScope.offline = true;
|
||||||
|
$rootScope.offlineConnecting = true;
|
||||||
|
|
||||||
$rootScope.retryOnline = function () {
|
$rootScope.retryOnline = function () {
|
||||||
$(document.body).trigger('online');
|
$(document.body).trigger('online');
|
||||||
}
|
}
|
||||||
@ -1802,6 +1804,7 @@ factory('MtpNetworkerFactory', function (MtpDcConfigurator, MtpMessageIdGenerato
|
|||||||
|
|
||||||
this.offline = enabled;
|
this.offline = enabled;
|
||||||
$rootScope.offline = enabled;
|
$rootScope.offline = enabled;
|
||||||
|
$rootScope.offlineConnecting = false;
|
||||||
|
|
||||||
if (this.offline) {
|
if (this.offline) {
|
||||||
$timeout.cancel(this.nextReqPromise);
|
$timeout.cancel(this.nextReqPromise);
|
||||||
|
@ -372,7 +372,7 @@ angular.module('myApp.services', [])
|
|||||||
participant.user = AppUsersManager.getUser(participant.user_id);
|
participant.user = AppUsersManager.getUser(participant.user_id);
|
||||||
participant.userPhoto = AppUsersManager.getUserPhoto(participant.user_id, 'User');
|
participant.userPhoto = AppUsersManager.getUserPhoto(participant.user_id, 'User');
|
||||||
participant.inviter = AppUsersManager.getUser(participant.inviter_id);
|
participant.inviter = AppUsersManager.getUser(participant.inviter_id);
|
||||||
participant.canKick = myID == chat.admin_id || myID == participant.inviter_id;
|
participant.canKick = myID != participant.user_id && (myID == chat.admin_id || myID == participant.inviter_id);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -2376,13 +2376,15 @@ angular.module('myApp.services', [])
|
|||||||
if (!started) {
|
if (!started) {
|
||||||
started = true;
|
started = true;
|
||||||
$rootScope.$watch('idle.isIDLE', checkIDLE);
|
$rootScope.$watch('idle.isIDLE', checkIDLE);
|
||||||
|
$rootScope.$watch('offline', checkIDLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function sendUpdateStatusReq(offline) {
|
function sendUpdateStatusReq(offline) {
|
||||||
var date = tsNow();
|
var date = tsNow();
|
||||||
if (offline && !lastOnlineUpdated ||
|
if (offline && !lastOnlineUpdated ||
|
||||||
!offline && (date - lastOnlineUpdated) < 50000) {
|
!offline && (date - lastOnlineUpdated) < 50000 ||
|
||||||
|
$rootScope.offline) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
lastOnlineUpdated = offline ? 0 : date;
|
lastOnlineUpdated = offline ? 0 : date;
|
||||||
|
@ -53,7 +53,7 @@
|
|||||||
<div class="chat_modal_members_list">
|
<div class="chat_modal_members_list">
|
||||||
|
|
||||||
<div class="chat_modal_participant_wrap clearfix" ng-repeat="participant in chatFull.participants.participants | orderBy:'-user.sortStatus'">
|
<div class="chat_modal_participant_wrap clearfix" ng-repeat="participant in chatFull.participants.participants | orderBy:'-user.sortStatus'">
|
||||||
<a ng-if="participant.canKick" ng-click="kickFromGroup(participant.userID)" class="chat_modal_participant_kick pull-right">Kick</a>
|
<a ng-if="participant.canKick" ng-click="kickFromGroup(participant.user_id)" class="chat_modal_participant_kick pull-right">Kick</a>
|
||||||
<a ng-click="openUser(participant.user_id)" class="chat_modal_participant_photo pull-left">
|
<a ng-click="openUser(participant.user_id)" class="chat_modal_participant_photo pull-left">
|
||||||
<img
|
<img
|
||||||
class="chat_modal_participant_photo"
|
class="chat_modal_participant_photo"
|
||||||
|
Loading…
Reference in New Issue
Block a user