diff options
author | George Hazan <george.hazan@gmail.com> | 2013-03-30 17:32:39 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-03-30 17:32:39 +0000 |
commit | 109877a3c75cb290c55755dcfc88794d2453669d (patch) | |
tree | 3ede8b9170b2fc3f6f35dc2cea6742d44b19d631 /protocols/MRA | |
parent | fee8d991bdf4a59b563d1b92165ea0ed2f7bacb8 (diff) |
MS_DB_EVENT_* services remained, but their calls removed
git-svn-id: http://svn.miranda-ng.org/main/trunk@4255 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/MRA')
-rw-r--r-- | protocols/MRA/src/MraAntiSpam.cpp | 11 | ||||
-rw-r--r-- | protocols/MRA/src/MraProto.cpp | 23 | ||||
-rw-r--r-- | protocols/MRA/src/Mra_proto.cpp | 14 |
3 files changed, 18 insertions, 30 deletions
diff --git a/protocols/MRA/src/MraAntiSpam.cpp b/protocols/MRA/src/MraAntiSpam.cpp index 4fbbb3c744..8b60ade855 100644 --- a/protocols/MRA/src/MraAntiSpam.cpp +++ b/protocols/MRA/src/MraAntiSpam.cpp @@ -398,16 +398,14 @@ DWORD CMraProto::MraAntiSpamReceivedMessageW(LPSTR lpszEMail, size_t dwEMailSize CHAR szBuff[MRA_MAXLENOFMESSAGE*2];
WideCharToMultiByte(CP_UTF8, 0, wszBuff, DWORD(dwDBMessageSize), szBuff, SIZEOF(szBuff), NULL, NULL);
- DBEVENTINFO dbei = {0};
- dbei.cbSize = sizeof(dbei);
+ DBEVENTINFO dbei = { sizeof(dbei) };
dbei.szModule = m_szModuleName;
dbei.timestamp = _time32(NULL);
dbei.flags = (DBEF_READ|DBEF_UTF);
dbei.eventType = EVENTTYPE_MESSAGE;
dbei.cbBlob = DWORD(dwDBMessageSize*sizeof(WCHAR));
dbei.pBlob = (PBYTE)szBuff;
-
- CallService(MS_DB_EVENT_ADD, 0, (LPARAM)&dbei);
+ db_event_add(NULL, &dbei);
}
if (hContact && bAntiSpamDeteleSpamBotContacts) {
@@ -423,15 +421,14 @@ DWORD CMraProto::MraAntiSpamReceivedMessageW(LPSTR lpszEMail, size_t dwEMailSize CHAR szBuff[MRA_MAXLENOFMESSAGE*2];
WideCharToMultiByte(CP_UTF8, 0, wszBuff, DWORD(dwDBMessageSize), szBuff, SIZEOF(szBuff), NULL, NULL);
- DBEVENTINFO dbei = {0};
- dbei.cbSize = sizeof(dbei);
+ DBEVENTINFO dbei = { sizeof(dbei) };
dbei.szModule = m_szModuleName;
dbei.timestamp = _time32(NULL);
dbei.flags = (DBEF_READ|DBEF_UTF);
dbei.eventType = EVENTTYPE_MESSAGE;
dbei.cbBlob = DWORD(dwDBMessageSize*sizeof(WCHAR));
dbei.pBlob = (PBYTE)szBuff;
- CallService(MS_DB_EVENT_ADD, 0, (LPARAM)&dbei);
+ db_event_add(NULL, &dbei);
}
}
}
diff --git a/protocols/MRA/src/MraProto.cpp b/protocols/MRA/src/MraProto.cpp index b1294148b5..e28eded3af 100644 --- a/protocols/MRA/src/MraProto.cpp +++ b/protocols/MRA/src/MraProto.cpp @@ -227,9 +227,9 @@ HANDLE CMraProto::AddToListByEvent(int flags, int iContact, HANDLE hDbEvent) {
DBEVENTINFO dbei = {0};
dbei.cbSize = sizeof(dbei);
- if ((dbei.cbBlob = CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)hDbEvent, 0)) != -1) {
+ if ((dbei.cbBlob = db_event_getBlobSize(hDbEvent)) != -1) {
dbei.pBlob = (PBYTE)alloca(dbei.cbBlob);
- if ( CallService(MS_DB_EVENT_GET, (WPARAM)hDbEvent, (LPARAM)&dbei) == 0 &&
+ if ( db_event_get(hDbEvent, &dbei) == 0 &&
!strcmp(dbei.szModule, m_szModuleName) &&
(dbei.eventType == EVENTTYPE_AUTHREQUEST || dbei.eventType == EVENTTYPE_CONTACTS)) {
@@ -259,13 +259,12 @@ int CMraProto::Authorize(HANDLE hDBEvent) {
if (!m_bLoggedIn) return 1;
- DBEVENTINFO dbei = {0};
- dbei.cbSize = sizeof(dbei);
- if ((dbei.cbBlob = CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)hDBEvent, 0)) == -1)
+ DBEVENTINFO dbei = { sizeof(dbei) };
+ if ((dbei.cbBlob = db_event_getBlobSize(hDBEvent)) == -1)
return 1;
dbei.pBlob = (PBYTE)alloca(dbei.cbBlob);
- if ( CallService(MS_DB_EVENT_GET, (WPARAM)hDBEvent, (LPARAM)&dbei)) return 1;
+ if ( db_event_get(hDBEvent, &dbei)) return 1;
if (dbei.eventType != EVENTTYPE_AUTHREQUEST) return 1;
if ( strcmp(dbei.szModule, m_szModuleName)) return 1;
@@ -281,13 +280,12 @@ int CMraProto::AuthDeny(HANDLE hDBEvent, const TCHAR* szReason) {
if (!m_bLoggedIn) return 1;
- DBEVENTINFO dbei = {0};
- dbei.cbSize = sizeof(dbei);
- if ((dbei.cbBlob = CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)hDBEvent, 0)) == -1)
+ DBEVENTINFO dbei = { sizeof(dbei) };
+ if ((dbei.cbBlob = db_event_getBlobSize(hDBEvent)) == -1)
return 1;
dbei.pBlob = (PBYTE)alloca(dbei.cbBlob);
- if ( CallService(MS_DB_EVENT_GET, (WPARAM)hDBEvent, (LPARAM)&dbei)) return 1;
+ if ( db_event_get(hDBEvent, &dbei)) return 1;
if (dbei.eventType != EVENTTYPE_AUTHREQUEST) return 1;
if ( strcmp(dbei.szModule, m_szModuleName)) return 1;
@@ -413,15 +411,14 @@ HANDLE CMraProto::SearchByName(const TCHAR *pszNick, const TCHAR *pszFirstName, int CMraProto::RecvContacts(HANDLE hContact, PROTORECVEVENT* pre)
{
- DBEVENTINFO dbei = {0};
- dbei.cbSize = sizeof(dbei);
+ DBEVENTINFO dbei = { sizeof(dbei) };
dbei.szModule = m_szModuleName;
dbei.timestamp = pre->timestamp;
dbei.flags = (pre->flags & PREF_CREATEREAD) ? DBEF_READ : 0;
dbei.eventType = EVENTTYPE_CONTACTS;
dbei.cbBlob = pre->lParam;
dbei.pBlob = (PBYTE)pre->szMessage;
- CallService(MS_DB_EVENT_ADD, (WPARAM)hContact, (LPARAM)&dbei);
+ db_event_add(hContact, &dbei);
return 0;
}
diff --git a/protocols/MRA/src/Mra_proto.cpp b/protocols/MRA/src/Mra_proto.cpp index ea501f1dcd..162dd9686c 100644 --- a/protocols/MRA/src/Mra_proto.cpp +++ b/protocols/MRA/src/Mra_proto.cpp @@ -655,24 +655,21 @@ DWORD CMraProto::MraCommandDispatcher(mrim_packet_header_t *pmaHeader, DWORD *pd {
BOOL bAdded;
BYTE btBuff[BUFF_SIZE_BLOB];
- DBEVENTINFO dbei = {0};
GetLPS(lpbData, dwDataSize, &lpbDataCurrent, &lpsEMail);
hContact = MraHContactFromEmail(lpsEMail.lpszData, lpsEMail.dwSize, TRUE, TRUE, &bAdded);
if (bAdded) MraUpdateContactInfo(hContact);
if (IsEMailChatAgent(lpsEMail.lpszData, lpsEMail.dwSize) == FALSE) {
- dbei.cbSize = sizeof(dbei);
+ DBEVENTINFO dbei = { sizeof(dbei) };
dbei.szModule = m_szModuleName;
dbei.timestamp = (DWORD)_time32(NULL);
dbei.flags = 0;
dbei.eventType = EVENTTYPE_ADDED;
- //dbei.cbBlob = 0;
CreateBlobFromContact(hContact, NULL, 0, (LPBYTE)&btBuff, SIZEOF(btBuff), &dwStringSize);
dbei.cbBlob = dwStringSize;
dbei.pBlob = btBuff;
-
- CallService(MS_DB_EVENT_ADD, 0, (LPARAM)&dbei);
+ db_event_add(0, &dbei);
}
GetContactBasicInfoW(hContact, NULL, NULL, NULL, &dwTemp, NULL, NULL, 0, NULL, NULL, 0, NULL, NULL, 0, NULL);
@@ -2004,17 +2001,14 @@ DWORD CMraProto::MraRecvCommand_Message(DWORD dwTime, DWORD dwFlags, MRA_LPS *pl DBWriteContactSettingByte(hContact, "CList", "Hidden", 1);
if (bAutoGrantAuth) { // auto grant auth
- DBEVENTINFO dbei = {0};
-
- dbei.cbSize = sizeof(dbei);
+ DBEVENTINFO dbei = { sizeof(dbei) };
dbei.szModule = m_szModuleName;
dbei.timestamp = _time32(NULL);
dbei.flags = DBEF_READ;
dbei.eventType = EVENTTYPE_AUTHREQUEST;
dbei.pBlob = (PBYTE)btBuff;
-
CreateBlobFromContact(hContact, lpwszMessage, dwMessageSize, btBuff, SIZEOF(btBuff), (size_t*)&dbei.cbBlob);
- CallService(MS_DB_EVENT_ADD, 0, (LPARAM)&dbei);
+ db_event_add(0, &dbei);
MraAuthorize(plpsFrom->lpszData, plpsFrom->dwSize);
}
else {
|