Skip to content

Commit

Permalink
Discord: sending typing notification
Browse files Browse the repository at this point in the history
  • Loading branch information
georgehazan committed Feb 14, 2017
1 parent b0b0b09 commit 5bb58bd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
11 changes: 11 additions & 0 deletions protocols/Discord/src/proto.cpp
Expand Up @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions protocols/Discord/src/proto.h
Expand Up @@ -254,6 +254,8 @@ class CDiscordProto : public PROTO<CDiscordProto>

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;

Expand Down

0 comments on commit 5bb58bd

Please sign in to comment.