Skip to content

Commit

Permalink
fix: set supported platform for the discord sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
Totto16 committed Oct 28, 2024
1 parent a5cafcc commit ad6b2e8
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/discord/core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ void DiscordInstance::clear_activity(bool wait) {
DiscordActivityWrapper::DiscordActivityWrapper(const std::string& details, discord::ActivityType type) {
m_activity.SetDetails(details.c_str());
m_activity.SetType(type);
m_activity.SetSupportedPlatforms(constants::discord::supported_platforms);
}


Expand Down
13 changes: 13 additions & 0 deletions src/discord/core.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,19 @@ namespace constants::discord {
#error "Unsupported platform"
#endif


#if defined(__ANDROID__)
constexpr const std::uint32_t supported_platforms = DiscordActivitySupportedPlatformFlags_Android;
#elif defined(__CONSOLE__)
#error "Not supported"
#elif defined(FLATPAK_BUILD) || defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__) \
|| defined(__APPLE__) || defined(__linux__)
constexpr const std::uint32_t supported_platforms = DiscordActivitySupportedPlatformFlags_Desktop;
#else
#error "Unsupported platform"
#endif


// manually synchronized to https://discord.com/developers/applications/1220147916371394650/rich-presence/assets
enum class ArtAsset { logo };

Expand Down

0 comments on commit ad6b2e8

Please sign in to comment.