summaryrefslogtreecommitdiff
path: root/plugins/Boltun
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Boltun')
-rw-r--r--plugins/Boltun/src/actionQueue.cpp2
-rw-r--r--plugins/Boltun/src/boltun.cpp9
2 files changed, 5 insertions, 6 deletions
diff --git a/plugins/Boltun/src/actionQueue.cpp b/plugins/Boltun/src/actionQueue.cpp
index c8e8e02aa4..e652ce8061 100644
--- a/plugins/Boltun/src/actionQueue.cpp
+++ b/plugins/Boltun/src/actionQueue.cpp
@@ -125,7 +125,7 @@ static void TimerAnswer(HANDLE hContact, const TalkBot::MessageInfo* info)
ldbei.szModule = BOLTUN_NAME;
ldbei.timestamp = (DWORD)time(NULL);
- CallService(MS_DB_EVENT_ADD, (WPARAM)hContact, (LPARAM)&ldbei);
+ db_event_add(hContact, &ldbei);
bot->AnswerGiven(hContact, *info);
delete info;
diff --git a/plugins/Boltun/src/boltun.cpp b/plugins/Boltun/src/boltun.cpp
index 99eb76ef2b..fdf9fbf78c 100644
--- a/plugins/Boltun/src/boltun.cpp
+++ b/plugins/Boltun/src/boltun.cpp
@@ -220,8 +220,7 @@ static bool BoltunAutoChat(HANDLE hContact)
static int MessageEventAdded(WPARAM wParam, LPARAM lParam)
{
- //DBEVENTINFO ldbei;
- HANDLE hContact = (HANDLE)wParam;
+ HANDLE hContact = (HANDLE)wParam, hDbEvent = (HANDLE)lParam;
if (!BoltunAutoChat(hContact))
return 0;
@@ -230,7 +229,7 @@ static int MessageEventAdded(WPARAM wParam, LPARAM lParam)
dbei.cbSize = sizeof(dbei);
dbei.cbBlob = 0;
- dbei.cbBlob = CallService(MS_DB_EVENT_GETBLOBSIZE, lParam, 0);
+ dbei.cbBlob = db_event_getBlobSize(hDbEvent);
if (dbei.cbBlob == -1)
return 0;
@@ -238,7 +237,7 @@ static int MessageEventAdded(WPARAM wParam, LPARAM lParam)
if (dbei.pBlob == NULL)
return 0;
- CallService(MS_DB_EVENT_GET, lParam, (LPARAM)&dbei);
+ db_event_get(hDbEvent, &dbei);
if (dbei.flags & DBEF_SENT || dbei.flags & DBEF_READ || dbei.eventType != EVENTTYPE_MESSAGE)
return 0;
DBEVENTGETTEXT egt;
@@ -248,7 +247,7 @@ static int MessageEventAdded(WPARAM wParam, LPARAM lParam)
TCHAR* s = (TCHAR*)(void*)CallService(MS_DB_EVENT_GETTEXT, 0, (LPARAM)&egt);
free(dbei.pBlob);
if (Config.MarkAsRead)
- CallService(MS_DB_EVENT_MARKREAD, wParam, lParam);
+ db_event_markRead(hContact, hDbEvent);
AnswerToContact(hContact, s);
mir_free(s);