diff options
author | George Hazan <ghazan@miranda.im> | 2017-01-16 18:20:37 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-01-16 18:20:37 +0300 |
commit | 6163df27ad6fd2a5da5d9bbb48bb457d8a07a2b6 (patch) | |
tree | d0523b56e1b987789c6622916a31e8f356076d23 /protocols/Discord/src/server.cpp | |
parent | e021b02022a37bd23b599801026d631f5fd9f48c (diff) |
DB_AUTH_BLOB: handy piece of code moved into the core
Diffstat (limited to 'protocols/Discord/src/server.cpp')
-rw-r--r-- | protocols/Discord/src/server.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/protocols/Discord/src/server.cpp b/protocols/Discord/src/server.cpp index 858be58c55..0b7c59fa9a 100644 --- a/protocols/Discord/src/server.cpp +++ b/protocols/Discord/src/server.cpp @@ -116,10 +116,21 @@ void CDiscordProto::OnReceiveUserInfo(NETLIBHTTPREQUEST *pReply, AsyncHttpReques setId(hContact, DB_KEY_ID, m_ownId); setByte(hContact, DB_KEY_MFA, root["mfa_enabled"].as_bool()); - setDword(hContact, DB_KEY_DISCR, root["discriminator"].as_int()); + setDword(hContact, DB_KEY_DISCR, _wtoi(root["discriminator"].as_mstring())); setWString(hContact, DB_KEY_NICK, root["username"].as_mstring()); setWString(hContact, DB_KEY_EMAIL, root["email"].as_mstring()); + switch (root["type"].as_int()) { + case 1: // confirmed + db_unset(hContact, "CList", "NotOnList"); + break; + + case 3: // expecting autorization + db_set_b(hContact, "CList", "NotOnList", 1); + break; + } + + CMStringW wszNewAvatar(root["avatar"].as_mstring()); setWString(hContact, DB_KEY_AVHASH, wszNewAvatar); |