diff options
author | George Hazan <george.hazan@gmail.com> | 2015-01-29 19:45:00 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-01-29 19:45:00 +0000 |
commit | 7442e2473e41113ca0fbb40c7816267b3e5cbd16 (patch) | |
tree | 8c5c45039ad22f8be5d21fa97f6578fd6ec96c1f /protocols/WhatsApp/src/messages.cpp | |
parent | d2e609471178d3026f1c9ba140f4804b0ae12eb7 (diff) |
fix for user typing notifications
git-svn-id: http://svn.miranda-ng.org/main/trunk@11953 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/WhatsApp/src/messages.cpp')
-rw-r--r-- | protocols/WhatsApp/src/messages.cpp | 33 |
1 files changed, 9 insertions, 24 deletions
diff --git a/protocols/WhatsApp/src/messages.cpp b/protocols/WhatsApp/src/messages.cpp index 37b2ebad65..e139af9512 100644 --- a/protocols/WhatsApp/src/messages.cpp +++ b/protocols/WhatsApp/src/messages.cpp @@ -87,32 +87,17 @@ void WhatsAppProto::onIsTyping(const std::string& paramString, bool paramBoolean int WhatsAppProto::UserIsTyping(MCONTACT hContact, int type)
{
- if (hContact && isOnline())
- ForkThread(&WhatsAppProto::SendTypingWorker, new send_typing(hContact, type));
-
- return 0;
-}
-
-void WhatsAppProto::SendTypingWorker(void* p)
-{
- if (p == NULL)
- return;
-
- send_typing *typing = static_cast<send_typing*>(p);
-
- // Don't send typing notifications to contacts which are offline
- if (getWord(typing->hContact, "Status", 0) == ID_STATUS_OFFLINE)
- return;
-
- ptrA jid(getStringA(typing->hContact, WHATSAPP_KEY_ID));
- if (jid && this->isOnline()) {
- if (typing->status == PROTOTYPE_SELFTYPING_ON)
- m_pConnection->sendComposing((char*)jid);
- else
- m_pConnection->sendPaused((char*)jid);
+ if (hContact && isOnline()) {
+ ptrA jid(getStringA(hContact, WHATSAPP_KEY_ID));
+ if (jid && isOnline()) {
+ if (type == PROTOTYPE_SELFTYPING_ON)
+ m_pConnection->sendComposing((char*)jid);
+ else
+ m_pConnection->sendPaused((char*)jid);
+ }
}
- delete typing;
+ return 0;
}
void WhatsAppProto::onMessageStatusUpdate(FMessage* fmsg)
|