2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Allow transfer of legacy groups.

This commit is contained in:
John Preston
2019-06-14 16:56:06 +02:00
parent b9d1d8519c
commit 3c11eda611
4 changed files with 36 additions and 12 deletions

View File

@@ -1422,18 +1422,22 @@ void ParticipantsBoxController::showAdmin(not_null<UserData*> user) {
editAdminDone(user, newRights);
});
const auto fail = crl::guard(this, [=] {
_editBox = nullptr;
if (_editParticipantBox) {
_editParticipantBox->closeBox();
}
});
box->setSaveCallback(SaveAdminCallback(_peer, user, done, fail));
}
_editBox = Ui::show(std::move(box), LayerOption::KeepOther);
_editParticipantBox = Ui::show(std::move(box), LayerOption::KeepOther);
}
void ParticipantsBoxController::editAdminDone(
not_null<UserData*> user,
const MTPChatAdminRights &rights) {
_addBox = nullptr;
_editBox = nullptr;
if (_editParticipantBox) {
_editParticipantBox->closeBox();
}
const auto date = unixtime(); // Incorrect, but ignored.
if (rights.c_chatAdminRights().vflags.v == 0) {
@@ -1485,19 +1489,23 @@ void ParticipantsBoxController::showRestricted(not_null<UserData*> user) {
editRestrictedDone(user, newRights);
});
const auto fail = crl::guard(this, [=] {
_editBox = nullptr;
if (_editParticipantBox) {
_editParticipantBox->closeBox();
}
});
box->setSaveCallback(
SaveRestrictedCallback(_peer, user, done, fail));
}
_editBox = Ui::show(std::move(box), LayerOption::KeepOther);
_editParticipantBox = Ui::show(std::move(box), LayerOption::KeepOther);
}
void ParticipantsBoxController::editRestrictedDone(
not_null<UserData*> user,
const MTPChatBannedRights &rights) {
_addBox = nullptr;
_editBox = nullptr;
if (_editParticipantBox) {
_editParticipantBox->closeBox();
}
const auto date = unixtime(); // Incorrect, but ignored.
if (rights.c_chatBannedRights().vflags.v == 0) {