summaryrefslogtreecommitdiff
path: root/protocols/Discord/src/dispatch.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Discord/src/dispatch.cpp')
-rw-r--r--protocols/Discord/src/dispatch.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/protocols/Discord/src/dispatch.cpp b/protocols/Discord/src/dispatch.cpp
index ef8cb223f7..ba58f4cd16 100644
--- a/protocols/Discord/src/dispatch.cpp
+++ b/protocols/Discord/src/dispatch.cpp
@@ -33,6 +33,7 @@ static handlers[] = // these structures must me sorted alphabetically
{ L"READY", &CDiscordProto::OnCommandReady },
+ { L"RELATIONSHIP_ADD", &CDiscordProto::OnCommandFriendAdded },
{ L"RELATIONSHIP_REMOVE", &CDiscordProto::OnCommandFriendRemoved },
{ L"TYPING_START", &CDiscordProto::OnCommandTyping },
@@ -55,6 +56,12 @@ GatewayHandlerFunc CDiscordProto::GetHandler(const wchar_t *pwszCommand)
//////////////////////////////////////////////////////////////////////////////////////
// reading a new message
+void CDiscordProto::OnCommandFriendAdded(const JSONNode &pRoot)
+{
+ CDiscordUser *pUser = PrepareUser(pRoot["user"]);
+ ProcessType(pUser, pRoot);
+}
+
void CDiscordProto::OnCommandFriendRemoved(const JSONNode &pRoot)
{
SnowFlake id = _wtoi64(pRoot["id"].as_mstring());