diff options
author | George Hazan <george.hazan@gmail.com> | 2023-12-04 18:40:03 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2023-12-04 18:40:03 +0300 |
commit | fbab4b0247801a88a05256d94edd15ae49380182 (patch) | |
tree | 7da414af5b95a4478bcf74ee7b00eedd46dc1d5b /protocols/Telegram | |
parent | edf1ce9f204c266af0fca606cbf692675018395b (diff) |
Telegram: support for outgoing typing notifications
Diffstat (limited to 'protocols/Telegram')
-rw-r--r-- | protocols/Telegram/src/proto.cpp | 9 | ||||
-rw-r--r-- | protocols/Telegram/src/proto.h | 2 |
2 files changed, 11 insertions, 0 deletions
diff --git a/protocols/Telegram/src/proto.cpp b/protocols/Telegram/src/proto.cpp index be2156be82..d7c72e8062 100644 --- a/protocols/Telegram/src/proto.cpp +++ b/protocols/Telegram/src/proto.cpp @@ -663,3 +663,12 @@ int CTelegramProto::SetStatus(int iNewStatus) return 0; } + +int CTelegramProto::UserIsTyping(MCONTACT hContact, int type) +{ + if (auto *pUser = FindUser(GetId(hContact))) + if (type == PROTOTYPE_SELFTYPING_ON) + SendQuery(new TD::sendChatAction(pUser->chatId, 0, TD::make_object<TD::chatActionTyping>())); + + return 0; +} diff --git a/protocols/Telegram/src/proto.h b/protocols/Telegram/src/proto.h index 3c1661d3f9..dcb85fbfe7 100644 --- a/protocols/Telegram/src/proto.h +++ b/protocols/Telegram/src/proto.h @@ -359,6 +359,8 @@ public: HANDLE SearchByName(const wchar_t *nick, const wchar_t *firstName, const wchar_t *lastName) override; int SendMsg(MCONTACT hContact, MEVENT hReplyEvent, const char *pszMessage) override; int SetStatus(int iNewStatus) override; + + int UserIsTyping(MCONTACT hContact, int type) override; void OnBuildProtoMenu() override; void OnContactAdded(MCONTACT hContact) override; |