From 8a859a31f114d41a029e811a6b78f57141723b9e Mon Sep 17 00:00:00 2001 From: Crawl Date: Sun, 15 Jul 2018 11:20:40 +0200 Subject: [PATCH] Make discord presence optional --- MainForm.cs | 10 +++++++--- Properties/AssemblyInfo.cs | 2 +- Settings.cs | 4 +++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/MainForm.cs b/MainForm.cs index 50c46f3..c08bb73 100644 --- a/MainForm.cs +++ b/MainForm.cs @@ -208,7 +208,8 @@ public MainForm() TaskbarManager.Instance.ThumbnailToolBars.AddButtons(this.Handle, button); } - InitDiscordPresence(); + if (Settings.Get(Setting.DiscordPresence)) + InitDiscordPresence(); Connect(); @@ -687,8 +688,11 @@ void ProcessSongInfo(SongInfoResponseData songInfo) else picFavourite.Visible = false; - client.SetPresence(presence); - client.Invoke(); + if (Settings.Get(Setting.DiscordPresence)) + { + client.SetPresence(presence); + client.Invoke(); + } } private async void Form1_FormClosing(object sender, FormClosingEventArgs e) => await Exit(); diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 6ae6eb0..780d089 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -7,7 +7,7 @@ [assembly: AssemblyTitle("Listen.moe Client")] [assembly: AssemblyProduct("Listen.moe Client")] [assembly: AssemblyDescription("")] -[assembly: AssemblyCopyright("Copyright 2017 Listen.moe. All rights reserved.")] +[assembly: AssemblyCopyright("Copyright 2017-2018 Listen.moe. All rights reserved.")] // Setting ComVisible to false makes the types in this assembly not visible // to COM components. If you need to access a type in this assembly from diff --git a/Settings.cs b/Settings.cs index 976cc5e..c3840dc 100644 --- a/Settings.cs +++ b/Settings.cs @@ -50,7 +50,8 @@ enum Setting Volume, OutputDeviceGuid, Token, - Username + Username, + DiscordPresence } enum StreamType @@ -202,6 +203,7 @@ private static void LoadDefaultSettings() Set(Setting.CustomAccentColor, Color.FromArgb(255, 1, 91)); Set(Setting.StreamType, StreamType.Jpop); + Set(Setting.DiscordPresence, true); } public static void LoadSettings()