From bed36b071fe082d34e5961bb5105e662f17aa7c6 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Fri, 26 Apr 2013 19:41:06 +0000 Subject: - sync was returned - fixed contacts nick updating - fixed eternal "connecting" git-svn-id: http://svn.miranda-ng.org/main/trunk@4539 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Skype/src/skype_proto.cpp | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'protocols/Skype/src/skype_proto.cpp') diff --git a/protocols/Skype/src/skype_proto.cpp b/protocols/Skype/src/skype_proto.cpp index 49ca34ba61..ac28c0a6e2 100644 --- a/protocols/Skype/src/skype_proto.cpp +++ b/protocols/Skype/src/skype_proto.cpp @@ -282,11 +282,26 @@ int __cdecl CSkypeProto::RecvMsg( HANDLE hContact, PROTORECVEVENT* pre) ::db_unset(hContact, "CList", "Hidden"); this->UserIsTyping(hContact, PROTOTYPE_SELFTYPING_OFF); - /*int length = ::strlen(pre->szMessage) + 1; - pre->szMessage = (char *)::mir_realloc(pre->szMessage, length + 32); - ::memcpy(&pre->szMessage[length], (char *)pre->lParam, 32);*/ + DBEVENTINFO dbei = { 0 }; + dbei.cbSize = sizeof(dbei); + dbei.szModule = GetContactProto(hContact); + dbei.timestamp = pre->timestamp; + dbei.eventType = EVENTTYPE_MESSAGE; + dbei.cbBlob = (DWORD)strlen(pre->szMessage) + 1; + dbei.pBlob = (PBYTE) pre->szMessage; + + char *guid = (char *)pre->lParam; + dbei.pBlob = (PBYTE)::mir_realloc(dbei.pBlob, dbei.cbBlob + 32); + ::memcpy((char *)&dbei.pBlob[dbei.cbBlob], guid, 32); + + if (pre->flags & PREF_CREATEREAD) + dbei.flags |= DBEF_READ; + if (pre->flags & PREF_UTF) + dbei.flags |= DBEF_UTF; + + return (INT_PTR)::db_event_add(hContact, &dbei); - return ::Proto_RecvMessage(hContact, pre); + //return ::Proto_RecvMessage(hContact, pre); } int __cdecl CSkypeProto::RecvUrl( HANDLE hContact, PROTORECVEVENT* ) { return 0; } @@ -395,7 +410,7 @@ int CSkypeProto::SetStatus(int new_status) } else { - if (this->m_iStatus == ID_STATUS_CONNECTING) + if ( !this->account->IsOnline()) return 0; CContact::AVAILABILITY availability = this->MirandaToSkypeStatus(new_status); -- cgit v1.2.3