mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Replaced channel participant parsing with modern way in admin log.
This commit is contained in:
parent
975460d268
commit
686e9643ad
1 changed files with 11 additions and 11 deletions
|
@ -1550,20 +1550,20 @@ void InnerWidget::suggestRestrictParticipant(
|
||||||
_channel->inputChannel,
|
_channel->inputChannel,
|
||||||
user->input
|
user->input
|
||||||
)).done([=](const MTPchannels_ChannelParticipant &result) {
|
)).done([=](const MTPchannels_ChannelParticipant &result) {
|
||||||
Expects(result.type() == mtpc_channels_channelParticipant);
|
user->owner().processUsers(result.data().vusers());
|
||||||
|
|
||||||
auto &participant = result.c_channels_channelParticipant();
|
const auto participant = Api::ChatParticipant(
|
||||||
_channel->owner().processUsers(participant.vusers());
|
result.data().vparticipant(),
|
||||||
auto type = participant.vparticipant().type();
|
user);
|
||||||
if (type == mtpc_channelParticipantBanned) {
|
using Type = Api::ChatParticipant::Type;
|
||||||
auto &banned = participant.vparticipant().c_channelParticipantBanned();
|
if (participant.type() == Type::Creator
|
||||||
|
|| participant.type() == Type::Admin) {
|
||||||
|
editRestrictions(true, {});
|
||||||
|
} else if (participant.type() == Type::Restricted
|
||||||
|
|| participant.type() == Type::Banned) {
|
||||||
editRestrictions(
|
editRestrictions(
|
||||||
false,
|
false,
|
||||||
ChatRestrictionsInfo(banned.vbanned_rights()));
|
participant.restrictions());
|
||||||
} else {
|
|
||||||
auto hasAdminRights = (type == mtpc_channelParticipantAdmin)
|
|
||||||
|| (type == mtpc_channelParticipantCreator);
|
|
||||||
editRestrictions(hasAdminRights, ChatRestrictionsInfo());
|
|
||||||
}
|
}
|
||||||
}).fail([=] {
|
}).fail([=] {
|
||||||
editRestrictions(false, ChatRestrictionsInfo());
|
editRestrictions(false, ChatRestrictionsInfo());
|
||||||
|
|
Loading…
Add table
Reference in a new issue