private async void RevokeLinkExecute(TLChannel channel) { var dialog = new TLMessageDialog(); dialog.Title = Strings.Android.AppName; dialog.Message = string.Format(Strings.Android.RevokeLinkAlert, channel.Username, channel.DisplayName); dialog.PrimaryButtonText = Strings.Android.RevokeButton; dialog.SecondaryButtonText = Strings.Android.Cancel; var confirm = await dialog.ShowQueuedAsync(); if (confirm == ContentDialogResult.Primary) { var response = await ProtoService.UpdateUsernameAsync(channel.ToInputChannel(), string.Empty); if (response.IsSucceeded) { channel.HasUsername = false; channel.Username = null; channel.RaisePropertyChanged(() => channel.HasUsername); channel.RaisePropertyChanged(() => channel.Username); HasTooMuchUsernames = false; AdminedPublicChannels.Clear(); } } }
private async void RevokeLinkExecute(TLChannel channel) { var dialog = new TLMessageDialog(); dialog.Title = "Revoke link"; dialog.Message = string.Format("Are you sure you want to revoke the link t.me/{0}?\r\n\r\nThe channel \"{1}\" will become private.", channel.Username, channel.DisplayName); dialog.PrimaryButtonText = "Revoke"; dialog.SecondaryButtonText = "Cancel"; var confirm = await dialog.ShowAsync(); if (confirm == ContentDialogResult.Primary) { var response = await ProtoService.UpdateUsernameAsync(channel.ToInputChannel(), string.Empty); if (response.IsSucceeded) { channel.HasUsername = false; channel.Username = null; channel.RaisePropertyChanged(() => channel.HasUsername); channel.RaisePropertyChanged(() => channel.Username); HasTooMuchUsernames = false; AdminedPublicChannels.Clear(); } } }
private async void ChannelJoinExecute(TLChannel channel) { if (channel != null && channel.IsLeft) { var response = await ProtoService.JoinChannelAsync(channel); if (response.IsSucceeded) { channel.RaisePropertyChanged(() => channel.IsLeft); } } }