private async void AddExecute() { var chat = _chat; if (chat == null) { return; } var selected = await SharePopup.PickChatAsync(Strings.Resources.SelectContact); var user = CacheService.GetUser(selected); if (user == null) { return; } var confirm = await MessagePopup.ShowAsync(string.Format(Strings.Resources.AddToTheGroup, user.GetFullName()), Strings.Resources.AppName, Strings.Resources.OK, Strings.Resources.Cancel); if (confirm != ContentDialogResult.Primary) { return; } var response = await ProtoService.SendAsync(new AddChatMember(chat.Id, user.Id, CacheService.Options.ForwardedMessageCountMax)); if (response is Error error) { } }
private async void ShareExecute() { if (ShareLink != null) { await SharePopup.GetForCurrentView().ShowAsync(ShareLink, ShareTitle); } }
private async void ShareExecute(ProxyViewModel proxy) { var response = await ProtoService.SendAsync(new GetProxyLink(proxy.Id)); if (response is Text text && Uri.TryCreate(text.TextValue, UriKind.Absolute, out Uri uri)) { await SharePopup.GetForCurrentView().ShowAsync(uri, Strings.Resources.Proxy); } }
private async void LogOld_Click(object sender, RoutedEventArgs e) { var log = await ApplicationData.Current.LocalFolder.TryGetItemAsync("tdlib_log.txt.old") as StorageFile; if (log != null) { await SharePopup.GetForCurrentView().ShowAsync(new InputMessageDocument(new InputFileLocal(log.Path), null, true, null)); } }
private async void MessagesForwardExecute() { var messages = SelectedItems.Where(x => x.CanBeForwarded).OrderBy(x => x.Id).ToList(); if (messages.Count > 0) { SelectionMode = ListViewSelectionMode.None; await SharePopup.GetForCurrentView().ShowAsync(messages); } }
private void View_NavigationStarting(WebView sender, WebViewNavigationStartingEventArgs args) { sender.AddWebAllowedObject("TelegramWebviewProxy", new TelegramGameProxy(withMyScore => { this.BeginOnUIThread(async() => { await SharePopup.GetForCurrentView().ShowAsync(_shareMessage, withMyScore); }); })); }
private async void AddExecute() { var chats = await SharePopup.PickChatsAsync(Strings.Resources.SelectContacts, Items.Select(x => x.Id).ToArray()); if (chats != null) { Items.ReplaceWith(chats); } SendCommand.RaiseCanExecuteChanged(); }
private async void ShareExecute() { var link = ShareLink; if (link == null) { return; } await SharePopup.GetForCurrentView().ShowAsync(link, ShareTitle); }
private async void BlockExecute() { var selected = await SharePopup.PickChatAsync(Strings.Resources.BlockUser); var user = CacheService.GetUser(selected); if (user == null) { return; } ProtoService.Send(new BlockUser(user.Id)); }
private async void BlockExecute() { var selected = await SharePopup.PickChatAsync(Strings.Resources.BlockUser); if (selected == null) { return; } if (selected.Type is ChatTypePrivate privata) { Items.Insert(0, new MessageSenderUser(privata.UserId)); ProtoService.Send(new ToggleMessageSenderIsBlocked(new MessageSenderUser(privata.UserId), true)); } else { Items.Insert(0, new MessageSenderChat(selected.Id)); ProtoService.Send(new ToggleMessageSenderIsBlocked(new MessageSenderChat(selected.Id), true)); } }
private async void MessageForwardExecute(Message message) { SelectionMode = ListViewSelectionMode.None; await SharePopup.GetForCurrentView().ShowAsync(message); }
private async void ThemeShareExecute(ThemeCustomInfo theme) { await SharePopup.GetForCurrentView().ShowAsync(new InputMessageDocument(new InputFileLocal(theme.Path), null, false, null)); }
private async void Share_Click(object sender, RoutedEventArgs e) { await SharePopup.GetForCurrentView().ShowAsync(_shareMessage); }
private async void Close_Clicked(object sender, EventArgs e) { await SharePopup.TranslateTo(0, 170, 250); }