From c7fa62a343fe1e5937602c216ec5d7e597462768 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Sat, 27 Apr 2013 09:49:47 +0000 Subject: - fixed rtl in incoming messages - fixed contacts nick loading git-svn-id: http://svn.miranda-ng.org/main/trunk@4550 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Skype/src/skype_database.cpp | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'protocols/Skype/src/skype_database.cpp') diff --git a/protocols/Skype/src/skype_database.cpp b/protocols/Skype/src/skype_database.cpp index 9ed2a21797..86bd7a49ac 100644 --- a/protocols/Skype/src/skype_database.cpp +++ b/protocols/Skype/src/skype_database.cpp @@ -91,9 +91,9 @@ void CSkypeProto::RaiseAuthRequestEvent(DWORD timestamp, CContact::Ref contact) this->AddDBEvent(hContact, EVENTTYPE_AUTHREQUEST, time(NULL), PREF_UTF, cbBlob, pBlob); } -void CSkypeProto::RaiseMessageReceivedEvent(HANDLE hContact, DWORD timestamp, const char *guid, const wchar_t *message, bool isNeedCheck) +void CSkypeProto::RaiseMessageReceivedEvent(HANDLE hContact, DWORD timestamp, const char *guid, const char *message, bool isUnreaded) { - if (isNeedCheck) + if ( !isUnreaded) if (this->IsMessageInDB(hContact, timestamp, guid)) return; @@ -101,23 +101,33 @@ void CSkypeProto::RaiseMessageReceivedEvent(HANDLE hContact, DWORD timestamp, co recv.flags = PREF_UTF; recv.lParam = (LPARAM)guid; recv.timestamp = timestamp; - recv.szMessage = ::mir_utf8encodeW(message); + recv.szMessage = ::mir_strdup(message); ::ProtoChainRecvMsg(hContact, &recv); } -void CSkypeProto::RaiseMessageSendedEvent(HANDLE hContact, DWORD timestamp, const char *guid, const wchar_t *message) +void CSkypeProto::RaiseMessageSendedEvent(HANDLE hContact, DWORD timestamp, const char *guid, const char *message, bool isUnreaded) { if (this->IsMessageInDB(hContact, timestamp, guid, DBEF_SENT)) return; int guidLen = ::strlen(guid); - char *msg = ::mir_utf8encodeW(message); + char *msg = ::mir_strdup(message); int msgLen = ::strlen(msg) + 1; msg = (char *)::mir_realloc(msg, msgLen + 32); ::memcpy((char *)&msg[msgLen], guid, 32); - this->AddDBEvent(hContact, EVENTTYPE_MESSAGE, timestamp, PREF_UTF | DBEF_SENT, msgLen + guidLen, (PBYTE)msg); + DWORD flags = DBEF_UTF | DBEF_SENT; + if ( !isUnreaded) + flags |= DBEF_READ; + + this->AddDBEvent( + hContact, + EVENTTYPE_MESSAGE, + timestamp, + flags, + msgLen + guidLen, + (PBYTE)msg); } \ No newline at end of file -- cgit v1.2.3