mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 14:45:14 +00:00
Allow transfer of legacy groups.
This commit is contained in:
@@ -461,6 +461,9 @@ void AddSpecialBoxController::showAdmin(
|
||||
return;
|
||||
}
|
||||
_editBox = nullptr;
|
||||
if (_editParticipantBox) {
|
||||
_editParticipantBox->closeBox();
|
||||
}
|
||||
|
||||
const auto chat = _peer->asChat();
|
||||
const auto channel = _peer->asChannel();
|
||||
@@ -557,17 +560,21 @@ void AddSpecialBoxController::showAdmin(
|
||||
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 AddSpecialBoxController::editAdminDone(
|
||||
not_null<UserData*> user,
|
||||
const MTPChatAdminRights &rights) {
|
||||
_editBox = nullptr;
|
||||
if (_editParticipantBox) {
|
||||
_editParticipantBox->closeBox();
|
||||
}
|
||||
|
||||
const auto date = unixtime(); // Incorrect, but ignored.
|
||||
if (rights.c_chatAdminRights().vflags.v == 0) {
|
||||
@@ -598,6 +605,9 @@ void AddSpecialBoxController::showRestricted(
|
||||
return;
|
||||
}
|
||||
_editBox = nullptr;
|
||||
if (_editParticipantBox) {
|
||||
_editParticipantBox->closeBox();
|
||||
}
|
||||
|
||||
const auto chat = _peer->asChat();
|
||||
const auto channel = _peer->asChannel();
|
||||
@@ -646,18 +656,22 @@ void AddSpecialBoxController::showRestricted(
|
||||
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 AddSpecialBoxController::editRestrictedDone(
|
||||
not_null<UserData*> user,
|
||||
const MTPChatBannedRights &rights) {
|
||||
_editBox = nullptr;
|
||||
if (_editParticipantBox) {
|
||||
_editParticipantBox->closeBox();
|
||||
}
|
||||
|
||||
const auto date = unixtime(); // Incorrect, but ignored.
|
||||
if (rights.c_chatBannedRights().vflags.v == 0) {
|
||||
|
@@ -110,6 +110,7 @@ private:
|
||||
ParticipantsAdditionalData _additional;
|
||||
std::unique_ptr<ParticipantsOnlineSorter> _onlineSorter;
|
||||
BoxPointer _editBox;
|
||||
QPointer<BoxContent> _editParticipantBox;
|
||||
AdminDoneCallback _adminDoneCallback;
|
||||
BannedDoneCallback _bannedDoneCallback;
|
||||
|
||||
|
@@ -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) {
|
||||
|
@@ -237,6 +237,7 @@ private:
|
||||
std::unique_ptr<ParticipantsOnlineSorter> _onlineSorter;
|
||||
BoxPointer _editBox;
|
||||
BoxPointer _addBox;
|
||||
QPointer<BoxContent> _editParticipantBox;
|
||||
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user