From 1949517360bffdb5fa747f3ed5f4ec4e78c14905 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 10 Jul 2013 20:22:55 +0000 Subject: protocol DB helpers for ICQ git-svn-id: http://svn.miranda-ng.org/main/trunk@5317 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/IcqOscarJ/src/changeinfo/db.cpp | 6 ++-- protocols/IcqOscarJ/src/fam_02location.cpp | 2 +- protocols/IcqOscarJ/src/fam_03buddy.cpp | 12 ++++---- protocols/IcqOscarJ/src/fam_13servclist.cpp | 24 ++++++++-------- protocols/IcqOscarJ/src/fam_15icqserver.cpp | 28 +++++++++--------- protocols/IcqOscarJ/src/icq_avatar.cpp | 4 +-- protocols/IcqOscarJ/src/icq_proto.cpp | 2 +- protocols/IcqOscarJ/src/icq_server.cpp | 2 +- protocols/IcqOscarJ/src/icq_servlist.cpp | 8 +++--- protocols/IcqOscarJ/src/icq_xstatus.cpp | 14 ++++----- protocols/IcqOscarJ/src/icqosc_svcs.cpp | 4 +-- protocols/IcqOscarJ/src/stdpackets.cpp | 2 +- protocols/IcqOscarJ/src/utilities.cpp | 44 ++++++++++++++--------------- 13 files changed, 76 insertions(+), 76 deletions(-) (limited to 'protocols/IcqOscarJ/src') diff --git a/protocols/IcqOscarJ/src/changeinfo/db.cpp b/protocols/IcqOscarJ/src/changeinfo/db.cpp index b5d4e81348..552ca3fce7 100644 --- a/protocols/IcqOscarJ/src/changeinfo/db.cpp +++ b/protocols/IcqOscarJ/src/changeinfo/db.cpp @@ -168,7 +168,7 @@ int ChangeInfoData::SaveSettingsToDb(HWND hwndDlg) if (!settingData[i].changed) continue; if (!(setting[i].displayType & LIF_ZEROISVALID) && settingData[i].value==0) { - db_unset(NULL, ppro->m_szModuleName, setting[i].szDbSetting); + ppro->delSetting(setting[i].szDbSetting); continue; } switch(setting[i].dbType) { @@ -195,7 +195,7 @@ int ChangeInfoData::SaveSettingsToDb(HWND hwndDlg) if (*(char*)settingData[i].value) db_set_utf(NULL, ppro->m_szModuleName, setting[i].szDbSetting, (char*)settingData[i].value); else - db_unset(NULL, ppro->m_szModuleName, setting[i].szDbSetting); + ppro->delSetting(setting[i].szDbSetting); } break; @@ -203,7 +203,7 @@ int ChangeInfoData::SaveSettingsToDb(HWND hwndDlg) if (*(char*)settingData[i].value) db_set_utf(NULL, ppro->m_szModuleName, setting[i].szDbSetting, (char*)settingData[i].value); else - db_unset(NULL, ppro->m_szModuleName, setting[i].szDbSetting); + ppro->delSetting(setting[i].szDbSetting); break; case DBVT_WORD: diff --git a/protocols/IcqOscarJ/src/fam_02location.cpp b/protocols/IcqOscarJ/src/fam_02location.cpp index 0c7c563fe3..5b3fcf07a2 100644 --- a/protocols/IcqOscarJ/src/fam_02location.cpp +++ b/protocols/IcqOscarJ/src/fam_02location.cpp @@ -188,7 +188,7 @@ void CIcqProto::handleLocationUserInfoReply(BYTE* buf, WORD wLen, DWORD dwCookie if (pTLV && pTLV->wLen > 0) // store client capabilities db_set_blob(hContact, m_szModuleName, "CapBuf", pTLV->pData, pTLV->wLen); else - db_unset(hContact, m_szModuleName, "CapBuf"); + delSetting(hContact, "CapBuf"); pTLV = pChain->getTLV(0x01, 1); if (pTLV && (pTLV->wLen >= 1)) diff --git a/protocols/IcqOscarJ/src/fam_03buddy.cpp b/protocols/IcqOscarJ/src/fam_03buddy.cpp index 0d5010bb74..b6baeda2d0 100644 --- a/protocols/IcqOscarJ/src/fam_03buddy.cpp +++ b/protocols/IcqOscarJ/src/fam_03buddy.cpp @@ -504,10 +504,10 @@ void CIcqProto::handleUserOnline(BYTE *buf, WORD wLen, serverthread_info *info) } else { - db_unset(hContact, m_szModuleName, "DirectCookie"); - db_unset(hContact, m_szModuleName, "DCType"); - db_unset(hContact, m_szModuleName, "UserPort"); - db_unset(hContact, m_szModuleName, "Version"); + delSetting(hContact, "DirectCookie"); + delSetting(hContact, "DCType"); + delSetting(hContact, "UserPort"); + delSetting(hContact, "Version"); } if (!szClient) @@ -747,7 +747,7 @@ void CIcqProto::parseStatusNote(DWORD dwUin, char *szUid, HANDLE hContact, oscar if (szStatusNote) db_set_utf(hContact, m_szModuleName, DBSETTING_STATUS_NOTE, szStatusNote); else - db_unset(hContact, m_szModuleName, DBSETTING_STATUS_NOTE); + delSetting(hContact, DBSETTING_STATUS_NOTE); setDword(hContact, DBSETTING_STATUS_NOTE_TIME, dwStatusNoteTS); if (getContactXStatus(hContact) != 0 || !CheckContactCapabilities(hContact, CAPF_STATUS_MESSAGES)) { @@ -765,7 +765,7 @@ void CIcqProto::parseStatusNote(DWORD dwUin, char *szUid, HANDLE hContact, oscar if (getContactStatus(hContact) == ID_STATUS_OFFLINE) { setStatusMsgVar(hContact, NULL, false); - db_unset(hContact, m_szModuleName, DBSETTING_STATUS_NOTE); + delSetting(hContact, DBSETTING_STATUS_NOTE); setDword(hContact, DBSETTING_STATUS_NOTE_TIME, dwStatusNoteTS); } } diff --git a/protocols/IcqOscarJ/src/fam_13servclist.cpp b/protocols/IcqOscarJ/src/fam_13servclist.cpp index 7f94637781..331fff18ab 100644 --- a/protocols/IcqOscarJ/src/fam_13servclist.cpp +++ b/protocols/IcqOscarJ/src/fam_13servclist.cpp @@ -678,8 +678,8 @@ void CIcqProto::handleServerCListAck(cookie_servlist_action* sc, WORD wError) } else // contact was deleted from server-list { - db_unset(sc->hContact, m_szModuleName, DBSETTING_SERVLIST_ID); - db_unset(sc->hContact, m_szModuleName, DBSETTING_SERVLIST_GROUP); + delSetting(sc->hContact, DBSETTING_SERVLIST_ID); + delSetting(sc->hContact, DBSETTING_SERVLIST_GROUP); FreeServerID(sc->wContactId, SSIT_ITEM); // release old contact id sc->lParam = 1; sc = NULL; // wait for second ack @@ -727,7 +727,7 @@ void CIcqProto::handleServerCListAck(cookie_servlist_action* sc, WORD wError) if (sc->wGroupId) // is avatar added or updated? { FreeServerID(sc->wContactId, SSIT_ITEM); - db_unset(NULL, m_szModuleName, DBSETTING_SERVLIST_AVATAR); // to fix old versions + delSetting(DBSETTING_SERVLIST_AVATAR); // to fix old versions } } else @@ -743,7 +743,7 @@ void CIcqProto::handleServerCListAck(cookie_servlist_action* sc, WORD wError) else { FreeServerID(sc->wContactId, SSIT_ITEM); - db_unset(NULL, m_szModuleName, DBSETTING_SERVLIST_AVATAR); + delSetting(DBSETTING_SERVLIST_AVATAR); } break; } @@ -759,7 +759,7 @@ void CIcqProto::handleServerCListAck(cookie_servlist_action* sc, WORD wError) else { setWord("SrvImportID", 0); - db_unset(NULL, m_szModuleName, "ImportTS"); + delSetting("ImportTS"); } break; } @@ -1104,8 +1104,8 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server } else { - db_unset(hContact, m_szModuleName, DBSETTING_METAINFO_TOKEN); - db_unset(hContact, m_szModuleName, DBSETTING_METAINFO_TIME); + delSetting(hContact, DBSETTING_METAINFO_TOKEN); + delSetting(hContact, DBSETTING_METAINFO_TIME); } { // store server-list item's TLV data @@ -1115,7 +1115,7 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server if (datalen > 0) setSettingBlob(hContact, DBSETTING_SERVLIST_DATA, data, datalen); else - db_unset(hContact, m_szModuleName, DBSETTING_SERVLIST_DATA); + delSetting(hContact, DBSETTING_SERVLIST_DATA); SAFE_FREE((void**)&data); } @@ -1546,7 +1546,7 @@ void CIcqProto::handleServerCListItemUpdate(const char *szRecordName, WORD wGrou if (datalen > 0) setSettingBlob(hContact, DBSETTING_SERVLIST_DATA, data, datalen); else - db_unset(hContact, m_szModuleName, DBSETTING_SERVLIST_DATA); + delSetting(hContact, DBSETTING_SERVLIST_DATA); } } } @@ -1592,9 +1592,9 @@ void CIcqProto::handleServerCListItemDelete(const char *szRecordName, WORD wGrou { // a contact was removed from our list if (getWord(hContact, DBSETTING_SERVLIST_ID, 0) == wItemId) { - db_unset(hContact, m_szModuleName, DBSETTING_SERVLIST_ID); - db_unset(hContact, m_szModuleName, DBSETTING_SERVLIST_GROUP); - db_unset(hContact, m_szModuleName, "Auth"); + delSetting(hContact, DBSETTING_SERVLIST_ID); + delSetting(hContact, DBSETTING_SERVLIST_GROUP); + delSetting(hContact, "Auth"); { char str[MAX_PATH]; diff --git a/protocols/IcqOscarJ/src/fam_15icqserver.cpp b/protocols/IcqOscarJ/src/fam_15icqserver.cpp index 890bd8fc41..15754aac18 100644 --- a/protocols/IcqOscarJ/src/fam_15icqserver.cpp +++ b/protocols/IcqOscarJ/src/fam_15icqserver.cpp @@ -620,7 +620,7 @@ int CIcqProto::parseUserInfoRecord(HANDLE hContact, oscar_tlv *pData, UserInfoRe for (int j = 0; j < nRecordDef; j++) { char szItemKey[MAX_PATH]; null_snprintf(szItemKey, MAX_PATH, pRecordDef[j].szDbSetting, i); - db_unset(hContact, m_szModuleName, szItemKey); + delSetting(hContact, szItemKey); } return nRecords; @@ -925,20 +925,20 @@ void CIcqProto::parseDirectoryUserDetailsData(HANDLE hContact, oscar_tlv_chain * } else { // Remove old data when phones not available - db_unset(hContact, m_szModuleName, "Phone"); - db_unset(hContact, m_szModuleName, "CompanyPhone"); - db_unset(hContact, m_szModuleName, "Cellular"); - db_unset(hContact, m_szModuleName, "Fax"); - db_unset(hContact, m_szModuleName, "CompanyFax"); + delSetting(hContact, "Phone"); + delSetting(hContact, "CompanyPhone"); + delSetting(hContact, "Cellular"); + delSetting(hContact, "Fax"); + delSetting(hContact, "CompanyFax"); } } else { // Remove old data when phones not available - db_unset(hContact, m_szModuleName, "Phone"); - db_unset(hContact, m_szModuleName, "CompanyPhone"); - db_unset(hContact, m_szModuleName, "Cellular"); - db_unset(hContact, m_szModuleName, "Fax"); - db_unset(hContact, m_szModuleName, "CompanyFax"); + delSetting(hContact, "Phone"); + delSetting(hContact, "CompanyPhone"); + delSetting(hContact, "Cellular"); + delSetting(hContact, "Fax"); + delSetting(hContact, "CompanyFax"); } // Emails parseUserInfoRecord(hContact, cDetails->getTLV(0x8C, 1), rEmail, SIZEOF(rEmail), 4); @@ -958,7 +958,7 @@ void CIcqProto::parseDirectoryUserDetailsData(HANDLE hContact, oscar_tlv_chain * setByte(hContact, "Gender", 'M'); break; default: - db_unset(hContact, m_szModuleName, "Gender"); + delSetting(hContact, "Gender"); } writeDbInfoSettingTLVStringUtf(hContact, "Homepage", cDetails, 0xFA); @@ -1010,10 +1010,10 @@ void CIcqProto::parseDirectoryUserDetailsData(HANDLE hContact, oscar_tlv_chain * if (nAge) setWord(hContact, "Age", nAge); else - db_unset(hContact, m_szModuleName, "Age"); + delSetting(hContact, "Age"); } else // we do not need to calculate age for owner - db_unset(hContact, m_szModuleName, "Age"); + delSetting(hContact, "Age"); { // Save user info last update time and privacy token double dInfoTime; diff --git a/protocols/IcqOscarJ/src/icq_avatar.cpp b/protocols/IcqOscarJ/src/icq_avatar.cpp index 47f04ed32c..d13cc23067 100644 --- a/protocols/IcqOscarJ/src/icq_avatar.cpp +++ b/protocols/IcqOscarJ/src/icq_avatar.cpp @@ -604,7 +604,7 @@ void CIcqProto::handleAvatarContactHash(DWORD dwUIN, char *szUID, HANDLE hContac db_free(&dbv); NetLog_Server("%s has removed Avatar.", strUID(dwUIN, szUID)); - db_unset(hContact, m_szModuleName, "AvatarHash"); + delSetting(hContact, "AvatarHash"); ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_STATUS, NULL, 0); } #ifdef _DEBUG @@ -755,7 +755,7 @@ void CIcqProto::handleAvatarContactHash(DWORD dwUIN, char *szUID, HANDLE hContac db_free(&dbv); NetLog_Server("%s has removed Avatar.", strUID(dwUIN, szUID)); - db_unset(hContact, m_szModuleName, "AvatarHash"); + delSetting(hContact, "AvatarHash"); ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_STATUS, NULL, 0); } #ifdef _DEBUG diff --git a/protocols/IcqOscarJ/src/icq_proto.cpp b/protocols/IcqOscarJ/src/icq_proto.cpp index 04260b55df..a48b7ac990 100644 --- a/protocols/IcqOscarJ/src/icq_proto.cpp +++ b/protocols/IcqOscarJ/src/icq_proto.cpp @@ -443,7 +443,7 @@ int CIcqProto::Authorize( HANDLE hDbEvent ) icq_sendAuthResponseServ(uin, uid, 1, _T("")); - db_unset(hContact, m_szModuleName, "Grant"); + delSetting(hContact, "Grant"); return 0; // Success } diff --git a/protocols/IcqOscarJ/src/icq_server.cpp b/protocols/IcqOscarJ/src/icq_server.cpp index 4a4aebba2e..53a5420944 100644 --- a/protocols/IcqOscarJ/src/icq_server.cpp +++ b/protocols/IcqOscarJ/src/icq_server.cpp @@ -95,7 +95,7 @@ void __cdecl CIcqProto::ServerThread(serverthread_start_info *infoParam) { icq_LogUsingErrorCode(LOG_WARNING, GetLastError(), LPGEN("Miranda was unable to allocate a port to listen for direct peer-to-peer connections between clients. You will be able to use most of the ICQ network without problems but you may be unable to send or receive files.\n\nIf you have a firewall this may be blocking Miranda, in which case you should configure your firewall to leave some ports open and tell Miranda which ports to use in M->Options->ICQ->Network.")); wListenPort = 0; - if (!bConstInternalIP) db_unset(NULL, m_szModuleName, "RealIP"); + if (!bConstInternalIP) delSetting("RealIP"); } else if (!bConstInternalIP) setDword("RealIP", dwInternalIP); diff --git a/protocols/IcqOscarJ/src/icq_servlist.cpp b/protocols/IcqOscarJ/src/icq_servlist.cpp index ee23a072c5..f76e1b3f72 100644 --- a/protocols/IcqOscarJ/src/icq_servlist.cpp +++ b/protocols/IcqOscarJ/src/icq_servlist.cpp @@ -1068,7 +1068,7 @@ void CIcqProto::StoreServerIDs() /// TODO: allow delayed if (pUnhandled) setSettingBlob(NULL, DBSETTING_SERVLIST_UNHANDLED, pUnhandled, cbUnhandled); else - db_unset(NULL, m_szModuleName, DBSETTING_SERVLIST_UNHANDLED); + delSetting(DBSETTING_SERVLIST_UNHANDLED); SAFE_FREE((void**)&pUnhandled); } @@ -2611,9 +2611,9 @@ void CIcqProto::resetServContactAuthState(HANDLE hContact, DWORD dwUin) void *doubleObject = NULL; icq_sendServerContact(hContact, dwCookie, ICQ_LISTS_REMOVEFROMLIST, wGroupId, wContactId, SSO_CONTACT_FIXAUTH | SSOF_BEGIN_OPERATION | SSOF_END_OPERATION, 200, &doubleObject); - db_unset(hContact, m_szModuleName, DBSETTING_METAINFO_TOKEN); - db_unset(hContact, m_szModuleName, DBSETTING_METAINFO_TIME); - db_unset(hContact, m_szModuleName, DBSETTING_SERVLIST_DATA); + delSetting(hContact, DBSETTING_METAINFO_TOKEN); + delSetting(hContact, DBSETTING_METAINFO_TIME); + delSetting(hContact, DBSETTING_SERVLIST_DATA); icq_sendServerContact(hContact, dwCookie, ICQ_LISTS_ADDTOLIST, wGroupId, wContactId, SSO_CONTACT_FIXAUTH | SSOF_BEGIN_OPERATION | SSOF_END_OPERATION, 200, &doubleObject); } } diff --git a/protocols/IcqOscarJ/src/icq_xstatus.cpp b/protocols/IcqOscarJ/src/icq_xstatus.cpp index 9f6222bf8e..fcf52931da 100644 --- a/protocols/IcqOscarJ/src/icq_xstatus.cpp +++ b/protocols/IcqOscarJ/src/icq_xstatus.cpp @@ -428,7 +428,7 @@ void CIcqProto::handleXStatusCaps(DWORD dwUIN, char *szUID, HANDLE hContact, BYT if (nOldXStatusID != bXStatusId) { setByte(hContact, DBSETTING_XSTATUS_ID, bXStatusId); db_set_utf(hContact, m_szModuleName, DBSETTING_XSTATUS_NAME, ICQTranslateUtfStatic(nameXStatus[i], str, MAX_PATH)); - db_unset(hContact, m_szModuleName, DBSETTING_XSTATUS_MSG); + delSetting(hContact, DBSETTING_XSTATUS_MSG); NetLog_Server("%s changed mood to %s.", strUID(dwUIN, szUID), ICQTranslateUtfStatic(nameXStatus[i], str, MAX_PATH)); bChanged = TRUE; @@ -461,7 +461,7 @@ void CIcqProto::handleXStatusCaps(DWORD dwUIN, char *szUID, HANDLE hContact, BYT if (nMoodID == 0 && nOldXStatusID != bXStatusId) { setByte(hContact, DBSETTING_XSTATUS_ID, bXStatusId); db_set_utf(hContact, m_szModuleName, DBSETTING_XSTATUS_NAME, ICQTranslateUtfStatic(nameXStatus[i], str, MAX_PATH)); - db_unset(hContact, m_szModuleName, DBSETTING_XSTATUS_MSG); + delSetting(hContact, DBSETTING_XSTATUS_MSG); NetLog_Server("%s changed custom status to %s.", strUID(dwUIN, szUID), ICQTranslateUtfStatic(nameXStatus[i], str, MAX_PATH)); bChanged = TRUE; @@ -486,9 +486,9 @@ void CIcqProto::handleXStatusCaps(DWORD dwUIN, char *szUID, HANDLE hContact, BYT if ((nCustomStatusID == 0 && (caps || !m_bXStatusEnabled)) && (nMoodID == 0 && (moods || !m_bMoodsEnabled))) { if (getByte(hContact, DBSETTING_XSTATUS_ID, -1) != -1) bChanged = TRUE; - db_unset(hContact, m_szModuleName, DBSETTING_XSTATUS_ID); - db_unset(hContact, m_szModuleName, DBSETTING_XSTATUS_NAME); - db_unset(hContact, m_szModuleName, DBSETTING_XSTATUS_MSG); + delSetting(hContact, DBSETTING_XSTATUS_ID); + delSetting(hContact, DBSETTING_XSTATUS_NAME); + delSetting(hContact, DBSETTING_XSTATUS_MSG); } if (m_bXStatusEnabled != 10 && m_bMoodsEnabled != 10) @@ -823,8 +823,8 @@ void CIcqProto::setXStatusEx(BYTE bXStatus, BYTE bQuiet) } else { setByte(DBSETTING_XSTATUS_ID, bXStatus); - db_unset(NULL, m_szModuleName, DBSETTING_XSTATUS_NAME); - db_unset(NULL, m_szModuleName, DBSETTING_XSTATUS_MSG); + delSetting(DBSETTING_XSTATUS_NAME); + delSetting(DBSETTING_XSTATUS_MSG); updateServerCustomStatus(TRUE); } diff --git a/protocols/IcqOscarJ/src/icqosc_svcs.cpp b/protocols/IcqOscarJ/src/icqosc_svcs.cpp index 1bb0b08f11..40d6503022 100644 --- a/protocols/IcqOscarJ/src/icqosc_svcs.cpp +++ b/protocols/IcqOscarJ/src/icqosc_svcs.cpp @@ -476,7 +476,7 @@ INT_PTR CIcqProto::GrantAuthorization(WPARAM wParam, LPARAM lParam) // send without reason, do we need any ? icq_sendGrantAuthServ(dwUin, szUid, NULL); // auth granted, remove contact menu item - db_unset((HANDLE)wParam, m_szModuleName, "Grant"); + delSetting((HANDLE)wParam, "Grant"); } return 0; @@ -607,7 +607,7 @@ INT_PTR CIcqProto::SetMyAvatar(WPARAM wParam, LPARAM lParam) } else { // delete user avatar - db_unset(NULL, m_szModuleName, "AvatarFile"); + delSetting("AvatarFile"); setSettingBlob(NULL, "AvatarHash", hashEmptyAvatar, 9); updateServAvatarHash(hashEmptyAvatar, 9); // set blank avatar iRet = 0; diff --git a/protocols/IcqOscarJ/src/stdpackets.cpp b/protocols/IcqOscarJ/src/stdpackets.cpp index 9aaa159ec9..69d9fd2ac1 100644 --- a/protocols/IcqOscarJ/src/stdpackets.cpp +++ b/protocols/IcqOscarJ/src/stdpackets.cpp @@ -1636,7 +1636,7 @@ void CIcqProto::icq_sendChangeVisInvis(HANDLE hContact, DWORD dwUin, char* szUID { icq_removeServerPrivacyItem(hContact, dwUin, szUID, wContactId, wType); - db_unset(hContact, m_szModuleName, szSetting); + delSetting(hContact, szSetting); } } } diff --git a/protocols/IcqOscarJ/src/utilities.cpp b/protocols/IcqOscarJ/src/utilities.cpp index b98dd5034d..9d8aa40321 100644 --- a/protocols/IcqOscarJ/src/utilities.cpp +++ b/protocols/IcqOscarJ/src/utilities.cpp @@ -964,7 +964,7 @@ void CIcqProto::ResetSettingsOnListReload() setWord(DBSETTING_SERVLIST_AVATAR, 0); setWord(DBSETTING_SERVLIST_PHOTO, 0); setWord("SrvRecordCount", 0); - db_unset(NULL, m_szModuleName, DBSETTING_SERVLIST_UNHANDLED); + delSetting(DBSETTING_SERVLIST_UNHANDLED); HANDLE hContact = FindFirstContact(); @@ -975,9 +975,9 @@ void CIcqProto::ResetSettingsOnListReload() setWord(hContact, DBSETTING_SERVLIST_GROUP, 0); setWord(hContact, DBSETTING_SERVLIST_PERMIT, 0); setWord(hContact, DBSETTING_SERVLIST_DENY, 0); - db_unset(hContact, m_szModuleName, DBSETTING_SERVLIST_IGNORE); + delSetting(hContact, DBSETTING_SERVLIST_IGNORE); setByte(hContact, "Auth", 0); - db_unset(hContact, m_szModuleName, DBSETTING_SERVLIST_DATA); + delSetting(hContact, DBSETTING_SERVLIST_DATA); hContact = FindNextContact(hContact); } @@ -1024,9 +1024,9 @@ void CIcqProto::ResetSettingsOnLoad() { setWord(hContact, "Status", ID_STATUS_OFFLINE); - db_unset(hContact, m_szModuleName, DBSETTING_XSTATUS_ID); - db_unset(hContact, m_szModuleName, DBSETTING_XSTATUS_NAME); - db_unset(hContact, m_szModuleName, DBSETTING_XSTATUS_MSG); + delSetting(hContact, DBSETTING_XSTATUS_ID); + delSetting(hContact, DBSETTING_XSTATUS_NAME); + delSetting(hContact, DBSETTING_XSTATUS_MSG); } setByte(hContact, "DCStatus", 0); @@ -1369,7 +1369,7 @@ void CIcqProto::writeDbInfoSettingTLVStringUtf(HANDLE hContact, const char *szSe db_set_utf(hContact, m_szModuleName, szSetting, str); } else - db_unset(hContact, m_szModuleName, szSetting); + delSetting(hContact, szSetting); } @@ -1380,7 +1380,7 @@ void CIcqProto::writeDbInfoSettingTLVWord(HANDLE hContact, const char *szSetting if (num > 0) setWord(hContact, szSetting, num); else - db_unset(hContact, m_szModuleName, szSetting); + delSetting(hContact, szSetting); } @@ -1391,7 +1391,7 @@ void CIcqProto::writeDbInfoSettingTLVByte(HANDLE hContact, const char *szSetting if (num > 0) setByte(hContact, szSetting, num); else - db_unset(hContact, m_szModuleName, szSetting); + delSetting(hContact, szSetting); } @@ -1402,7 +1402,7 @@ void CIcqProto::writeDbInfoSettingTLVDouble(HANDLE hContact, const char *szSetti if (num > 0) setSettingDouble(hContact, szSetting, num); else - db_unset(hContact, m_szModuleName, szSetting); + delSetting(hContact, szSetting); } void CIcqProto::writeDbInfoSettingTLVDate(HANDLE hContact, const char* szSettingYear, const char* szSettingMonth, const char* szSettingDay, oscar_tlv_chain* chain, WORD wTlv) @@ -1420,16 +1420,16 @@ void CIcqProto::writeDbInfoSettingTLVDate(HANDLE hContact, const char* szSetting } else { - db_unset(hContact, m_szModuleName, szSettingYear); - db_unset(hContact, m_szModuleName, szSettingMonth); - db_unset(hContact, m_szModuleName, szSettingDay); + delSetting(hContact, szSettingYear); + delSetting(hContact, szSettingMonth); + delSetting(hContact, szSettingDay); } } else { - db_unset(hContact, m_szModuleName, szSettingYear); - db_unset(hContact, m_szModuleName, szSettingMonth); - db_unset(hContact, m_szModuleName, szSettingDay); + delSetting(hContact, szSettingYear); + delSetting(hContact, szSettingMonth); + delSetting(hContact, szSettingDay); } } @@ -1441,7 +1441,7 @@ void CIcqProto::writeDbInfoSettingTLVBlob(HANDLE hContact, const char *szSetting if (pTLV && pTLV->wLen > 0) setSettingBlob(hContact, szSetting, pTLV->pData, pTLV->wLen); else - db_unset(hContact, m_szModuleName, szSetting); + delSetting(hContact, szSetting); } @@ -1478,7 +1478,7 @@ BOOL CIcqProto::writeDbInfoSettingString(HANDLE hContact, const char* szSetting, setString(hContact, szSetting, *buf); } else - db_unset(hContact, m_szModuleName, szSetting); + delSetting(hContact, szSetting); *buf += wLen; *pwLength -= wLen; @@ -1500,7 +1500,7 @@ BOOL CIcqProto::writeDbInfoSettingWord(HANDLE hContact, const char *szSetting, c if (wVal != 0) setWord(hContact, szSetting, wVal); else - db_unset(hContact, m_szModuleName, szSetting); + delSetting(hContact, szSetting); return TRUE; } @@ -1521,7 +1521,7 @@ BOOL CIcqProto::writeDbInfoSettingWordWithTable(HANDLE hContact, const char *szS if (text) db_set_utf(hContact, m_szModuleName, szSetting, text); else - db_unset(hContact, m_szModuleName, szSetting); + delSetting(hContact, szSetting); return TRUE; } @@ -1539,7 +1539,7 @@ BOOL CIcqProto::writeDbInfoSettingByte(HANDLE hContact, const char *pszSetting, if (byVal != 0) setByte(hContact, pszSetting, byVal); else - db_unset(hContact, m_szModuleName, pszSetting); + delSetting(hContact, pszSetting); return TRUE; } @@ -1560,7 +1560,7 @@ BOOL CIcqProto::writeDbInfoSettingByteWithTable(HANDLE hContact, const char *szS if (text) db_set_utf(hContact, m_szModuleName, szSetting, text); else - db_unset(hContact, m_szModuleName, szSetting); + delSetting(hContact, szSetting); return TRUE; } -- cgit v1.2.3