mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-01 07:05:13 +00:00
Show transfer ownership button for non-anonymous admins.
This commit is contained in:
@@ -308,7 +308,7 @@ void EditAdminBox::prepare() {
|
|||||||
}, lifetime());
|
}, lifetime());
|
||||||
|
|
||||||
if (canTransferOwnership()) {
|
if (canTransferOwnership()) {
|
||||||
const auto allFlags = FullAdminRights(isGroup);
|
const auto allFlags = AdminRightsForOwnershipTransfer(isGroup);
|
||||||
setupTransferButton(
|
setupTransferButton(
|
||||||
isGroup
|
isGroup
|
||||||
)->toggleOn(rpl::duplicate(
|
)->toggleOn(rpl::duplicate(
|
||||||
|
@@ -298,11 +298,13 @@ ChatRestrictions FixDependentRestrictions(ChatRestrictions restrictions) {
|
|||||||
return restrictions;
|
return restrictions;
|
||||||
}
|
}
|
||||||
|
|
||||||
ChatAdminRights FullAdminRights(bool isGroup) {
|
ChatAdminRights AdminRightsForOwnershipTransfer(bool isGroup) {
|
||||||
auto result = ChatAdminRights();
|
auto result = ChatAdminRights();
|
||||||
for (const auto &[flag, label] : AdminRightLabels(isGroup, true)) {
|
for (const auto &[flag, label] : AdminRightLabels(isGroup, true)) {
|
||||||
|
if (!(flag & ChatAdminRight::f_anonymous)) {
|
||||||
result |= flag;
|
result |= flag;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -71,4 +71,4 @@ EditFlagsControl<MTPDchatAdminRights::Flags> CreateEditAdminRights(
|
|||||||
|
|
||||||
ChatAdminRights DisabledByDefaultRestrictions(not_null<PeerData*> peer);
|
ChatAdminRights DisabledByDefaultRestrictions(not_null<PeerData*> peer);
|
||||||
ChatRestrictions FixDependentRestrictions(ChatRestrictions restrictions);
|
ChatRestrictions FixDependentRestrictions(ChatRestrictions restrictions);
|
||||||
ChatAdminRights FullAdminRights(bool isGroup);
|
ChatAdminRights AdminRightsForOwnershipTransfer(bool isGroup);
|
||||||
|
Reference in New Issue
Block a user