summaryrefslogtreecommitdiff
path: root/protocols/Discord/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2024-06-05 12:57:08 +0300
committerGeorge Hazan <george.hazan@gmail.com>2024-06-05 12:57:08 +0300
commit65593efdb82f606f9d2b104c2a78639b8f874686 (patch)
treec174bb02823b56f11d1392dfe697919eec8d7843 /protocols/Discord/src
parent4b53f58821f7adf0fdbe25af50c929927684e04e (diff)
fixes #4450 (Discord: Add Mobile status to Discord users)
Diffstat (limited to 'protocols/Discord/src')
-rw-r--r--protocols/Discord/src/guilds.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/protocols/Discord/src/guilds.cpp b/protocols/Discord/src/guilds.cpp
index d19615ef93..0972518154 100644
--- a/protocols/Discord/src/guilds.cpp
+++ b/protocols/Discord/src/guilds.cpp
@@ -29,6 +29,18 @@ void CDiscordProto::ProcessPresence(const JSONNode &root)
return;
}
+ CMStringA szVer("Discord");
+ for (auto &it : root["client_status"]) {
+ if (!mir_strcmp(it.name(), "web"))
+ szVer += " (website)";
+ else if (!mir_strcmp(it.name(), "mobile"))
+ szVer += " (mobile)";
+ }
+ if (szVer.GetLength() > 7)
+ setString(pUser->hContact, "MirVer", szVer);
+ else
+ delSetting(pUser->hContact, "MirVer");
+
setWord(pUser->hContact, "Status", StrToStatus(root["status"].as_mstring()));
CheckAvatarChange(pUser->hContact, root["user"]["avatar"].as_mstring());