summaryrefslogtreecommitdiff
path: root/protocols
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2016-09-13 17:11:58 +0000
committerGeorge Hazan <george.hazan@gmail.com>2016-09-13 17:11:58 +0000
commitf51995e13679a37851baef8e7f52f2d993cbc7c1 (patch)
tree25ccd03cf2dc4b897cc0dc6fcbe4cc78ddb122c7 /protocols
parentfe1e8456d2488095f409a4f2d38b7251abdedccf (diff)
mode old database junk to die
git-svn-id: http://svn.miranda-ng.org/main/trunk@17291 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols')
-rw-r--r--protocols/AimOscar/src/proto.cpp2
-rw-r--r--protocols/FacebookRM/src/proto.cpp2
-rw-r--r--protocols/GTalkExt/src/avatar.cpp5
-rw-r--r--protocols/IRCG/src/options.cpp2
-rw-r--r--protocols/IcqOscarJ/src/icq_avatar.cpp2
-rw-r--r--protocols/IcqOscarJ/src/icq_proto.cpp8
-rw-r--r--protocols/IcqOscarJ/src/icq_servlist.cpp5
-rw-r--r--protocols/IcqOscarJ/src/icqosc_svcs.cpp15
-rwxr-xr-xprotocols/JabberG/src/jabber_proto.cpp4
-rw-r--r--protocols/JabberG/src/jabber_rc.cpp4
-rw-r--r--protocols/JabberG/src/jabber_svc.cpp58
-rw-r--r--protocols/MSN/src/msn_proto.cpp2
-rw-r--r--protocols/SkypeWeb/src/skype_db.cpp2
-rw-r--r--protocols/SkypeWeb/src/skype_events.cpp60
-rw-r--r--protocols/Steam/src/steam_events.cpp3
-rw-r--r--protocols/Steam/src/steam_utils.cpp13
-rw-r--r--protocols/Tox/src/tox_events.cpp4
-rw-r--r--protocols/Twitter/src/proto.cpp2
18 files changed, 77 insertions, 116 deletions
diff --git a/protocols/AimOscar/src/proto.cpp b/protocols/AimOscar/src/proto.cpp
index 3530efa2ed..f4c9580841 100644
--- a/protocols/AimOscar/src/proto.cpp
+++ b/protocols/AimOscar/src/proto.cpp
@@ -673,7 +673,7 @@ int __cdecl CAimProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM l
case EV_PROTO_ONERASE:
char szDbsettings[64];
mir_snprintf(szDbsettings, "%sP2P", m_szModuleName);
- CallService(MS_DB_MODULE_DELETE, 0, (LPARAM)szDbsettings);
+ DbModule_Delete(0, szDbsettings);
break;
case EV_PROTO_ONCONTACTDELETED:
diff --git a/protocols/FacebookRM/src/proto.cpp b/protocols/FacebookRM/src/proto.cpp
index 2e3c7c82ce..aac1821f0e 100644
--- a/protocols/FacebookRM/src/proto.cpp
+++ b/protocols/FacebookRM/src/proto.cpp
@@ -110,7 +110,7 @@ FacebookProto::FacebookProto(const char* proto_name, const wchar_t* username) :
evtype.descr = LPGEN("Video call");
evtype.eventIcon = GetIconHandle("facebook");
evtype.flags = DETF_HISTORY | DETF_MSGWINDOW;
- CallService(MS_DB_EVENT_REGISTERTYPE, 0, (LPARAM)&evtype);
+ DbEvent_RegisterType(&evtype);
}
FacebookProto::~FacebookProto()
diff --git a/protocols/GTalkExt/src/avatar.cpp b/protocols/GTalkExt/src/avatar.cpp
index 84de3a28d8..36c6f4ff6a 100644
--- a/protocols/GTalkExt/src/avatar.cpp
+++ b/protocols/GTalkExt/src/avatar.cpp
@@ -33,7 +33,7 @@
LPTSTR CreateAvaFile(HANDLE *hFile)
{
wchar_t name[MAX_PATH + 2];
- if (CallService(MS_DB_GETPROFILENAMEW, (WPARAM)_countof(name), (LPARAM)&name))
+ if (Profile_GetNameW(_countof(name), name))
return NULL;
wchar_t *p = wcsrchr(name, '.');
@@ -41,8 +41,7 @@ LPTSTR CreateAvaFile(HANDLE *hFile)
*p = 0;
wchar_t path[MAX_PATH + 2];
- if (CallService(MS_DB_GETPROFILEPATHW, (WPARAM)_countof(path), (LPARAM)&path))
- return NULL;
+ Profile_GetPathW(_countof(path), path);
wchar_t full[MAX_PATH + 2];
mir_snwprintf(full, AVA_FILE_NAME_FORMAT, path, name);
diff --git a/protocols/IRCG/src/options.cpp b/protocols/IRCG/src/options.cpp
index 940251a7ca..1a249a3fc3 100644
--- a/protocols/IRCG/src/options.cpp
+++ b/protocols/IRCG/src/options.cpp
@@ -747,7 +747,7 @@ void CConnectPrefsDlg::OnApply()
if (m_serverlistModified) {
m_serverlistModified = false;
- CallService(MS_DB_MODULE_DELETE, 0, (LPARAM)SERVERSMODULE);
+ DbModule_Delete(0, SERVERSMODULE);
int j = m_serverCombo.GetCount();
if (j != CB_ERR && j != 0) {
diff --git a/protocols/IcqOscarJ/src/icq_avatar.cpp b/protocols/IcqOscarJ/src/icq_avatar.cpp
index bfd2b1ee14..0ba204700d 100644
--- a/protocols/IcqOscarJ/src/icq_avatar.cpp
+++ b/protocols/IcqOscarJ/src/icq_avatar.cpp
@@ -99,7 +99,7 @@ void CIcqProto::GetAvatarFileName(int dwUin, const char *szUid, wchar_t *pszDest
}
else {
wchar_t szBuf[MAX_PATH];
- if (CallService(MS_DB_GETPROFILENAMEW, MAX_PATH, (LPARAM)szBuf))
+ if (Profile_GetNameW(MAX_PATH, szBuf))
mir_wstrcpy(pszDest + tPathLen, L"avatar");
else {
wchar_t *szLastDot = wcsrchr(szBuf, '.');
diff --git a/protocols/IcqOscarJ/src/icq_proto.cpp b/protocols/IcqOscarJ/src/icq_proto.cpp
index fe362f382a..91d2014802 100644
--- a/protocols/IcqOscarJ/src/icq_proto.cpp
+++ b/protocols/IcqOscarJ/src/icq_proto.cpp
@@ -188,7 +188,7 @@ CIcqProto::CIcqProto(const char* aProtoName, const wchar_t* aUserName) :
eventType.textService = ICQ_DB_GETEVENTTEXT_MISSEDMESSAGE;
eventType.flags = DETF_HISTORY | DETF_MSGWINDOW;
// for now keep default "message" icon
- CallService(MS_DB_EVENT_REGISTERTYPE, 0, (LPARAM)&eventType);
+ DbEvent_RegisterType(&eventType);
// Protocol instance is ready
debugLogA("%s: Protocol instance '%s' created.", ICQ_PROTOCOL_NAME, m_szModuleName);
@@ -1862,11 +1862,11 @@ int __cdecl CIcqProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM l
{
char szDbSetting[MAX_PATH];
mir_snprintf(szDbSetting, "%sP2P", m_szModuleName);
- CallService(MS_DB_MODULE_DELETE, 0, (LPARAM)szDbSetting);
+ DbModule_Delete(0, szDbSetting);
mir_snprintf(szDbSetting, "%sSrvGroups", m_szModuleName);
- CallService(MS_DB_MODULE_DELETE, 0, (LPARAM)szDbSetting);
+ DbModule_Delete(0, szDbSetting);
mir_snprintf(szDbSetting, "%sGroups", m_szModuleName);
- CallService(MS_DB_MODULE_DELETE, 0, (LPARAM)szDbSetting);
+ DbModule_Delete(0, szDbSetting);
}
break;
diff --git a/protocols/IcqOscarJ/src/icq_servlist.cpp b/protocols/IcqOscarJ/src/icq_servlist.cpp
index de90ee5bd8..9c9ae7a703 100644
--- a/protocols/IcqOscarJ/src/icq_servlist.cpp
+++ b/protocols/IcqOscarJ/src/icq_servlist.cpp
@@ -1180,7 +1180,7 @@ int CIcqProto::IsServerGroupsDefined()
// flush obsolete linking data
mir_snprintf(szModule, "%sGroups", m_szModuleName);
- CallService(MS_DB_MODULE_DELETE, 0, (LPARAM)szModule);
+ DbModule_Delete(0, szModule);
iRes = 0; // no groups defined, or older version
}
@@ -1193,9 +1193,8 @@ int CIcqProto::IsServerGroupsDefined()
void CIcqProto::FlushSrvGroupsCache()
{
char szModule[MAX_PATH];
-
mir_snprintf(szModule, "%sSrvGroups", m_szModuleName);
- CallService(MS_DB_MODULE_DELETE, 0, (LPARAM)szModule);
+ DbModule_Delete(0, szModule);
}
// Look thru DB and collect all ContactIDs from a group
diff --git a/protocols/IcqOscarJ/src/icqosc_svcs.cpp b/protocols/IcqOscarJ/src/icqosc_svcs.cpp
index b1ec3e8330..fad62bf3e7 100644
--- a/protocols/IcqOscarJ/src/icqosc_svcs.cpp
+++ b/protocols/IcqOscarJ/src/icqosc_svcs.cpp
@@ -630,15 +630,15 @@ INT_PTR __cdecl CIcqProto::IcqCheckCapability(WPARAM hContact, LPARAM lParam)
/////////////////////////////////////////////////////////////////////////////////////////
-INT_PTR icq_getEventTextMissedMessage(WPARAM, LPARAM lParam)
+INT_PTR icq_getEventTextMissedMessage(WPARAM pEvent, LPARAM datatype)
{
- DBEVENTGETTEXT *pEvent = (DBEVENTGETTEXT *)lParam;
+ DBEVENTINFO *dbei = (DBEVENTINFO *)pEvent;
INT_PTR nRetVal = 0;
char *pszText = NULL;
- if (pEvent->dbei->cbBlob > 1) {
- switch (((WORD*)pEvent->dbei->pBlob)[0]) {
+ if (dbei->cbBlob > 1) {
+ switch (((WORD*)dbei->pBlob)[0]) {
case 0:
pszText = LPGEN("** This message was blocked by the ICQ server ** The message was invalid.");
break;
@@ -659,18 +659,17 @@ INT_PTR icq_getEventTextMissedMessage(WPARAM, LPARAM lParam)
pszText = LPGEN("** Unknown missed message event.");
break;
}
- if (pEvent->datatype == DBVT_WCHAR) {
- WCHAR *pwszText;
+ if (datatype == DBVT_WCHAR) {
int wchars = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, pszText, (int)mir_strlen(pszText), NULL, 0);
- pwszText = (WCHAR*)_alloca((wchars + 1) * sizeof(WCHAR));
+ WCHAR *pwszText = (WCHAR*)_alloca((wchars + 1) * sizeof(WCHAR));
pwszText[wchars] = 0;
MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, pszText, (int)mir_strlen(pszText), pwszText, wchars);
nRetVal = (INT_PTR)mir_wstrdup(TranslateW(pwszText));
}
- else if (pEvent->datatype == DBVT_ASCIIZ)
+ else if (datatype == DBVT_ASCIIZ)
nRetVal = (INT_PTR)mir_strdup(Translate(pszText));
}
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp
index 0ddbbee5fe..6922e35a59 100755
--- a/protocols/JabberG/src/jabber_proto.cpp
+++ b/protocols/JabberG/src/jabber_proto.cpp
@@ -242,11 +242,11 @@ int CJabberProto::OnModulesLoadedEx(WPARAM, LPARAM)
dbEventType.module = m_szModuleName;
dbEventType.eventType = EVENTTYPE_JABBER_CHATSTATES;
dbEventType.descr = "Chat state notifications";
- CallService(MS_DB_EVENT_REGISTERTYPE, 0, (LPARAM)&dbEventType);
+ DbEvent_RegisterType(&dbEventType);
dbEventType.eventType = EVENTTYPE_JABBER_PRESENCE;
dbEventType.descr = "Presence notifications";
- CallService(MS_DB_EVENT_REGISTERTYPE, 0, (LPARAM)&dbEventType);
+ DbEvent_RegisterType(&dbEventType);
HookProtoEvent(ME_IDLE_CHANGED, &CJabberProto::OnIdleChanged);
diff --git a/protocols/JabberG/src/jabber_rc.cpp b/protocols/JabberG/src/jabber_rc.cpp
index 7255b5cc63..91774af02b 100644
--- a/protocols/JabberG/src/jabber_rc.cpp
+++ b/protocols/JabberG/src/jabber_rc.cpp
@@ -477,7 +477,7 @@ int CJabberProto::RcGetUnreadEventsCount()
dbei.pBlob = (PBYTE)mir_alloc(dbei.cbBlob + 1);
int nGetTextResult = db_event_get(hDbEvent, &dbei);
if (!nGetTextResult && dbei.eventType == EVENTTYPE_MESSAGE && !(dbei.flags & DBEF_READ) && !(dbei.flags & DBEF_SENT)) {
- wchar_t *szEventText = DbGetEventTextW(&dbei, CP_ACP);
+ wchar_t *szEventText = DbEvent_GetTextW(&dbei, CP_ACP);
if (szEventText) {
nEventsSent++;
mir_free(szEventText);
@@ -569,7 +569,7 @@ int CJabberProto::AdhocForwardHandler(HXML, CJabberIqInfo *pInfo, CJabberAdhocSe
if (dbei.eventType != EVENTTYPE_MESSAGE || (dbei.flags & (DBEF_READ | DBEF_SENT)))
continue;
- ptrW szEventText( DbGetEventTextW(&dbei, CP_ACP));
+ ptrW szEventText( DbEvent_GetTextW(&dbei, CP_ACP));
if (szEventText == NULL)
continue;
diff --git a/protocols/JabberG/src/jabber_svc.cpp b/protocols/JabberG/src/jabber_svc.cpp
index 29b2cef6b5..9b9e75ff57 100644
--- a/protocols/JabberG/src/jabber_svc.cpp
+++ b/protocols/JabberG/src/jabber_svc.cpp
@@ -175,15 +175,15 @@ INT_PTR __cdecl CJabberProto::JabberGetAvatarInfo(WPARAM wParam, LPARAM lParam)
////////////////////////////////////////////////////////////////////////////////////////
// JabberGetEventTextChatStates - retrieves a chat state description from an event
-INT_PTR __cdecl CJabberProto::OnGetEventTextChatStates(WPARAM, LPARAM lParam)
+INT_PTR __cdecl CJabberProto::OnGetEventTextChatStates(WPARAM pEvent, LPARAM datatype)
{
- DBEVENTGETTEXT *pdbEvent = (DBEVENTGETTEXT *)lParam;
- if (pdbEvent->dbei->cbBlob > 0) {
- if (pdbEvent->dbei->pBlob[0] == JABBER_DB_EVENT_CHATSTATES_GONE) {
- if (pdbEvent->datatype == DBVT_WCHAR)
+ DBEVENTINFO *dbei = (DBEVENTINFO *)pEvent;
+ if (dbei->cbBlob > 0) {
+ if (dbei->pBlob[0] == JABBER_DB_EVENT_CHATSTATES_GONE) {
+ if (datatype == DBVT_WCHAR)
return (INT_PTR)mir_wstrdup(TranslateT("closed chat session"));
- else if (pdbEvent->datatype == DBVT_ASCIIZ)
- return (INT_PTR)mir_strdup(Translate("closed chat session"));
+
+ return (INT_PTR)mir_strdup(Translate("closed chat session"));
}
}
@@ -193,52 +193,40 @@ INT_PTR __cdecl CJabberProto::OnGetEventTextChatStates(WPARAM, LPARAM lParam)
////////////////////////////////////////////////////////////////////////////////////////
// OnGetEventTextPresence - retrieves presence state description from an event
-INT_PTR __cdecl CJabberProto::OnGetEventTextPresence(WPARAM, LPARAM lParam)
+INT_PTR __cdecl CJabberProto::OnGetEventTextPresence(WPARAM pEvent, LPARAM datatype)
{
- DBEVENTGETTEXT *pdbEvent = (DBEVENTGETTEXT *)lParam;
- if (pdbEvent->dbei->cbBlob > 0) {
- switch (pdbEvent->dbei->pBlob[0]) {
+ DBEVENTINFO *dbei = (DBEVENTINFO *)pEvent;
+ if (dbei->cbBlob > 0) {
+ switch (dbei->pBlob[0]) {
case JABBER_DB_EVENT_PRESENCE_SUBSCRIBE:
- if (pdbEvent->datatype == DBVT_WCHAR)
+ if (datatype == DBVT_WCHAR)
return (INT_PTR)mir_wstrdup(TranslateT("sent subscription request"));
- else if (pdbEvent->datatype == DBVT_ASCIIZ)
- return (INT_PTR)mir_strdup(Translate("sent subscription request"));
- break;
+ return (INT_PTR)mir_strdup(Translate("sent subscription request"));
case JABBER_DB_EVENT_PRESENCE_SUBSCRIBED:
- if (pdbEvent->datatype == DBVT_WCHAR)
+ if (datatype == DBVT_WCHAR)
return (INT_PTR)mir_wstrdup(TranslateT("approved subscription request"));
- else if (pdbEvent->datatype == DBVT_ASCIIZ)
- return (INT_PTR)mir_strdup(Translate("approved subscription request"));
- break;
+ return (INT_PTR)mir_strdup(Translate("approved subscription request"));
case JABBER_DB_EVENT_PRESENCE_UNSUBSCRIBE:
- if (pdbEvent->datatype == DBVT_WCHAR)
+ if (datatype == DBVT_WCHAR)
return (INT_PTR)mir_wstrdup(TranslateT("declined subscription"));
- else if (pdbEvent->datatype == DBVT_ASCIIZ)
- return (INT_PTR)mir_strdup(Translate("declined subscription"));
- break;
+ return (INT_PTR)mir_strdup(Translate("declined subscription"));
case JABBER_DB_EVENT_PRESENCE_UNSUBSCRIBED:
- if (pdbEvent->datatype == DBVT_WCHAR)
+ if (datatype == DBVT_WCHAR)
return (INT_PTR)mir_wstrdup(TranslateT("declined subscription"));
- else if (pdbEvent->datatype == DBVT_ASCIIZ)
- return (INT_PTR)mir_strdup(Translate("declined subscription"));
- break;
+ return (INT_PTR)mir_strdup(Translate("declined subscription"));
case JABBER_DB_EVENT_PRESENCE_ERROR:
- if (pdbEvent->datatype == DBVT_WCHAR)
+ if (datatype == DBVT_WCHAR)
return (INT_PTR)mir_wstrdup(TranslateT("sent error presence"));
- else if (pdbEvent->datatype == DBVT_ASCIIZ)
- return (INT_PTR)mir_strdup(Translate("sent error presence"));
- break;
+ return (INT_PTR)mir_strdup(Translate("sent error presence"));
default:
- if (pdbEvent->datatype == DBVT_WCHAR)
+ if (datatype == DBVT_WCHAR)
return (INT_PTR)mir_wstrdup(TranslateT("sent unknown presence type"));
- else if (pdbEvent->datatype == DBVT_ASCIIZ)
- return (INT_PTR)mir_strdup(Translate("sent unknown presence type"));
- break;
+ return (INT_PTR)mir_strdup(Translate("sent unknown presence type"));
}
}
diff --git a/protocols/MSN/src/msn_proto.cpp b/protocols/MSN/src/msn_proto.cpp
index 41e853830d..f66e293edd 100644
--- a/protocols/MSN/src/msn_proto.cpp
+++ b/protocols/MSN/src/msn_proto.cpp
@@ -1199,7 +1199,7 @@ int __cdecl CMsnProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM l
case EV_PROTO_ONERASE:
char szDbsettings[64];
mir_snprintf(szDbsettings, "%s_HTTPS", m_szModuleName);
- CallService(MS_DB_MODULE_DELETE, 0, (LPARAM)szDbsettings);
+ DbModule_Delete(0, szDbsettings);
break;
case EV_PROTO_ONCONTACTDELETED:
diff --git a/protocols/SkypeWeb/src/skype_db.cpp b/protocols/SkypeWeb/src/skype_db.cpp
index 01486d0729..b13aa96617 100644
--- a/protocols/SkypeWeb/src/skype_db.cpp
+++ b/protocols/SkypeWeb/src/skype_db.cpp
@@ -164,7 +164,7 @@ void CSkypeProto::InitDBEvents()
dbEventType.descr = Translate(cur.name);
dbEventType.flags |= cur.flags;
- CallService(MS_DB_EVENT_REGISTERTYPE, 0, (LPARAM)&dbEventType);
+ DbEvent_RegisterType(&dbEventType);
dbEventType.flags &= (~cur.flags);
}
diff --git a/protocols/SkypeWeb/src/skype_events.cpp b/protocols/SkypeWeb/src/skype_events.cpp
index cb9a8bf3bb..51c0d40137 100644
--- a/protocols/SkypeWeb/src/skype_events.cpp
+++ b/protocols/SkypeWeb/src/skype_events.cpp
@@ -18,19 +18,19 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "stdafx.h"
#define INVALID_DATA Translate("SkypeWeb error: Invalid data!")
-INT_PTR CSkypeProto::GetEventText(WPARAM, LPARAM lParam)
+INT_PTR CSkypeProto::GetEventText(WPARAM pEvent, LPARAM datatype)
{
- DBEVENTGETTEXT *pEvent = (DBEVENTGETTEXT *)lParam;
+ DBEVENTINFO *dbei = (DBEVENTINFO *)pEvent;
CMStringA szText;
- BOOL bUseBB = db_get_b(NULL, pEvent->dbei->szModule, "UseBBCodes", 1);
- switch (pEvent->dbei->eventType)
+ BOOL bUseBB = db_get_b(NULL, dbei->szModule, "UseBBCodes", 1);
+ switch (dbei->eventType)
{
case SKYPE_DB_EVENT_TYPE_EDITED_MESSAGE:
{
- JSONNode jMsg = JSONNode::parse((char*)pEvent->dbei->pBlob);
+ JSONNode jMsg = JSONNode::parse((char*)dbei->pBlob);
if (jMsg)
{
JSONNode &jOriginalMsg = jMsg["original_message"];
@@ -57,7 +57,7 @@ INT_PTR CSkypeProto::GetEventText(WPARAM, LPARAM lParam)
case SKYPE_DB_EVENT_TYPE_CALL_INFO:
{
- HXML xml = xmlParseString(ptrW(mir_utf8decodeW((char*)pEvent->dbei->pBlob)), 0, L"partlist");
+ HXML xml = xmlParseString(ptrW(mir_utf8decodeW((char*)dbei->pBlob)), 0, L"partlist");
if (xml != NULL)
{
ptrA type(mir_u2a(xmlGetAttrValue(xml, L"type")));
@@ -106,7 +106,7 @@ INT_PTR CSkypeProto::GetEventText(WPARAM, LPARAM lParam)
}
case SKYPE_DB_EVENT_TYPE_FILETRANSFER_INFO:
{
- HXML xml = xmlParseString(ptrW(mir_utf8decodeW((char*)pEvent->dbei->pBlob)), 0, L"files");
+ HXML xml = xmlParseString(ptrW(mir_utf8decodeW((char*)dbei->pBlob)), 0, L"files");
if (xml != NULL)
{
for (int i = 0; i < xmlGetChildCount(xml); i++)
@@ -130,13 +130,14 @@ INT_PTR CSkypeProto::GetEventText(WPARAM, LPARAM lParam)
{
szText = INVALID_DATA;
}
- break;
}
+ break;
+
case SKYPE_DB_EVENT_TYPE_FILE:
case SKYPE_DB_EVENT_TYPE_MOJI:
case SKYPE_DB_EVENT_TYPE_URIOBJ:
{
- HXML xml = xmlParseString(ptrW(mir_utf8decodeW((char*)pEvent->dbei->pBlob)), 0, L"URIObject");
+ HXML xml = xmlParseString(ptrW(mir_utf8decodeW((char*)dbei->pBlob)), 0, L"URIObject");
if (xml != NULL)
{
//szText.Append(_T2A(xmlGetText(xml)));
@@ -151,45 +152,22 @@ INT_PTR CSkypeProto::GetEventText(WPARAM, LPARAM lParam)
{
szText = INVALID_DATA;
}
- break;
-
}
+ break;
case SKYPE_DB_EVENT_TYPE_INCOMING_CALL:
- {
- szText = Translate("Incoming call");
- break;
- }
+ szText = Translate("Incoming call");
+ break;
+
case SKYPE_DB_EVENT_TYPE_UNKNOWN:
- {
- szText.Format(Translate("Unknown event, please send this text for developer: \"%s\""), mir_utf8decodeA((char*)pEvent->dbei->pBlob));
- break;
- }
- default:
- {
- szText = ptrA(mir_utf8decodeA((char*)pEvent->dbei->pBlob));
- }
- }
+ szText.Format(Translate("Unknown event, please send this text for developer: \"%s\""), mir_utf8decodeA((char*)dbei->pBlob));
+ break;
- switch(pEvent->datatype)
- {
- case DBVT_WCHAR:
- {
- return (INT_PTR)mir_a2u(szText);
- }
- case DBVT_ASCIIZ:
- {
- return (INT_PTR)szText.Detach();
- }
- case DBVT_UTF8:
- {
- return (INT_PTR)mir_utf8encode(szText);
- }
default:
- {
- return NULL;
- }
+ szText = ptrA(mir_utf8decodeA((char*)dbei->pBlob));
}
+
+ return (datatype == DBVT_WCHAR) ? (INT_PTR)mir_a2u(szText) : (INT_PTR)szText.Detach();
}
INT_PTR CSkypeProto::EventGetIcon(WPARAM wParam, LPARAM lParam)
diff --git a/protocols/Steam/src/steam_events.cpp b/protocols/Steam/src/steam_events.cpp
index 0303a9a08a..b545ec2808 100644
--- a/protocols/Steam/src/steam_events.cpp
+++ b/protocols/Steam/src/steam_events.cpp
@@ -13,8 +13,7 @@ int CSteamProto::OnModulesLoaded(WPARAM, LPARAM)
dbEventType.module = m_szModuleName;
dbEventType.eventType = EVENTTYPE_STEAM_CHATSTATES;
dbEventType.descr = "Chat state notifications";
- CallService(MS_DB_EVENT_REGISTERTYPE, 0, (LPARAM)&dbEventType);
-
+ DbEvent_RegisterType(&dbEventType);
return 0;
}
diff --git a/protocols/Steam/src/steam_utils.cpp b/protocols/Steam/src/steam_utils.cpp
index 0fb7f4474d..9a3633953f 100644
--- a/protocols/Steam/src/steam_utils.cpp
+++ b/protocols/Steam/src/steam_utils.cpp
@@ -184,17 +184,16 @@ void CSteamProto::ShowNotification(const wchar_t *message, int flags, MCONTACT h
ShowNotification(MODULEW, message, flags, hContact);
}
-INT_PTR __cdecl CSteamProto::OnGetEventTextChatStates(WPARAM, LPARAM lParam)
+INT_PTR __cdecl CSteamProto::OnGetEventTextChatStates(WPARAM pEvent, LPARAM datatype)
{
// Retrieves a chat state description from an event
- DBEVENTGETTEXT *pdbEvent = (DBEVENTGETTEXT *)lParam;
- if (pdbEvent->dbei->cbBlob > 0) {
- if (pdbEvent->dbei->pBlob[0] == STEAM_DB_EVENT_CHATSTATES_GONE) {
- if (pdbEvent->datatype == DBVT_WCHAR)
+ DBEVENTINFO *dbei = (DBEVENTINFO *)pEvent;
+ if (dbei->cbBlob > 0) {
+ if (dbei->pBlob[0] == STEAM_DB_EVENT_CHATSTATES_GONE) {
+ if (datatype == DBVT_WCHAR)
return (INT_PTR)mir_wstrdup(TranslateT("closed chat session"));
- else if (pdbEvent->datatype == DBVT_ASCIIZ)
- return (INT_PTR)mir_strdup(Translate("closed chat session"));
+ return (INT_PTR)mir_strdup(Translate("closed chat session"));
}
}
diff --git a/protocols/Tox/src/tox_events.cpp b/protocols/Tox/src/tox_events.cpp
index fe1cb7abe5..9454085f55 100644
--- a/protocols/Tox/src/tox_events.cpp
+++ b/protocols/Tox/src/tox_events.cpp
@@ -24,10 +24,10 @@ void CToxProto::InitCustomDbEvents()
dbEventType.eventType = DB_EVENT_ACTION;
dbEventType.descr = Translate("Action");
- CallService(MS_DB_EVENT_REGISTERTYPE, 0, (LPARAM)&dbEventType);
+ DbEvent_RegisterType(&dbEventType);
dbEventType.eventType = DB_EVENT_CALL;
dbEventType.descr = Translate("Call");
dbEventType.eventIcon = GetIconHandle(IDI_AUDIO_START);
- CallService(MS_DB_EVENT_REGISTERTYPE, 0, (LPARAM)&dbEventType);
+ DbEvent_RegisterType(&dbEventType);
} \ No newline at end of file
diff --git a/protocols/Twitter/src/proto.cpp b/protocols/Twitter/src/proto.cpp
index bfe83fcb81..763d269344 100644
--- a/protocols/Twitter/src/proto.cpp
+++ b/protocols/Twitter/src/proto.cpp
@@ -348,7 +348,7 @@ int TwitterProto::OnModulesLoaded(WPARAM, LPARAM)
evt.module = m_szModuleName;
evt.descr = "Tweet";
evt.flags = DETF_HISTORY | DETF_MSGWINDOW;
- CallService(MS_DB_EVENT_REGISTERTYPE, 0, reinterpret_cast<LPARAM>(&evt));
+ DbEvent_RegisterType(&evt);
SetAllContactStatuses(ID_STATUS_OFFLINE); // In case we crashed last time
return 0;