Example #1
0
        private async void DismissExecute()
        {
            var rights = new TLChannelBannedRights();

            var response = await ProtoService.EditBannedAsync(_channel, _item.User.ToInputUser(), rights);

            if (response.IsSucceeded)
            {
                NavigationService.GoBack();
                NavigationService.Frame.ForwardStack.Clear();
            }
        }
        private async void ParticipantDismissExecute(TLChannelParticipantBase participant)
        {
            if (_item == null)
            {
                return;
            }

            if (participant.User == null)
            {
                return;
            }

            var rights = new TLChannelBannedRights();

            var response = await ProtoService.EditBannedAsync(_item, participant.User.ToInputUser(), rights);

            if (response.IsSucceeded)
            {
                Participants.Remove(participant);
            }
        }
Example #3
0
        private async void SendExecute()
        {
            var rights = new TLChannelBannedRights
            {
                IsViewMessages = _isViewMessages,
                IsSendMessages = _isViewMessages,
                IsSendMedia    = _isSendMedia,
                IsSendStickers = _isSendStickers,
                IsSendGifs     = _isSendGifs,
                IsSendGames    = _isSendGames,
                IsSendInline   = _isSendInline,
                IsEmbedLinks   = _isEmbedLinks
            };

            var response = await ProtoService.EditBannedAsync(_channel, _item.User.ToInputUser(), rights);

            if (response.IsSucceeded)
            {
                NavigationService.GoBack();
                NavigationService.Frame.ForwardStack.Clear();
            }
        }
        private async void ParticipantRemoveExecute(TLChannelParticipantBase participant)
        {
            if (_item == null)
            {
                return;
            }

            if (participant.User == null)
            {
                return;
            }

            var rights = new TLChannelBannedRights {
                IsEmbedLinks = true, IsSendGames = true, IsSendGifs = true, IsSendInline = true, IsSendMedia = true, IsSendMessages = true, IsSendStickers = true, IsViewMessages = true
            };

            var response = await ProtoService.EditBannedAsync(_item, participant.User.ToInputUser(), rights);

            if (response.IsSucceeded)
            {
                Participants.Remove(participant);
            }
        }