diff --git a/src/citra_qt/discord_impl.cpp b/src/citra_qt/discord_impl.cpp index ed8ea6081..3a79c0c25 100644 --- a/src/citra_qt/discord_impl.cpp +++ b/src/citra_qt/discord_impl.cpp @@ -34,9 +34,17 @@ void DiscordImpl::Update(bool is_powered_on) { s64 start_time = std::chrono::duration_cast( std::chrono::system_clock::now().time_since_epoch()) .count(); + auto truncate = [](const std::string& str, std::size_t maxLen = 128) -> std::string { + if (str.length() <= maxLen) { + return str; + } + return str.substr(0, maxLen - 3) + "..."; + }; + std::string title; if (is_powered_on) { system.GetAppLoader().ReadTitle(title); + title = truncate("Playing: " + title); } DiscordRichPresence presence{}; @@ -44,9 +52,6 @@ void DiscordImpl::Update(bool is_powered_on) { presence.largeImageText = "An open source emulator for the Nintendo 3DS"; if (is_powered_on) { presence.state = title.c_str(); - presence.details = "Currently in game"; - } else { - presence.details = "Not in game"; } presence.startTimestamp = start_time; Discord_UpdatePresence(&presence);