Skip to content
This repository has been archived by the owner on Feb 19, 2021. It is now read-only.

Commit

Permalink
Make discord presence optional
Browse files Browse the repository at this point in the history
  • Loading branch information
iCrawl committed Jul 15, 2018
1 parent 74cb661 commit 8a859a3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
10 changes: 7 additions & 3 deletions MainForm.cs
Expand Up @@ -208,7 +208,8 @@ public MainForm()
TaskbarManager.Instance.ThumbnailToolBars.AddButtons(this.Handle, button); TaskbarManager.Instance.ThumbnailToolBars.AddButtons(this.Handle, button);
} }


InitDiscordPresence(); if (Settings.Get<bool>(Setting.DiscordPresence))
InitDiscordPresence();


Connect(); Connect();


Expand Down Expand Up @@ -687,8 +688,11 @@ void ProcessSongInfo(SongInfoResponseData songInfo)
else else
picFavourite.Visible = false; picFavourite.Visible = false;


client.SetPresence(presence); if (Settings.Get<bool>(Setting.DiscordPresence))
client.Invoke(); {
client.SetPresence(presence);
client.Invoke();
}
} }


private async void Form1_FormClosing(object sender, FormClosingEventArgs e) => await Exit(); private async void Form1_FormClosing(object sender, FormClosingEventArgs e) => await Exit();
Expand Down
2 changes: 1 addition & 1 deletion Properties/AssemblyInfo.cs
Expand Up @@ -7,7 +7,7 @@
[assembly: AssemblyTitle("Listen.moe Client")] [assembly: AssemblyTitle("Listen.moe Client")]
[assembly: AssemblyProduct("Listen.moe Client")] [assembly: AssemblyProduct("Listen.moe Client")]
[assembly: AssemblyDescription("")] [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 // 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 // to COM components. If you need to access a type in this assembly from
Expand Down
4 changes: 3 additions & 1 deletion Settings.cs
Expand Up @@ -50,7 +50,8 @@ enum Setting
Volume, Volume,
OutputDeviceGuid, OutputDeviceGuid,
Token, Token,
Username Username,
DiscordPresence
} }


enum StreamType enum StreamType
Expand Down Expand Up @@ -202,6 +203,7 @@ private static void LoadDefaultSettings()
Set(Setting.CustomAccentColor, Color.FromArgb(255, 1, 91)); Set(Setting.CustomAccentColor, Color.FromArgb(255, 1, 91));


Set(Setting.StreamType, StreamType.Jpop); Set(Setting.StreamType, StreamType.Jpop);
Set(Setting.DiscordPresence, true);
} }


public static void LoadSettings() public static void LoadSettings()
Expand Down

0 comments on commit 8a859a3

Please sign in to comment.