From 52c57ef89cc24bdb8c70908f544ae86fd87db129 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 28 Jan 2015 16:30:05 +0000 Subject: - statusbar icon added to notify user that a message was read; - FMessage own numbering removed as atavism; - WAConnection::msg_id followed FMessage::id on its road to hell - WhatsAppProto::GetSerial() added as the only method that increments message numbers git-svn-id: http://svn.miranda-ng.org/main/trunk@11941 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/WhatsApp/src/utils.cpp | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'protocols/WhatsApp/src/utils.cpp') diff --git a/protocols/WhatsApp/src/utils.cpp b/protocols/WhatsApp/src/utils.cpp index 0aa95f1a16..2b9ebd2b2f 100644 --- a/protocols/WhatsApp/src/utils.cpp +++ b/protocols/WhatsApp/src/utils.cpp @@ -1,11 +1,14 @@ #include "common.h" -std::string getLastErrorMsg() +LONG WhatsAppProto::GetSerial() { - // Retrieve the system error message for the last-error code + return ::_InterlockedIncrement(&m_iSerial); +} +std::string getLastErrorMsg() +{ LPVOID lpMsgBuf; - DWORD dw = WSAGetLastError(); + DWORD dw = WSAGetLastError(); // retrieve the system error message for the last-error code FormatMessageA( FORMAT_MESSAGE_ALLOCATE_BUFFER | @@ -22,6 +25,18 @@ std::string getLastErrorMsg() return ret; } +void utils::setStatusMessage(MCONTACT hContact, const TCHAR *ptszMessage) +{ + if (ptszMessage != NULL) { + StatusTextData st = { 0 }; + st.cbSize = sizeof(st); + st.hIcon = LoadSkinnedIcon(SKINICON_EVENT_MESSAGE); + _tcsncpy_s(st.tszText, ptszMessage, _TRUNCATE); + CallService(MS_MSG_SETSTATUSTEXT, hContact, (LPARAM)&st); + } + else CallService(MS_MSG_SETSTATUSTEXT, hContact, NULL); +} + BYTE* utils::md5string(const BYTE *data, int size, BYTE *digest) { mir_md5_state_t md5_state; -- cgit v1.2.3