summaryrefslogtreecommitdiff
path: root/protocols/WhatsApp/src/proto.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/WhatsApp/src/proto.cpp')
-rw-r--r--protocols/WhatsApp/src/proto.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/protocols/WhatsApp/src/proto.cpp b/protocols/WhatsApp/src/proto.cpp
index f5870bd588..f41519a172 100644
--- a/protocols/WhatsApp/src/proto.cpp
+++ b/protocols/WhatsApp/src/proto.cpp
@@ -75,6 +75,7 @@ int WhatsAppProto::OnEvent(PROTOEVENTTYPE evType, WPARAM wParam, LPARAM lParam)
HookProtoEvent(ME_GC_EVENT, &WhatsAppProto::onGroupChatEvent);
HookProtoEvent(ME_GC_BUILDMENU, &WhatsAppProto::OnChatMenu);
+ HookProtoEvent(ME_USERINFO_INITIALISE, &WhatsAppProto::OnUserInfo);
}
return TRUE;
}
@@ -349,6 +350,15 @@ int WhatsAppProto::OnOptionsInit(WPARAM wParam, LPARAM lParam)
return 0;
}
+int WhatsAppProto::OnUserInfo(WPARAM, LPARAM hContact)
+{
+ ptrA jid(getStringA(hContact, WHATSAPP_KEY_ID));
+ if (jid && isOnline())
+ m_pConnection->sendQueryLastOnline((char*)jid);
+
+ return 0;
+}
+
void WhatsAppProto::RequestFriendship(MCONTACT hContact)
{
if (hContact == NULL || isOffline())