From 0072a0880c077fc0a21fd57214e6c5bf8497402a Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 26 Jan 2015 00:17:21 +0000 Subject: first version that logs in git-svn-id: http://svn.miranda-ng.org/main/trunk@11913 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/WhatsApp/src/WhatsAPI++/WAConnection.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'protocols/WhatsApp/src/WhatsAPI++/WAConnection.h') diff --git a/protocols/WhatsApp/src/WhatsAPI++/WAConnection.h b/protocols/WhatsApp/src/WhatsAPI++/WAConnection.h index 697542e32c..365c1e2d3d 100644 --- a/protocols/WhatsApp/src/WhatsAPI++/WAConnection.h +++ b/protocols/WhatsApp/src/WhatsAPI++/WAConnection.h @@ -103,7 +103,7 @@ class WAConnection { IqResultHandler(WAConnection* con) {this->con = con;} virtual void parse(ProtocolTreeNode* paramProtocolTreeNode, const std::string& paramString) throw (WAException)=0; void error(ProtocolTreeNode* node, int code) { - _LOGDATA("WAConnection: error node %s: code = %d", node->getAttributeValue("id").c_str(), code); + con->logData("WAConnection: error node %s: code = %d", node->getAttributeValue("id").c_str(), code); } void error(ProtocolTreeNode* node) throw (WAException) { std::vector nodes(node->getAllChildren("error")); @@ -303,7 +303,7 @@ class WAConnection { public: IqResultGetPictureIdsHandler(WAConnection* con):IqResultHandler(con) {} virtual void parse(ProtocolTreeNode* node, const std::string& from) throw (WAException) { - // _LOGDATA("onGetPhotoIds %s", node->toString().c_str()); + // logData("onGetPhotoIds %s", node->toString().c_str()); ProtocolTreeNode* groupNode = node->getChild("list"); std::vector children(groupNode->getAllChildren("user")); std::map ids; @@ -344,17 +344,18 @@ class WAConnection { public: IqSendClientConfigHandler(WAConnection* con):IqResultHandler(con) {} virtual void parse(ProtocolTreeNode* node, const std::string& from) throw (WAException) { - _LOGDATA("Clientconfig response %s", node->toString().c_str()); + con->logData("Clientconfig response %s", node->toString().c_str()); } void error(ProtocolTreeNode* node) throw (WAException) { - _LOGDATA("Clientconfig response error %s", node->toString().c_str()); + con->logData("Clientconfig response error %s", node->toString().c_str()); } }; friend class WALogin; private: + ISocketConnection *rawConn; BinTreeNodeReader *in; BinTreeNodeWriter *out; WAListener *event_handler; @@ -382,7 +383,7 @@ private: public: WAConnection(const std::string& user, const std::string& resource, IMutex* mutex, WAListener* event_handler, WAGroupListener* group_event_handler); virtual ~WAConnection(); - void init(IMutex* mutex, WASocketConnection*); + void init(IMutex* mutex, ISocketConnection*); std::string user; std::string domain; @@ -400,6 +401,8 @@ public: static void globalInit(void); static int tokenLookup(const std::string&); + void logData(const char *format, ...); + static MessageStore* message_store; KeyStream inputKey, outputKey; -- cgit v1.2.3