Restore functionality of network_discord_id_from_local_index(0)

This commit is contained in:
MysterD 2023-04-15 21:09:26 -07:00
parent e8d9ef247f
commit 0e7b86017e
3 changed files with 16 additions and 1 deletions

View file

@ -149,6 +149,10 @@ static void discord_initialize(void) {
LOG_INFO("initialized"); LOG_INFO("initialized");
} }
u64 discord_get_user_id(void) {
return app.userId;
}
void discord_update(void) { void discord_update(void) {
if (!sDiscordInitialized) { if (!sDiscordInitialized) {
discord_initialize(); discord_initialize();

View file

@ -34,3 +34,4 @@ void discord_fatal(int rc);
void discord_activity_update_check(void); void discord_activity_update_check(void);
void discord_activity_update(void); void discord_activity_update(void);
struct IDiscordActivityEvents* discord_activity_initialize(void); struct IDiscordActivityEvents* discord_activity_initialize(void);
u64 discord_get_user_id(void);

View file

@ -1,5 +1,15 @@
#include "types.h" #include "types.h"
#ifdef DISCORD_SDK
#include "pc/discord/discord.h"
#endif
char* network_discord_id_from_local_index(UNUSED u8 localIndex) { char* network_discord_id_from_local_index(u8 localIndex) {
#ifdef DISCORD_SDK
static char sDiscordId[64] = "";
if (localIndex == 0) {
snprintf(sDiscordId, 64, "%" PRIu64 "", (uint64_t)discord_get_user_id());
return sDiscordId;
}
#endif
return NULL; return NULL;
} }