Merge pull request #11657 from Jamiras/discord_fix
fix discord rich presence
This commit is contained in:
commit
22042f2351
|
@ -57,9 +57,7 @@ void Discord_RunCallbacks(void);
|
||||||
|
|
||||||
/* If you disable the lib starting its own I/O thread,
|
/* If you disable the lib starting its own I/O thread,
|
||||||
* you'll need to call this from your own */
|
* you'll need to call this from your own */
|
||||||
#ifdef DISCORD_DISABLE_IO_THREAD
|
|
||||||
void Discord_UpdateConnection(void);
|
void Discord_UpdateConnection(void);
|
||||||
#endif
|
|
||||||
|
|
||||||
void Discord_UpdatePresence(const DiscordRichPresence* presence);
|
void Discord_UpdatePresence(const DiscordRichPresence* presence);
|
||||||
void Discord_ClearPresence(void);
|
void Discord_ClearPresence(void);
|
||||||
|
|
|
@ -6282,6 +6282,7 @@ void discord_update(enum discord_presence presence)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Discord_UpdatePresence(&discord_st->presence);
|
Discord_UpdatePresence(&discord_st->presence);
|
||||||
|
Discord_UpdateConnection();
|
||||||
discord_st->status = presence;
|
discord_st->status = presence;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6303,6 +6304,7 @@ static void discord_init(
|
||||||
handlers.joinRequest = handle_discord_join_request;
|
handlers.joinRequest = handle_discord_join_request;
|
||||||
|
|
||||||
Discord_Initialize(discord_app_id, &handlers, 0, NULL);
|
Discord_Initialize(discord_app_id, &handlers, 0, NULL);
|
||||||
|
Discord_UpdateConnection();
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
fill_pathname_application_path(full_path, sizeof(full_path));
|
fill_pathname_application_path(full_path, sizeof(full_path));
|
||||||
|
@ -6320,6 +6322,7 @@ static void discord_init(
|
||||||
#endif
|
#endif
|
||||||
RARCH_LOG("[DISCORD]: Registering startup command: %s\n", command);
|
RARCH_LOG("[DISCORD]: Registering startup command: %s\n", command);
|
||||||
Discord_Register(discord_app_id, command);
|
Discord_Register(discord_app_id, command);
|
||||||
|
Discord_UpdateConnection();
|
||||||
discord_st->ready = true;
|
discord_st->ready = true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -35940,6 +35943,7 @@ bool retroarch_main_quit(void)
|
||||||
if (discord_st->ready)
|
if (discord_st->ready)
|
||||||
{
|
{
|
||||||
Discord_ClearPresence();
|
Discord_ClearPresence();
|
||||||
|
Discord_UpdateConnection();
|
||||||
Discord_Shutdown();
|
Discord_Shutdown();
|
||||||
discord_st->ready = false;
|
discord_st->ready = false;
|
||||||
}
|
}
|
||||||
|
@ -37359,7 +37363,10 @@ int runloop_iterate(void)
|
||||||
discord_state_t *discord_st = &p_rarch->discord_st;
|
discord_state_t *discord_st = &p_rarch->discord_st;
|
||||||
|
|
||||||
if (discord_is_inited)
|
if (discord_is_inited)
|
||||||
|
{
|
||||||
Discord_RunCallbacks();
|
Discord_RunCallbacks();
|
||||||
|
Discord_UpdateConnection();
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (p_rarch->runloop_frame_time.callback)
|
if (p_rarch->runloop_frame_time.callback)
|
||||||
|
|
Loading…
Reference in New Issue