Added required changes.

This commit is contained in:
David Paiva 2021-11-20 14:11:02 +00:00
parent e65826979e
commit 5276300c08
1 changed files with 5 additions and 9 deletions

View File

@ -97,7 +97,7 @@ private void updateStatus()
presence.State = truncate(activity.Value.Status);
presence.Details = truncate(getDetails(activity.Value));
if (getOnlineID(activity.Value) != string.Empty)
if (getOnlineID(activity.Value) != null)
{
presence.Buttons = new Button[]
{
@ -167,18 +167,14 @@ private string getDetails(UserActivity activity)
return string.Empty;
}
private string getOnlineID(UserActivity activity)
private int? getOnlineID(UserActivity activity)
{
switch (activity)
if (activity is UserActivity.InGame game && game.BeatmapInfo.OnlineID > 0)
{
case UserActivity.InGame game:
if (!(game.BeatmapInfo.OnlineID < 1))
return game.BeatmapInfo.OnlineID.ToString();
return string.Empty;
return game.BeatmapInfo.OnlineID;
}
return string.Empty;
return null;
}
protected override void Dispose(bool isDisposing)