From 89ad49f95ee83fb4f4f0f41b5f91d6bc62e1790e Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 9 May 2013 15:08:13 +0000 Subject: fix for doubled sent messages git-svn-id: http://svn.miranda-ng.org/main/trunk@4609 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/Skype/src/skype_database.cpp | 2 +- protocols/Skype/src/skype_messages.cpp | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/protocols/Skype/src/skype_database.cpp b/protocols/Skype/src/skype_database.cpp index 2b6c6b1292..d7e010d125 100644 --- a/protocols/Skype/src/skype_database.cpp +++ b/protocols/Skype/src/skype_database.cpp @@ -18,7 +18,7 @@ bool CSkypeProto::IsMessageInDB(HANDLE hContact, DWORD timestamp, SEBinary &guid int sendFlag = dbei.flags & DBEF_SENT; if (dbei.eventType == EVENTTYPE_MESSAGE && sendFlag == flag) - if (::memcmp(&dbei.pBlob[dbei.cbBlob - 32], guid.data(), guid.size()) == 0) + if (::memcmp(&dbei.pBlob[dbei.cbBlob - guid.size()], guid.data(), guid.size()) == 0) return true; } diff --git a/protocols/Skype/src/skype_messages.cpp b/protocols/Skype/src/skype_messages.cpp index d52a5184e4..031f9a0239 100644 --- a/protocols/Skype/src/skype_messages.cpp +++ b/protocols/Skype/src/skype_messages.cpp @@ -80,6 +80,11 @@ void CSkypeProto::OnMessageSent(CConversation::Ref &conversation, CMessage::Ref g_skype->GetContact(data, receiver); HANDLE hContact = this->AddContact(receiver); + this->SendBroadcast( + hContact, + ACKTYPE_MESSAGE, + sstatus == CMessage::FAILED_TO_SEND ? ACKRESULT_FAILED : ACKRESULT_SUCCESS, + (HANDLE)message->getOID(), 0); SEBinary guid; message->GetPropGuid(guid); @@ -90,12 +95,6 @@ void CSkypeProto::OnMessageSent(CConversation::Ref &conversation, CMessage::Ref guid, text, status == CMessage::UNCONSUMED_NORMAL); - - this->SendBroadcastAsync( - hContact, - ACKTYPE_MESSAGE, - sstatus == CMessage::FAILED_TO_SEND ? ACKRESULT_FAILED : ACKRESULT_SUCCESS, - (HANDLE)message->getOID(), 0); } void CSkypeProto::OnMessageEvent(CConversation::Ref conversation, CMessage::Ref message) -- cgit v1.2.3