From 98d1364fe37597a79535f4982bf93b66acd8286d Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 2 Mar 2015 17:26:52 +0000 Subject: - fix for writing LastSeen information; - fix for receiving error 404 on long contact lists; - iq:last query moved to the UserInfo dialog opening; - version bump git-svn-id: http://svn.miranda-ng.org/main/trunk@12301 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/WhatsApp/src/contacts.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'protocols/WhatsApp/src/contacts.cpp') diff --git a/protocols/WhatsApp/src/contacts.cpp b/protocols/WhatsApp/src/contacts.cpp index d68e3b42b5..abdfeea923 100644 --- a/protocols/WhatsApp/src/contacts.cpp +++ b/protocols/WhatsApp/src/contacts.cpp @@ -90,11 +90,11 @@ void WhatsAppProto::ProcessBuddyList(void*) { // m_pConnection->setFlush(false); - for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { - ptrA jid(getStringA(hContact, WHATSAPP_KEY_ID)); - if (jid) - m_pConnection->sendQueryLastOnline((char*)jid); - } + // for (MCONTACT hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) { + // ptrA jid(getStringA(hContact, WHATSAPP_KEY_ID)); + // if (jid) + // m_pConnection->sendQueryLastOnline((char*)jid); + // } // m_pConnection->setFlush(true); @@ -123,7 +123,7 @@ void WhatsAppProto::onAvailable(const std::string ¶mString, bool paramBoolea void WhatsAppProto::onLastSeen(const std::string ¶mString1, int paramInt, const string ¶mString2) { MCONTACT hContact = AddToContactList(paramString1); - setDword(hContact, WHATSAPP_KEY_LAST_SEEN, paramInt); + setDword(hContact, WHATSAPP_KEY_LAST_SEEN, time(NULL) - paramInt); UpdateStatusMsg(hContact); } @@ -134,7 +134,7 @@ void WhatsAppProto::UpdateStatusMsg(MCONTACT hContact) int lastSeen = getDword(hContact, WHATSAPP_KEY_LAST_SEEN, -1); if (lastSeen != -1) { - time_t ts = time(NULL) - lastSeen; + time_t ts = lastSeen; TCHAR stzLastSeen[MAX_PATH]; _tcsftime(stzLastSeen, SIZEOF(stzLastSeen), TranslateT("Last seen on %x at %X"), localtime(&ts)); ss << stzLastSeen; -- cgit v1.2.3