summaryrefslogtreecommitdiff
path: root/protocols/Tlen
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-03-30 17:32:39 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-03-30 17:32:39 +0000
commit109877a3c75cb290c55755dcfc88794d2453669d (patch)
tree3ede8b9170b2fc3f6f35dc2cea6742d44b19d631 /protocols/Tlen
parentfee8d991bdf4a59b563d1b92165ea0ed2f7bacb8 (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/Tlen')
-rw-r--r--protocols/Tlen/src/jabber_misc.cpp6
-rw-r--r--protocols/Tlen/src/jabber_svc.cpp60
-rw-r--r--protocols/Tlen/src/jabber_thread.cpp7
3 files changed, 29 insertions, 44 deletions
diff --git a/protocols/Tlen/src/jabber_misc.cpp b/protocols/Tlen/src/jabber_misc.cpp
index b31dcd7815..fccf376f72 100644
--- a/protocols/Tlen/src/jabber_misc.cpp
+++ b/protocols/Tlen/src/jabber_misc.cpp
@@ -26,16 +26,16 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
void JabberDBAddEvent(TlenProtocol *proto, HANDLE hContact, int eventType, DWORD flags, PBYTE pBlob, DWORD cbBlob)
{
- DBEVENTINFO dbei = {0};
- dbei.cbSize = sizeof(DBEVENTINFO);
+ DBEVENTINFO dbei = { sizeof(dbei) };
dbei.szModule = proto->m_szModuleName;
dbei.timestamp = (DWORD) time(NULL);
dbei.flags = flags;
dbei.eventType = eventType;
dbei.cbBlob = cbBlob;
dbei.pBlob = pBlob;
- CallService(MS_DB_EVENT_ADD, (WPARAM) hContact, (LPARAM) &dbei);
+ db_event_add(hContact, &dbei);
}
+
void JabberDBAddAuthRequest(TlenProtocol *proto, char *jid, char *nick)
{
char *s;
diff --git a/protocols/Tlen/src/jabber_svc.cpp b/protocols/Tlen/src/jabber_svc.cpp
index a064aeb591..30e4764e4f 100644
--- a/protocols/Tlen/src/jabber_svc.cpp
+++ b/protocols/Tlen/src/jabber_svc.cpp
@@ -234,17 +234,12 @@ HANDLE __cdecl TlenProtocol::AddToList(int flags, PROTOSEARCHRESULT *psr)
HANDLE __cdecl TlenProtocol::AddToListByEvent( int flags, int iContact, HANDLE hDbEvent )
{
- DBEVENTINFO dbei;
- HANDLE hContact;
- char *nick, *firstName, *lastName, *jid;
-
- ZeroMemory(&dbei, sizeof(dbei));
- dbei.cbSize = sizeof(dbei);
- if ((dbei.cbBlob=CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)hDbEvent, 0)) == (DWORD)(-1))
+ DBEVENTINFO dbei = { sizeof(dbei) };
+ if ((dbei.cbBlob = db_event_getBlobSize(hDbEvent)) == (DWORD)(-1))
return (HANDLE) NULL;
if ((dbei.pBlob=(PBYTE) mir_alloc(dbei.cbBlob)) == NULL)
return (HANDLE) NULL;
- if (CallService(MS_DB_EVENT_GET, (WPARAM)hDbEvent, (LPARAM) &dbei)) {
+ if (db_event_get(hDbEvent, &dbei)) {
mir_free(dbei.pBlob);
return (HANDLE) NULL;
}
@@ -265,32 +260,27 @@ HANDLE __cdecl TlenProtocol::AddToListByEvent( int flags, int iContact, HANDLE h
return (HANDLE) NULL;
}
- nick = (char *)dbei.pBlob + sizeof(DWORD)*2;
- firstName = nick + strlen(nick) + 1;
- lastName = firstName + strlen(firstName) + 1;
- jid = lastName + strlen(lastName) + 1;
+ char *nick = (char *)dbei.pBlob + sizeof(DWORD)*2;
+ char *firstName = nick + strlen(nick) + 1;
+ char *lastName = firstName + strlen(firstName) + 1;
+ char *jid = lastName + strlen(lastName) + 1;
- hContact = (HANDLE) AddToListByJID(this, jid, flags);
+ HANDLE hContact = (HANDLE) AddToListByJID(this, jid, flags);
mir_free(dbei.pBlob);
-
return hContact;
}
int __cdecl TlenProtocol::Authorize(HANDLE hDbEvent)
{
- DBEVENTINFO dbei;
- char *nick, *firstName, *lastName, *jid;
-
if (!isOnline)
return 1;
- memset(&dbei, sizeof(dbei), 0);
- dbei.cbSize = sizeof(dbei);
- if (( dbei.cbBlob=CallService( MS_DB_EVENT_GETBLOBSIZE, ( WPARAM )hDbEvent, 0 )) == ( DWORD )( -1 ))
+ DBEVENTINFO dbei = { sizeof(dbei) };
+ if ((dbei.cbBlob = db_event_getBlobSize(hDbEvent)) == (DWORD)-1)
return 1;
if ((dbei.pBlob=(PBYTE) mir_alloc(dbei.cbBlob)) == NULL)
return 1;
- if ( CallService( MS_DB_EVENT_GET, ( WPARAM )hDbEvent, ( LPARAM )&dbei )){
+ if (db_event_get(hDbEvent, &dbei)){
mir_free(dbei.pBlob);
return 1;
}
@@ -303,10 +293,10 @@ int __cdecl TlenProtocol::Authorize(HANDLE hDbEvent)
return 1;
}
- nick = (char *)dbei.pBlob + sizeof(DWORD)*2;
- firstName = nick + strlen(nick) + 1;
- lastName = firstName + strlen(firstName) + 1;
- jid = lastName + strlen(lastName) + 1;
+ char *nick = (char *)dbei.pBlob + sizeof(DWORD)*2;
+ char *firstName = nick + strlen(nick) + 1;
+ char *lastName = firstName + strlen(firstName) + 1;
+ char *jid = lastName + strlen(lastName) + 1;
JabberSend(this, "<presence to='%s' type='subscribed'/>", jid);
@@ -331,19 +321,15 @@ int __cdecl TlenProtocol::Authorize(HANDLE hDbEvent)
int __cdecl TlenProtocol::AuthDeny(HANDLE hDbEvent, const PROTOCHAR* szReason)
{
- DBEVENTINFO dbei;
- char *nick, *firstName, *lastName, *jid;
-
if (!isOnline)
return 1;
- memset(&dbei, sizeof(dbei), 0);
- dbei.cbSize = sizeof(dbei);
- if ((dbei.cbBlob=CallService(MS_DB_EVENT_GETBLOBSIZE, (WPARAM)hDbEvent/*hContact*/, 0)) == (DWORD)(-1))
+ DBEVENTINFO dbei = { sizeof(dbei) };
+ if ((dbei.cbBlob = db_event_getBlobSize(hDbEvent)) == (DWORD)(-1))
return 1;
- if ((dbei.pBlob=(PBYTE) mir_alloc(dbei.cbBlob)) == NULL)
+ if ((dbei.pBlob = (PBYTE) mir_alloc(dbei.cbBlob)) == NULL)
return 1;
- if (CallService(MS_DB_EVENT_GET, (WPARAM)hDbEvent/*hContact*/, (LPARAM) &dbei)) {
+ if (db_event_get(hDbEvent, &dbei)) {
mir_free(dbei.pBlob);
return 1;
}
@@ -356,10 +342,10 @@ int __cdecl TlenProtocol::AuthDeny(HANDLE hDbEvent, const PROTOCHAR* szReason)
return 1;
}
- nick = (char *)dbei.pBlob + sizeof(DWORD)*2;
- firstName = nick + strlen(nick) + 1;
- lastName = firstName + strlen(firstName) + 1;
- jid = lastName + strlen(lastName) + 1;
+ char *nick = (char *)dbei.pBlob + sizeof(DWORD)*2;
+ char *firstName = nick + strlen(nick) + 1;
+ char *lastName = firstName + strlen(firstName) + 1;
+ char *jid = lastName + strlen(lastName) + 1;
JabberSend(this, "<presence to='%s' type='unsubscribed'/>", jid);
JabberSend(this, "<iq type='set'><query xmlns='jabber:iq:roster'><item jid='%s' subscription='remove'/></query></iq>", jid);
diff --git a/protocols/Tlen/src/jabber_thread.cpp b/protocols/Tlen/src/jabber_thread.cpp
index d32bd35a32..3b93aa51d5 100644
--- a/protocols/Tlen/src/jabber_thread.cpp
+++ b/protocols/Tlen/src/jabber_thread.cpp
@@ -710,11 +710,10 @@ static void JabberProcessMessage(XmlNode *node, ThreadData *info)
if (msgTime == 0) {
msgTime = time(NULL);
} else {
- HANDLE hDbEvent = (HANDLE) CallService(MS_DB_EVENT_FINDLAST, (WPARAM) hContact, 0);
+ HANDLE hDbEvent = db_event_last(hContact);
if (hDbEvent != NULL) {
- DBEVENTINFO dbei = { 0 };
- dbei.cbSize = sizeof(dbei);
- CallService(MS_DB_EVENT_GET, (WPARAM) hDbEvent, (LPARAM) &dbei);
+ DBEVENTINFO dbei = { sizeof(dbei) };
+ db_event_get( hDbEvent, &dbei);
if (msgTime < dbei.timestamp) {
msgTime = dbei.timestamp + 1;
}