summaryrefslogtreecommitdiff
path: root/protocols/Skype
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/Skype')
-rw-r--r--protocols/Skype/src/skype_database.cpp16
1 files changed, 3 insertions, 13 deletions
diff --git a/protocols/Skype/src/skype_database.cpp b/protocols/Skype/src/skype_database.cpp
index 43fb9383d9..bbc11cb385 100644
--- a/protocols/Skype/src/skype_database.cpp
+++ b/protocols/Skype/src/skype_database.cpp
@@ -2,10 +2,7 @@
bool CSkypeProto::IsMessageInDB(HANDLE hContact, DWORD timestamp, SEBinary &guid, int flag)
{
- bool result = false;
-
- HANDLE hDbEvent = ::db_event_last(hContact);
- while (hDbEvent)
+ for (HANDLE hDbEvent = ::db_event_last(hContact); hDbEvent; hDbEvent = ::db_event_prev(hDbEvent))
{
DBEVENTINFO dbei = { sizeof(dbei) };
dbei.cbBlob = ::db_event_getBlobSize(hDbEvent);
@@ -21,18 +18,11 @@ 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)
- {
- result = true;
- break;
- }
- }
-
- hDbEvent = ::db_event_prev(hDbEvent);
+ return true;
}
- return result;
+ return false;
}
HANDLE CSkypeProto::AddDBEvent(HANDLE hContact, WORD type, DWORD timestamp, DWORD flags, DWORD cbBlob, PBYTE pBlob)