From 12aab78ca9748bf56f2d6be2ab6b5f7b146313ed Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Wed, 24 Apr 2013 08:55:07 +0000 Subject: small cleanup git-svn-id: http://svn.miranda-ng.org/main/trunk@4524 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Skype/src/skype_database.cpp | 35 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 23 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 2e4bfe4139..8884cb2485 100644 --- a/protocols/Skype/src/skype_database.cpp +++ b/protocols/Skype/src/skype_database.cpp @@ -30,7 +30,7 @@ bool CSkypeProto::IsMessageInDB(HANDLE hContact, DWORD timestamp, const char* gu } ::mir_free(dbei.pBlob); - hDbEvent = ::db_event_prev(hDbEvent); + hDbEvent = ::db_event_prev(hDbEvent); } return result; @@ -50,10 +50,8 @@ HANDLE CSkypeProto::AddDataBaseEvent(HANDLE hContact, WORD type, DWORD timestamp return ::db_event_add(hContact, &dbei); } -void CSkypeProto::RaiseAuthRequestEvent( - DWORD timestamp, - CContact::Ref contact) -{ +void CSkypeProto::RaiseAuthRequestEvent(DWORD timestamp, CContact::Ref contact) +{ char *sid = ::mir_strdup(contact->GetSid()); char *nick = ::mir_strdup(contact->GetNick()); @@ -76,12 +74,12 @@ void CSkypeProto::RaiseAuthRequestEvent( ::strlen(firstName) + ::strlen(lastName) + ::strlen(sid) + - ::strlen(reason) + + ::strlen(reason) + 5; - PBYTE pBlob, pCurBlob; + PBYTE pBlob, pCurBlob; pCurBlob = pBlob = (PBYTE)::mir_alloc(cbBlob); - + *((PDWORD)pCurBlob) = 0; pCurBlob += sizeof(DWORD); *((PDWORD)pCurBlob) = (DWORD)hContact; pCurBlob += sizeof(DWORD); ::strcpy((char*)pCurBlob, nick); pCurBlob += ::strlen(nick) + 1; @@ -89,17 +87,12 @@ void CSkypeProto::RaiseAuthRequestEvent( ::strcpy((char*)pCurBlob, lastName); pCurBlob += ::strlen(lastName) + 1; ::strcpy((char*)pCurBlob, sid); pCurBlob += ::strlen(sid) + 1; ::strcpy((char*)pCurBlob, reason); - + this->AddDataBaseEvent(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 wchar_t *message, bool isNeedCheck) +{ //if (isNeedCheck) // if (this->IsMessageInDB(hContact, timestamp, guid)) // return; @@ -109,16 +102,12 @@ void CSkypeProto::RaiseMessageReceivedEvent( recv.lParam = (LPARAM)guid; recv.timestamp = timestamp; recv.szMessage = ::mir_utf8encodeW(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 wchar_t *message) +{ //if (this->IsMessageInDB(hContact, timestamp, guid, DBEF_SENT)) // return; -- cgit v1.2.3