aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstonedDiscord <stoned@derpymail.org>2019-03-12 19:27:13 +0100
committerstonedDiscord <stoned@derpymail.org>2019-03-12 19:27:13 +0100
commit92c54ba2ebee12a87360d00f2982a9083f06166d (patch)
tree2f13e66ae7dc8ac540f3aeaad5b65401ff5f405c
parentfced80661c1342e8622dba9f35c7db43d69e52a9 (diff)
Revert "make discord optional"
This reverts commit 744c100159ff7b79e01c40ec57e42d37650d139b.
-rw-r--r--src/discord_rich_presence.cpp15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/discord_rich_presence.cpp b/src/discord_rich_presence.cpp
index 0bb7f9fb..10f5833e 100644
--- a/src/discord_rich_presence.cpp
+++ b/src/discord_rich_presence.cpp
@@ -4,7 +4,6 @@ namespace AttorneyOnline {
Discord::Discord()
{
- #ifdef DISCORD
DiscordEventHandlers handlers;
std::memset(&handlers, 0, sizeof(handlers));
handlers = {};
@@ -19,19 +18,15 @@ Discord::Discord()
};
qInfo() << "Initializing Discord RPC";
Discord_Initialize(APPLICATION_ID, &handlers, 1, nullptr);
- #endif
}
Discord::~Discord()
{
- #ifdef DISCORD
Discord_Shutdown();
- #endif
}
void Discord::state_lobby()
{
- #ifdef DISCORD
DiscordRichPresence presence;
std::memset(&presence, 0, sizeof(presence));
presence.largeImageKey = "ao2-logo";
@@ -41,13 +36,12 @@ void Discord::state_lobby()
presence.state = "In Lobby";
presence.details = "Idle";
Discord_UpdatePresence(&presence);
- #endif
}
void Discord::state_server(std::string name, std::string server_id)
{
qDebug() << "Discord RPC: Setting server state";
- #ifdef DISCORD
+
DiscordRichPresence presence;
std::memset(&presence, 0, sizeof(presence));
presence.largeImageKey = "ao2-logo";
@@ -65,7 +59,6 @@ void Discord::state_server(std::string name, std::string server_id)
this->server_name = name;
this->timestamp = timestamp;
Discord_UpdatePresence(&presence);
- #endif
}
void Discord::state_character(std::string name)
@@ -74,7 +67,7 @@ void Discord::state_character(std::string name)
auto name_friendly = QString(name.c_str()).replace('_', ' ').toStdString();
const std::string playing_as = "Playing as " + name_friendly;
qDebug() << "Discord RPC: Setting character state (" << playing_as.c_str() << ")";
- #ifdef DISCORD
+
DiscordRichPresence presence;
std::memset(&presence, 0, sizeof(presence));
presence.largeImageKey = "ao2-logo";
@@ -88,13 +81,12 @@ void Discord::state_character(std::string name)
presence.smallImageKey = name_internal.c_str();
// presence.smallImageText = name_internal.c_str();
Discord_UpdatePresence(&presence);
- #endif
}
void Discord::state_spectate()
{
qDebug() << "Discord RPC: Setting specator state";
- #ifdef DISCORD
+
DiscordRichPresence presence;
std::memset(&presence, 0, sizeof(presence));
presence.largeImageKey = "ao2-logo";
@@ -106,7 +98,6 @@ void Discord::state_spectate()
presence.state = "Spectating";
Discord_UpdatePresence(&presence);
- #endif
}
}