2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-01 15:15:13 +00:00

Add EditPeerPermissionsBox.

This commit is contained in:
John Preston
2019-01-08 14:54:18 +04:00
parent f4d52b82b4
commit eff90395b6
20 changed files with 469 additions and 142 deletions

View File

@@ -4226,7 +4226,28 @@ void MainWidget::feedUpdate(const MTPUpdate &update) {
App::feedParticipantDelete(update.c_updateChatParticipantDelete());
} break;
// #TODO groups new update
case mtpc_updateChatDefaultBannedRights: {
const auto &data = update.c_updateChatDefaultBannedRights();
const auto peerId = peerFromMTP(data.vpeer);
if (const auto peer = Auth().data().peerLoaded(peerId)) {
if (const auto chat = peer->asChat()) {
if (data.vversion.v == chat->version + 1) {
chat->setDefaultRestrictions(
data.vdefault_banned_rights);
} else {
chat->version = data.vversion.v;
chat->invalidateParticipants();
Auth().api().requestPeer(chat);
}
} else if (const auto channel = peer->asChannel()) {
channel->setDefaultRestrictions(
data.vdefault_banned_rights);
} else {
LOG(("API Error: "
"User received in updateChatDefaultBannedRights."));
}
}
} break;
case mtpc_updateChatParticipantAdmin: {
App::feedParticipantAdmin(update.c_updateChatParticipantAdmin());