diff options
author | George Hazan <ghazan@miranda.im> | 2017-02-14 21:47:53 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2017-02-14 21:47:53 +0300 |
commit | 5bb58bd24e6be45c6812713795d2e58e5ac18989 (patch) | |
tree | 0f75bbb3b2dc129dbcfd5dfd0553b47f8f832b10 | |
parent | b0b0b090cbec03d92e803612d2eced7d85ebf486 (diff) |
Discord: sending typing notification
-rw-r--r-- | protocols/Discord/src/proto.cpp | 11 | ||||
-rw-r--r-- | protocols/Discord/src/proto.h | 2 |
2 files changed, 13 insertions, 0 deletions
diff --git a/protocols/Discord/src/proto.cpp b/protocols/Discord/src/proto.cpp index 50b6aeeeac..d4ac7c11da 100644 --- a/protocols/Discord/src/proto.cpp +++ b/protocols/Discord/src/proto.cpp @@ -393,6 +393,17 @@ int CDiscordProto::SendMsg(MCONTACT hContact, int /*flags*/, const char *pszSrc) ///////////////////////////////////////////////////////////////////////////////////////// +int CDiscordProto::UserIsTyping(MCONTACT hContact, int type) +{ + if (type == PROTOTYPE_SELFTYPING_ON) { + CMStringA szUrl(FORMAT, "/channels/%lld/typing", getId(hContact, DB_KEY_CHANNELID)); + Push(new AsyncHttpRequest(this, REQUEST_POST, szUrl, NULL)); + } + return 0; +} + +///////////////////////////////////////////////////////////////////////////////////////// + void CDiscordProto::MarkReadTimerProc(HWND hwnd, UINT, UINT_PTR id, DWORD) { CDiscordProto *ppro = (CDiscordProto*)(id - 1); diff --git a/protocols/Discord/src/proto.h b/protocols/Discord/src/proto.h index 122b3a9e40..fbe1b9d2b3 100644 --- a/protocols/Discord/src/proto.h +++ b/protocols/Discord/src/proto.h @@ -254,6 +254,8 @@ public: virtual HANDLE __cdecl SendFile(MCONTACT hContact, const wchar_t *szDescription, wchar_t **ppszFiles) override; + virtual int __cdecl UserIsTyping(MCONTACT hContact, int type) override; + virtual int __cdecl SetStatus(int iNewStatus) override; virtual int __cdecl OnEvent(PROTOEVENTTYPE, WPARAM, LPARAM) override; |