Exemplo n.º 1
0
        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
                    });
                }
            }
        }
Exemplo n.º 2
0
        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();
        }
Exemplo n.º 3
0
        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
                    });
                }
            }
        }
Exemplo n.º 4
0
        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
                    });
                }
            }
        }