aboutsummaryrefslogtreecommitdiff
path: root/src/discord_rich_presence.cpp
diff options
context:
space:
mode:
authoroldmud0 <oldmud0@users.noreply.github.com>2020-04-17 21:57:16 -0500
committeroldmud0 <oldmud0@users.noreply.github.com>2020-04-17 21:57:16 -0500
commit13942345c6a3e7e1625c6c26cc2f2f368a3bff23 (patch)
tree73ce940217b57fd47afb6a95e828e6309ed5e683 /src/discord_rich_presence.cpp
parentfaac191f0b9e99b82614ed3959ec5c67f56a1fc3 (diff)
Run clang-format on entire project
Indentation fixed to 2 spaces per tab. Braces set to Stroustrup style. Lines reflow at 80 characters. One-line method bodies are on the same line as the signature. Space always after `//`. No indentation on preprocessor macros. Includes are sorted lexicographically. If you don't want to see this commit on blames, use the hidden whitespace option on GitHub, or use `-w` in git-blame.
Diffstat (limited to 'src/discord_rich_presence.cpp')
-rw-r--r--src/discord_rich_presence.cpp37
1 files changed, 12 insertions, 25 deletions
diff --git a/src/discord_rich_presence.cpp b/src/discord_rich_presence.cpp
index 95a824a1..aea07e5e 100644
--- a/src/discord_rich_presence.cpp
+++ b/src/discord_rich_presence.cpp
@@ -8,23 +8,18 @@ Discord::Discord()
DiscordEventHandlers handlers;
std::memset(&handlers, 0, sizeof(handlers));
handlers = {};
- handlers.ready = [] {
- qInfo() << "Discord RPC ready";
- };
- handlers.disconnected = [](int errorCode, const char* message) {
+ handlers.ready = [] { qInfo() << "Discord RPC ready"; };
+ handlers.disconnected = [](int errorCode, const char *message) {
qInfo() << "Discord RPC disconnected! " << message << errorCode;
};
- handlers.errored = [](int errorCode, const char* message) {
+ handlers.errored = [](int errorCode, const char *message) {
qWarning() << "Discord RPC errored out! " << message << errorCode;
};
qInfo() << "Initializing Discord RPC";
Discord_Initialize(APPLICATION_ID, &handlers, 1, nullptr);
}
-Discord::~Discord()
-{
- Discord_Shutdown();
-}
+Discord::~Discord() { Discord_Shutdown(); }
void Discord::state_lobby()
{
@@ -64,10 +59,12 @@ void Discord::state_server(std::string name, std::string server_id)
void Discord::state_character(std::string name)
{
- auto name_internal = QString(name.c_str()).toLower().replace(' ', '_').toStdString();
+ auto name_internal =
+ QString(name.c_str()).toLower().replace(' ', '_').toStdString();
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() << ")";
+ qDebug() << "Discord RPC: Setting character state (" << playing_as.c_str()
+ << ")";
DiscordRichPresence presence;
std::memset(&presence, 0, sizeof(presence));
@@ -101,20 +98,11 @@ void Discord::state_spectate()
Discord_UpdatePresence(&presence);
}
#else
-Discord::Discord()
-{
-
-}
-
-Discord::~Discord()
-{
-
-}
+Discord::Discord() {}
-void Discord::state_lobby()
-{
+Discord::~Discord() {}
-}
+void Discord::state_lobby() {}
void Discord::state_server(std::string name, std::string server_id)
{
@@ -129,7 +117,6 @@ void Discord::state_character(std::string name)
void Discord::state_spectate()
{
qDebug() << "Discord RPC: Setting specator state";
-
}
#endif
-}
+} // namespace AttorneyOnline