private async void BlockExecute() { if (Item is TLUser user) { var confirm = await TLMessageDialog.ShowAsync(Strings.Android.AreYouSureBlockContact, Strings.Android.AppName, Strings.Android.OK, Strings.Android.Cancel); if (confirm != ContentDialogResult.Primary) { return; } var result = await ProtoService.BlockAsync(user.ToInputUser()); if (result.IsSucceeded && result.Result) { if (Full is TLUserFull full) { full.IsBlocked = true; full.RaisePropertyChanged(() => full.IsBlocked); } CacheService.Commit(); Aggregator.Publish(new TLUpdateUserBlocked { UserId = user.Id, Blocked = true }); } } }
protected override async void SendExecute() { foreach (var item in SelectedItems) { if (item.HasAccessHash) { var result = await ProtoService.BlockAsync(item.ToInputUser()); if (result.IsSucceeded) { //Aggregator.Publish(new TLUpdateUserBlocked { UserId = item.Id, Blocked = true }); } } } NavigationService.GoBack(); }
private async void BlockExecute() { var user = Item as TLUser; if (user != null) { var result = await ProtoService.BlockAsync(user.ToInputUser()); if (result.IsSucceeded && result.Result) { CacheService.Commit(); Aggregator.Publish(new TLUpdateUserBlocked { UserId = user.Id, Blocked = true }); } } }
private async void BlockExecute() { if (Item is TLUser user) { var confirm = await TLMessageDialog.ShowAsync("Are you sure you want to block this contact?", "Telegram", "OK", "Cancel"); if (confirm != ContentDialogResult.Primary) { return; } var result = await ProtoService.BlockAsync(user.ToInputUser()); if (result.IsSucceeded && result.Result) { CacheService.Commit(); Aggregator.Publish(new TLUpdateUserBlocked { UserId = user.Id, Blocked = true }); } } }