2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

adding / removing lastParticipants / lastAdmins in supergroups on adding / removing users / admins

This commit is contained in:
John Preston
2016-03-14 09:10:24 +03:00
parent cab19a141f
commit b38163b026
3 changed files with 35 additions and 4 deletions

View File

@@ -257,6 +257,18 @@ void ContactsInner::addAdminDone(const MTPUpdates &result, mtpRequestId req) {
if (req != _addAdminRequestId) return;
_addAdminRequestId = 0;
if (_addAdmin && _channel && _channel->isMegagroup()) {
if (_channel->mgInfo->lastParticipants.indexOf(_addAdmin) < 0) {
_channel->mgInfo->lastParticipants.push_front(_addAdmin);
}
_channel->mgInfo->lastAdmins.insert(_addAdmin);
if (_addAdmin->botInfo) {
_channel->mgInfo->bots.insert(_addAdmin);
if (_channel->mgInfo->botStatus != 0 && _channel->mgInfo->botStatus < 2) {
_channel->mgInfo->botStatus = 2;
}
}
}
if (_addAdminBox) _addAdminBox->onClose();
emit adminAdded();
}