From f51995e13679a37851baef8e7f52f2d993cbc7c1 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 13 Sep 2016 17:11:58 +0000 Subject: mode old database junk to die git-svn-id: http://svn.miranda-ng.org/main/trunk@17291 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/IcqOscarJ/src/icq_avatar.cpp | 2 +- protocols/IcqOscarJ/src/icq_proto.cpp | 8 ++++---- protocols/IcqOscarJ/src/icq_servlist.cpp | 5 ++--- protocols/IcqOscarJ/src/icqosc_svcs.cpp | 15 +++++++-------- 4 files changed, 14 insertions(+), 16 deletions(-) (limited to 'protocols/IcqOscarJ') 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)); } -- cgit v1.2.3