diff options
author | George Hazan <george.hazan@gmail.com> | 2016-09-14 18:01:49 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2016-09-14 18:01:49 +0000 |
commit | 7bdb598e26e7e98788933af43090d34027166969 (patch) | |
tree | 65c215c0693c86134e471f0746e9726b645b51bb /protocols/IcqOscarJ/src | |
parent | 9f285a935709f4dda1065d6450739476168c43af (diff) |
second major wipeout of database services & structures:
- DBCONTACTENUMSETTINGS removed;
- all helpers moved to mir_core.dll
git-svn-id: http://svn.miranda-ng.org/main/trunk@17296 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/IcqOscarJ/src')
-rw-r--r-- | protocols/IcqOscarJ/src/fam_01service.cpp | 2 | ||||
-rw-r--r-- | protocols/IcqOscarJ/src/fam_03buddy.cpp | 2 | ||||
-rw-r--r-- | protocols/IcqOscarJ/src/icq_proto.cpp | 8 | ||||
-rw-r--r-- | protocols/IcqOscarJ/src/icq_servlist.cpp | 24 | ||||
-rw-r--r-- | protocols/IcqOscarJ/src/icq_uploadui.cpp | 7 | ||||
-rw-r--r-- | protocols/IcqOscarJ/src/utilities.cpp | 6 |
6 files changed, 15 insertions, 34 deletions
diff --git a/protocols/IcqOscarJ/src/fam_01service.cpp b/protocols/IcqOscarJ/src/fam_01service.cpp index faec561278..412dec2b39 100644 --- a/protocols/IcqOscarJ/src/fam_01service.cpp +++ b/protocols/IcqOscarJ/src/fam_01service.cpp @@ -470,7 +470,7 @@ char* CIcqProto::buildUinList(int subtype, size_t wMaxLen, MCONTACT *hContactRes WORD wCurrentLen = 0;
int add;
- char *szList = (char*)SAFE_MALLOC(CallService(MS_DB_CONTACT_GETCOUNT, 0, 0) * UINMAXLEN);
+ char *szList = (char*)SAFE_MALLOC(db_get_contact_count() * UINMAXLEN);
char szLen[2];
szLen[1] = '\0';
diff --git a/protocols/IcqOscarJ/src/fam_03buddy.cpp b/protocols/IcqOscarJ/src/fam_03buddy.cpp index f78ba6541c..21978f1886 100644 --- a/protocols/IcqOscarJ/src/fam_03buddy.cpp +++ b/protocols/IcqOscarJ/src/fam_03buddy.cpp @@ -520,7 +520,7 @@ void CIcqProto::handleUserOnline(BYTE *buf, size_t wLen, serverthread_info*) AddToSpammerList(dwUIN);
if (getByte("PopupsSpamEnabled", DEFAULT_SPAM_POPUPS_ENABLED))
ShowPopupMsg(hContact, LPGEN("Spambot Detected"), LPGEN("Contact deleted & further events blocked."), POPTYPE_SPAM);
- CallService(MS_DB_CONTACT_DELETE, hContact, 0);
+ db_delete_contact(hContact);
debugLogA("Contact %u deleted", dwUIN);
}
diff --git a/protocols/IcqOscarJ/src/icq_proto.cpp b/protocols/IcqOscarJ/src/icq_proto.cpp index 91d2014802..d9ed1b32dd 100644 --- a/protocols/IcqOscarJ/src/icq_proto.cpp +++ b/protocols/IcqOscarJ/src/icq_proto.cpp @@ -415,7 +415,7 @@ int CIcqProto::AuthDeny(MEVENT hDbEvent, const wchar_t* szReason) icq_sendAuthResponseServ(uin, uid, 0, szReason);
if (db_get_b(hContact, "CList", "NotOnList", 0))
- CallService(MS_DB_CONTACT_DELETE, hContact, 0);
+ db_delete_contact(hContact);
return 0; // Success
}
@@ -1862,11 +1862,11 @@ int __cdecl CIcqProto::OnEvent(PROTOEVENTTYPE eventType, WPARAM wParam, LPARAM l {
char szDbSetting[MAX_PATH];
mir_snprintf(szDbSetting, "%sP2P", m_szModuleName);
- DbModule_Delete(0, szDbSetting);
+ db_delete_module(0, szDbSetting);
mir_snprintf(szDbSetting, "%sSrvGroups", m_szModuleName);
- DbModule_Delete(0, szDbSetting);
+ db_delete_module(0, szDbSetting);
mir_snprintf(szDbSetting, "%sGroups", m_szModuleName);
- DbModule_Delete(0, szDbSetting);
+ db_delete_module(0, szDbSetting);
}
break;
diff --git a/protocols/IcqOscarJ/src/icq_servlist.cpp b/protocols/IcqOscarJ/src/icq_servlist.cpp index 9c9ae7a703..2a031977e5 100644 --- a/protocols/IcqOscarJ/src/icq_servlist.cpp +++ b/protocols/IcqOscarJ/src/icq_servlist.cpp @@ -854,11 +854,7 @@ void CIcqProto::LoadServerIDs() mir_snprintf(szModule, "%sSrvGroups", m_szModuleName);
GroupReserveIdsEnumParam param = { this, szModule };
- DBCONTACTENUMSETTINGS dbces = { 0 };
- dbces.pfnEnumProc = &GroupReserveIdsEnumProc;
- dbces.szModule = szModule;
- dbces.lParam = (LPARAM)¶m;
- CallService(MS_DB_CONTACT_ENUMSETTINGS, 0, (LPARAM)&dbces);
+ db_enum_settings(NULL, &GroupReserveIdsEnumProc, szModule, ¶m);
nGroups = nServerIDListCount - nStart;
@@ -1180,7 +1176,7 @@ int CIcqProto::IsServerGroupsDefined() // flush obsolete linking data
mir_snprintf(szModule, "%sGroups", m_szModuleName);
- DbModule_Delete(0, szModule);
+ db_delete_module(0, szModule);
iRes = 0; // no groups defined, or older version
}
@@ -1194,7 +1190,7 @@ void CIcqProto::FlushSrvGroupsCache() {
char szModule[MAX_PATH];
mir_snprintf(szModule, "%sSrvGroups", m_szModuleName);
- DbModule_Delete(0, szModule);
+ db_delete_module(0, szModule);
}
// Look thru DB and collect all ContactIDs from a group
@@ -1279,12 +1275,7 @@ void CIcqProto::removeGroupPathLinks(WORD wGroupID) pars[1] = (char*)wGroupID;
pars[2] = szModule;
- DBCONTACTENUMSETTINGS dbces = { 0 };
- dbces.pfnEnumProc = &GroupLinksEnumProc;
- dbces.szModule = szModule;
- dbces.lParam = (LPARAM)pars;
-
- if (!CallService(MS_DB_CONTACT_ENUMSETTINGS, 0, (LPARAM)&dbces)) { // we found some links, remove them
+ if (!db_enum_settings(NULL, &GroupLinksEnumProc, szModule, pars)) { // we found some links, remove them
char** list = (char**)pars[0];
while (list) {
void* bet;
@@ -1515,7 +1506,6 @@ static int SrvGroupNamesEnumProc(const char *szSetting, LPARAM lParam) char* CIcqProto::getServListUniqueGroupName(const char *szGroupName, int bAlloced)
{
// enum ICQSrvGroups and create unique name if neccessary
- DBCONTACTENUMSETTINGS dbces;
char szModule[MAX_PATH];
char *pars[4];
int uniqueID = 1;
@@ -1533,11 +1523,7 @@ char* CIcqProto::getServListUniqueGroupName(const char *szGroupName, int bAlloce pars[1] = NULL;
pars[2] = szNewGroupName ? szNewGroupName : szGroupNameBase;
pars[3] = szModule;
-
- dbces.pfnEnumProc = &SrvGroupNamesEnumProc;
- dbces.szModule = szModule;
- dbces.lParam = (LPARAM)pars;
- CallService(MS_DB_CONTACT_ENUMSETTINGS, 0, (LPARAM)&dbces);
+ db_enum_settings(NULL, &SrvGroupNamesEnumProc, szModule, pars);
if (pars[1]) { // the groupname already exists, create another
SAFE_FREE((void**)&szNewGroupName);
diff --git a/protocols/IcqOscarJ/src/icq_uploadui.cpp b/protocols/IcqOscarJ/src/icq_uploadui.cpp index b99b17b95e..021331a978 100644 --- a/protocols/IcqOscarJ/src/icq_uploadui.cpp +++ b/protocols/IcqOscarJ/src/icq_uploadui.cpp @@ -150,12 +150,7 @@ static void enumServerGroups(CIcqProto* ppro) {
char szModule[MAX_PATH + 9];
mir_snprintf(szModule, "%s%s", ppro->m_szModuleName, "SrvGroups");
-
- DBCONTACTENUMSETTINGS dbces = { 0 };
- dbces.pfnEnumProc = &GroupEnumIdsEnumProc;
- dbces.szModule = szModule;
- dbces.lParam = (LPARAM)szModule;
- CallService(MS_DB_CONTACT_ENUMSETTINGS, 0, (LPARAM)&dbces);
+ db_enum_settings(NULL, &GroupEnumIdsEnumProc, szModule, szModule);
}
static DWORD sendUploadGroup(CIcqProto* ppro, WORD wAction, WORD wGroupId, char* szItemName)
diff --git a/protocols/IcqOscarJ/src/utilities.cpp b/protocols/IcqOscarJ/src/utilities.cpp index 3ecc78a9df..d15779ae08 100644 --- a/protocols/IcqOscarJ/src/utilities.cpp +++ b/protocols/IcqOscarJ/src/utilities.cpp @@ -442,7 +442,7 @@ MCONTACT CIcqProto::HContactFromUIN(DWORD dwUin, int *Added) if (Added) {
debugLogA("Attempt to create ICQ contact %u", dwUin);
- hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
+ hContact = db_add_contact();
if (!hContact) {
debugLogA("Failed to create ICQ contact %u", dwUin);
return INVALID_CONTACT_ID;
@@ -450,7 +450,7 @@ MCONTACT CIcqProto::HContactFromUIN(DWORD dwUin, int *Added) if (Proto_AddToContact(hContact, m_szModuleName) != 0) {
// For some reason we failed to register the protocol to this contact
- CallService(MS_DB_CONTACT_DELETE, hContact, 0);
+ db_delete_contact(hContact);
debugLogA("Failed to register ICQ contact %u", dwUin);
return INVALID_CONTACT_ID;
}
@@ -515,7 +515,7 @@ MCONTACT CIcqProto::HContactFromUID(DWORD dwUin, const char *szUid, int *Added) if (Added) {
debugLogA("Attempt to create ICQ contact by string <%s>", szUid);
- hContact = (MCONTACT)CallService(MS_DB_CONTACT_ADD, 0, 0);
+ hContact = db_add_contact();
Proto_AddToContact(hContact, m_szModuleName);
setString(hContact, UNIQUEIDSETTING, szUid);
|