summaryrefslogtreecommitdiff
path: root/protocols/WhatsAppWeb/src/proto.h
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/WhatsAppWeb/src/proto.h')
-rw-r--r--protocols/WhatsAppWeb/src/proto.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/protocols/WhatsAppWeb/src/proto.h b/protocols/WhatsAppWeb/src/proto.h
index a2517d13e7..7ab3bd2921 100644
--- a/protocols/WhatsAppWeb/src/proto.h
+++ b/protocols/WhatsAppWeb/src/proto.h
@@ -50,6 +50,25 @@ struct WAMessage
class WhatsAppProto : public PROTO<WhatsAppProto>
{
+ class CWhatsAppProtoImpl
+ {
+ friend class WhatsAppProto;
+ WhatsAppProto &m_proto;
+
+ CTimer m_keepAlive;
+ void OnKeepAlive(CTimer *) {
+ m_proto.SendKeepAlive();
+ }
+
+ CWhatsAppProtoImpl(WhatsAppProto &pro) :
+ m_proto(pro),
+ m_keepAlive(Miranda_GetSystemWindow(), UINT_PTR(this))
+ {
+ m_keepAlive.OnEvent = Callback(this, &CWhatsAppProtoImpl::OnKeepAlive);
+ }
+ } m_impl;
+
+
bool m_bTerminated, m_bOnline;
ptrW m_tszDefaultGroup;
@@ -99,6 +118,8 @@ class WhatsAppProto : public PROTO<WhatsAppProto>
bool decryptBinaryMessage(size_t cbSize, const void *buf, MBinBuffer &res);
+ void SendKeepAlive();
+
/// Request handlers ///////////////////////////////////////////////////////////////////
void OnRestoreSession1(const JSONNode &node);