Do not reset current activity on discord party update

Instead of setting activity to in_game, in_menu just send again current
discord activity.

Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
Tomas Slusny
2019-02-01 22:01:41 +01:00
parent 29fcc2747f
commit 8ff8617755
2 changed files with 14 additions and 3 deletions

View File

@@ -352,9 +352,7 @@ public class DiscordPlugin extends Plugin
private void updatePresence()
{
discordState.triggerEvent(client.getGameState() == GameState.LOGGED_IN
? DiscordGameEventType.IN_GAME
: DiscordGameEventType.IN_MENU);
discordState.refresh();
}
private void checkForGameStateUpdate()

View File

@@ -77,6 +77,19 @@ class DiscordState
lastPresence = null;
}
/**
* Force refresh discord presence
*/
void refresh()
{
if (lastPresence == null)
{
return;
}
discordService.updatePresence(lastPresence);
}
/**
* Trigger new discord state update.
*