private void OnDiscordRequestRejected(object source, DiscordRPC.Message.JoinRequestMessage args) { GUI.Widgets.Notifications.DiscordNotify src = (GUI.Widgets.Notifications.DiscordNotify)source; src.OnRequestAccepted -= OnDiscordRequestAccepted; src.OnRequestRejected -= OnDiscordRequestRejected; Client.Respond(args, false); App.Current.Dispatcher.Invoke(new Action(() => { src.Close(); })); }
private void OnDiscordRequestAccepted(object source, DiscordRPC.Message.JoinRequestMessage args) { GUI.Widgets.Notifications.DiscordNotify src = (GUI.Widgets.Notifications.DiscordNotify)source; src.OnRequestAccepted -= OnDiscordRequestAccepted; src.OnRequestRejected -= OnDiscordRequestRejected; Client.Respond(args, true); src.Close(); }
private void Client_OnJoinRequested(object sender, DiscordRPC.Message.JoinRequestMessage args) { Debugger.Discord(GStrings.GetLocalizationByXPath("/Console/String[@ID='MESSAGE_DISCORD_JOIN_REQUEST']").Replace("{Username}", args.User.ToString())); App.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Render, new Action(() => { GUI.Widgets.Notifications.DiscordNotify DiscordNotification = new GUI.Widgets.Notifications.DiscordNotify(args); DiscordNotification.OnRequestAccepted += OnDiscordRequestAccepted; DiscordNotification.OnRequestRejected += OnDiscordRequestRejected; DiscordNotification.Show(); })); }