summaryrefslogtreecommitdiff
path: root/protocols/Skype/src/skype_database.cpp
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2013-04-20 15:27:52 +0000
committerAlexander Lantsev <aunsane@gmail.com>2013-04-20 15:27:52 +0000
commit66e9197603643cc587909fb1bce7402383dbad69 (patch)
tree43ac141616878a37e9a8fbfe842cb5a51909ffe7 /protocols/Skype/src/skype_database.cpp
parenta346491026d5df1ffe0d41e4881613a47ca6ca47 (diff)
- temporary commit. may contain non-working code
git-svn-id: http://svn.miranda-ng.org/main/trunk@4483 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Skype/src/skype_database.cpp')
-rw-r--r--protocols/Skype/src/skype_database.cpp48
1 files changed, 21 insertions, 27 deletions
diff --git a/protocols/Skype/src/skype_database.cpp b/protocols/Skype/src/skype_database.cpp
index 8623d08a7b..b607c8e4b7 100644
--- a/protocols/Skype/src/skype_database.cpp
+++ b/protocols/Skype/src/skype_database.cpp
@@ -19,26 +19,18 @@ void CSkypeProto::RaiseAuthRequestEvent(
DWORD timestamp,
CContact::Ref contact)
{
- SEString data;
-
- contact->GetPropSkypename(data);
- char *sid = ::mir_strdup(data);
+ char *sid = ::mir_utf8decodeA(contact->GetSid());
+ char *nick = ::mir_utf8decodeA(contact->GetNick());
- contact->GetPropDisplayname(data);
- char *nick = ::mir_utf8decodeA(data);
+ SEString data;
contact->GetPropReceivedAuthrequest(data);
- char* reason = ::mir_utf8decodeA((const char*)data);
+ char* reason = ::mir_utf8decodeA(data);
- contact->GetPropFullname(data);
- char* fullname = ::mir_utf8decodeA((const char*)data);
-
- char* firstName = strtok(fullname, " ");
- char* lastName = strtok(NULL, " ");
- if (lastName == NULL)
- {
- lastName = "";
- }
+ SEString last;
+ contact->GetFullname(data, last);
+ char* firstName = ::mir_utf8decodeA(data);
+ char* lastName = ::mir_utf8decodeA(last);
PROTORECVEVENT pre = {0};
@@ -113,17 +105,17 @@ bool CSkypeProto::IsMessageInDB(HANDLE hContact, DWORD timestamp, const char* me
void CSkypeProto::RaiseMessageReceivedEvent(
HANDLE hContact,
DWORD timestamp,
- const char* message,
+ const wchar_t *message,
bool isNeedCheck)
{
- if (isNeedCheck)
+ /*if (isNeedCheck)
if (this->IsMessageInDB(hContact, timestamp, message))
- return;
+ return;*/
PROTORECVEVENT recv;
- recv.flags = PREF_UTF;
+ recv.flags = PREF_UNICODE;
recv.timestamp = timestamp;
- recv.szMessage = ::mir_strdup(message);
+ recv.tszMessage = ::mir_wstrdup(message);
::ProtoChainRecvMsg(hContact, &recv);
}
@@ -131,19 +123,21 @@ void CSkypeProto::RaiseMessageReceivedEvent(
void CSkypeProto::RaiseMessageSendedEvent(
HANDLE hContact,
DWORD timestamp,
- const char* message)
+ const wchar_t *message)
{
- if (this->IsMessageInDB(hContact, timestamp, message, DBEF_SENT))
- return;
+ /*if (this->IsMessageInDB(hContact, timestamp, message, DBEF_SENT))
+ return;*/
+
+ char *msg = ::mir_utf8encodeW(message);
DBEVENTINFO dbei = { 0 };
dbei.cbSize = sizeof(dbei);
dbei.szModule = this->m_szModuleName;
dbei.timestamp = timestamp;
dbei.eventType = EVENTTYPE_MESSAGE;
- dbei.cbBlob = (DWORD)::strlen(message) + 1;
- dbei.pBlob = (PBYTE)::mir_strdup(message);
- dbei.flags = DBEF_UTF | DBEF_SENT;
+ dbei.cbBlob = (DWORD)::strlen(msg) + 1;
+ dbei.pBlob = (PBYTE)msg;
+ dbei.flags = PREF_UTF | DBEF_SENT;
::db_event_add(hContact, &dbei);
}