summaryrefslogtreecommitdiff
path: root/protocols/Skype/src/skype_database.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2013-04-27 09:49:47 +0000
committerAlexander Lantsev <aunsane@gmail.com>2013-04-27 09:49:47 +0000
commitc7fa62a343fe1e5937602c216ec5d7e597462768 (patch)
tree9523b43b24459fcb89d42adf190aee7636f17802 /protocols/Skype/src/skype_database.cpp
parent5aadfaa9bcaa25825e33f75f49f713a43670d925 (diff)
- 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
Diffstat (limited to 'protocols/Skype/src/skype_database.cpp')
-rw-r--r--protocols/Skype/src/skype_database.cpp22
1 files changed, 16 insertions, 6 deletions
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