summaryrefslogtreecommitdiff
path: root/protocols/IcqOscarJ
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-07-09 22:02:18 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-07-09 22:02:18 +0000
commitd5d50b471277d5d69f59a8f29bf87201149ce191 (patch)
tree92d10ad5b0a1116ba08eca98cf025cb07578784e /protocols/IcqOscarJ
parent9dd56da9d9ccbce2f1e1539acb5cfcad7650916a (diff)
applied protocol helpers
git-svn-id: http://svn.miranda-ng.org/main/trunk@5305 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/IcqOscarJ')
-rw-r--r--protocols/IcqOscarJ/src/UI/loginpassword.cpp4
-rw-r--r--protocols/IcqOscarJ/src/UI/userinfotab.cpp4
-rw-r--r--protocols/IcqOscarJ/src/capabilities.cpp20
-rw-r--r--protocols/IcqOscarJ/src/chan_05ping.cpp4
-rw-r--r--protocols/IcqOscarJ/src/changeinfo/db.cpp27
-rw-r--r--protocols/IcqOscarJ/src/changeinfo/upload.cpp2
-rw-r--r--protocols/IcqOscarJ/src/cookies.cpp2
-rw-r--r--protocols/IcqOscarJ/src/directpackets.cpp2
-rw-r--r--protocols/IcqOscarJ/src/fam_01service.cpp30
-rw-r--r--protocols/IcqOscarJ/src/fam_02location.cpp4
-rw-r--r--protocols/IcqOscarJ/src/fam_03buddy.cpp64
-rw-r--r--protocols/IcqOscarJ/src/fam_04message.cpp34
-rw-r--r--protocols/IcqOscarJ/src/fam_09bos.cpp4
-rw-r--r--protocols/IcqOscarJ/src/fam_13servclist.cpp136
-rw-r--r--protocols/IcqOscarJ/src/fam_15icqserver.cpp38
-rw-r--r--protocols/IcqOscarJ/src/icq_avatar.cpp22
-rw-r--r--protocols/IcqOscarJ/src/icq_db.cpp91
-rw-r--r--protocols/IcqOscarJ/src/icq_db.h8
-rw-r--r--protocols/IcqOscarJ/src/icq_direct.cpp30
-rw-r--r--protocols/IcqOscarJ/src/icq_filetransfer.cpp2
-rw-r--r--protocols/IcqOscarJ/src/icq_firstrun.cpp4
-rw-r--r--protocols/IcqOscarJ/src/icq_menu.cpp10
-rw-r--r--protocols/IcqOscarJ/src/icq_opts.cpp64
-rw-r--r--protocols/IcqOscarJ/src/icq_packet.cpp6
-rw-r--r--protocols/IcqOscarJ/src/icq_popups.cpp98
-rw-r--r--protocols/IcqOscarJ/src/icq_proto.cpp32
-rw-r--r--protocols/IcqOscarJ/src/icq_proto.h14
-rw-r--r--protocols/IcqOscarJ/src/icq_server.cpp12
-rw-r--r--protocols/IcqOscarJ/src/icq_servlist.cpp94
-rw-r--r--protocols/IcqOscarJ/src/icq_uploadui.cpp56
-rw-r--r--protocols/IcqOscarJ/src/icq_xstatus.cpp70
-rw-r--r--protocols/IcqOscarJ/src/icq_xtraz.cpp4
-rw-r--r--protocols/IcqOscarJ/src/icqosc_svcs.cpp52
-rw-r--r--protocols/IcqOscarJ/src/init.cpp30
-rw-r--r--protocols/IcqOscarJ/src/log.cpp6
-rw-r--r--protocols/IcqOscarJ/src/oscar_filetransfer.cpp10
-rw-r--r--protocols/IcqOscarJ/src/stdpackets.cpp14
-rw-r--r--protocols/IcqOscarJ/src/utilities.cpp154
38 files changed, 577 insertions, 681 deletions
diff --git a/protocols/IcqOscarJ/src/UI/loginpassword.cpp b/protocols/IcqOscarJ/src/UI/loginpassword.cpp
index 0699a686b4..5263af17a2 100644
--- a/protocols/IcqOscarJ/src/UI/loginpassword.cpp
+++ b/protocols/IcqOscarJ/src/UI/loginpassword.cpp
@@ -52,7 +52,7 @@ INT_PTR CALLBACK LoginPasswdDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
SendDlgItemMessage(hwndDlg, IDC_LOGINPW, EM_LIMITTEXT, PASSWORDMAXLEN - 1, 0);
- CheckDlgButton(hwndDlg, IDC_SAVEPASS, ppro->getSettingByte(NULL, "RememberPass", 0));
+ CheckDlgButton(hwndDlg, IDC_SAVEPASS, ppro->getByte("RememberPass", 0));
}
break;
@@ -69,7 +69,7 @@ INT_PTR CALLBACK LoginPasswdDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA
switch (LOWORD(wParam)) {
case IDOK:
ppro->m_bRememberPwd = (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SAVEPASS);
- ppro->setSettingByte(NULL, "RememberPass", ppro->m_bRememberPwd);
+ ppro->setByte("RememberPass", ppro->m_bRememberPwd);
GetDlgItemTextA(hwndDlg, IDC_LOGINPW, ppro->m_szPassword, sizeof(ppro->m_szPassword));
diff --git a/protocols/IcqOscarJ/src/UI/userinfotab.cpp b/protocols/IcqOscarJ/src/UI/userinfotab.cpp
index 50ee92ce24..7224196744 100644
--- a/protocols/IcqOscarJ/src/UI/userinfotab.cpp
+++ b/protocols/IcqOscarJ/src/UI/userinfotab.cpp
@@ -245,8 +245,8 @@ static INT_PTR CALLBACK IcqDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM
SetValue(ppro, hwndDlg, IDC_PORT, hContact, szProto, "UserPort", SVS_ZEROISUNSPEC);
SetValue(ppro, hwndDlg, IDC_VERSION, hContact, szProto, "Version", SVS_ICQVERSION);
SetValue(ppro, hwndDlg, IDC_MIRVER, hContact, szProto, "MirVer", SVS_ZEROISUNSPEC);
- if (ppro->getSettingByte(hContact, "ClientID", 0))
- ppro->setSettingDword(hContact, "TickTS", 0);
+ if (ppro->getByte(hContact, "ClientID", 0))
+ ppro->setDword(hContact, "TickTS", 0);
SetValue(ppro, hwndDlg, IDC_SYSTEMUPTIME, hContact, szProto, "TickTS", SVS_TIMESTAMP);
SetValue(ppro, hwndDlg, IDC_STATUS, hContact, szProto, "Status", SVS_STATUSID);
}
diff --git a/protocols/IcqOscarJ/src/capabilities.cpp b/protocols/IcqOscarJ/src/capabilities.cpp
index f994f861af..4c374ed492 100644
--- a/protocols/IcqOscarJ/src/capabilities.cpp
+++ b/protocols/IcqOscarJ/src/capabilities.cpp
@@ -104,7 +104,7 @@ void NetLog_CapabilityChange(CIcqProto *ppro, const char *szChange, DWORD fdwCap
// Deletes all oscar capabilities for a given contact
void CIcqProto::ClearAllContactCapabilities(HANDLE hContact)
{
- setSettingDword(hContact, DBSETTING_CAPABILITIES, 0);
+ setDword(hContact, DBSETTING_CAPABILITIES, 0);
}
@@ -112,7 +112,7 @@ void CIcqProto::ClearAllContactCapabilities(HANDLE hContact)
void CIcqProto::ClearContactCapabilities(HANDLE hContact, DWORD fdwCapabilities)
{
// Get current capability flags
- DWORD fdwContactCaps = getSettingDword(hContact, DBSETTING_CAPABILITIES, 0);
+ DWORD fdwContactCaps = getDword(hContact, DBSETTING_CAPABILITIES, 0);
if (fdwContactCaps != (fdwContactCaps & ~fdwCapabilities))
{
@@ -123,7 +123,7 @@ void CIcqProto::ClearContactCapabilities(HANDLE hContact, DWORD fdwCapabilities)
fdwContactCaps &= ~fdwCapabilities;
// And write it back to disk
- setSettingDword(hContact, DBSETTING_CAPABILITIES, fdwContactCaps);
+ setDword(hContact, DBSETTING_CAPABILITIES, fdwContactCaps);
}
}
@@ -132,7 +132,7 @@ void CIcqProto::ClearContactCapabilities(HANDLE hContact, DWORD fdwCapabilities)
void CIcqProto::SetContactCapabilities(HANDLE hContact, DWORD fdwCapabilities)
{
// Get current capability flags
- DWORD fdwContactCaps = getSettingDword(hContact, DBSETTING_CAPABILITIES, 0);
+ DWORD fdwContactCaps = getDword(hContact, DBSETTING_CAPABILITIES, 0);
if (fdwContactCaps != (fdwContactCaps | fdwCapabilities))
{
@@ -143,7 +143,7 @@ void CIcqProto::SetContactCapabilities(HANDLE hContact, DWORD fdwCapabilities)
fdwContactCaps |= fdwCapabilities;
// And write it back to disk
- setSettingDword(hContact, DBSETTING_CAPABILITIES, fdwContactCaps);
+ setDword(hContact, DBSETTING_CAPABILITIES, fdwContactCaps);
}
}
@@ -152,7 +152,7 @@ void CIcqProto::SetContactCapabilities(HANDLE hContact, DWORD fdwCapabilities)
BOOL CIcqProto::CheckContactCapabilities(HANDLE hContact, DWORD fdwCapabilities)
{
// Get current capability flags
- DWORD fdwContactCaps = getSettingDword(hContact, DBSETTING_CAPABILITIES, 0);
+ DWORD fdwContactCaps = getDword(hContact, DBSETTING_CAPABILITIES, 0);
// Check if all requested capabilities are supported
if ((fdwContactCaps & fdwCapabilities) == fdwCapabilities)
@@ -221,7 +221,7 @@ DWORD GetCapabilitiesFromBuffer(BYTE *pBuffer, int nLength)
void CIcqProto::AddCapabilitiesFromBuffer(HANDLE hContact, BYTE *pBuffer, int nLength)
{
// Get current capability flags
- DWORD fdwContactCaps = getSettingDword(hContact, DBSETTING_CAPABILITIES, 0);
+ DWORD fdwContactCaps = getDword(hContact, DBSETTING_CAPABILITIES, 0);
// Get capability flags from buffer
DWORD fdwCapabilities = GetCapabilitiesFromBuffer(pBuffer, nLength);
@@ -234,7 +234,7 @@ void CIcqProto::AddCapabilitiesFromBuffer(HANDLE hContact, BYTE *pBuffer, int nL
fdwContactCaps |= fdwCapabilities;
// And write them back to database
- setSettingDword(hContact, DBSETTING_CAPABILITIES, fdwContactCaps);
+ setDword(hContact, DBSETTING_CAPABILITIES, fdwContactCaps);
}
}
@@ -244,7 +244,7 @@ void CIcqProto::AddCapabilitiesFromBuffer(HANDLE hContact, BYTE *pBuffer, int nL
void CIcqProto::SetCapabilitiesFromBuffer(HANDLE hContact, BYTE *pBuffer, int nLength, BOOL bReset)
{
// Get current capability flags
- DWORD fdwContactCaps = bReset ? 0 : getSettingDword(hContact, DBSETTING_CAPABILITIES, 0);
+ DWORD fdwContactCaps = bReset ? 0 : getDword(hContact, DBSETTING_CAPABILITIES, 0);
// Get capability flags from buffer
DWORD fdwCapabilities = GetCapabilitiesFromBuffer(pBuffer, nLength);
@@ -266,6 +266,6 @@ void CIcqProto::SetCapabilitiesFromBuffer(HANDLE hContact, BYTE *pBuffer, int nL
fdwContactCaps |= fdwCapabilities;
// And write them back to database
- setSettingDword(hContact, DBSETTING_CAPABILITIES, fdwContactCaps);
+ setDword(hContact, DBSETTING_CAPABILITIES, fdwContactCaps);
}
}
diff --git a/protocols/IcqOscarJ/src/chan_05ping.cpp b/protocols/IcqOscarJ/src/chan_05ping.cpp
index cc28e5c185..e74071dc4b 100644
--- a/protocols/IcqOscarJ/src/chan_05ping.cpp
+++ b/protocols/IcqOscarJ/src/chan_05ping.cpp
@@ -40,7 +40,7 @@ void __cdecl CIcqProto::KeepAliveThread(void *arg)
{
serverthread_info *info = (serverthread_info*)arg;
icq_packet packet;
- DWORD dwInterval = getSettingDword(NULL, "KeepAliveInterval", KEEPALIVE_INTERVAL);
+ DWORD dwInterval = getDword("KeepAliveInterval", KEEPALIVE_INTERVAL);
NetLog_Server("Keep alive thread starting.");
@@ -77,7 +77,7 @@ void CIcqProto::StartKeepAlive(serverthread_info *info)
if (info->hKeepAliveEvent) // start only once
return;
- if (getSettingByte(NULL, "KeepAlive", DEFAULT_KEEPALIVE_ENABLED))
+ if (getByte("KeepAlive", DEFAULT_KEEPALIVE_ENABLED))
CloseHandle( ForkThreadEx(&CIcqProto::KeepAliveThread, info, 0));
}
diff --git a/protocols/IcqOscarJ/src/changeinfo/db.cpp b/protocols/IcqOscarJ/src/changeinfo/db.cpp
index ba231acebe..b5d4e81348 100644
--- a/protocols/IcqOscarJ/src/changeinfo/db.cpp
+++ b/protocols/IcqOscarJ/src/changeinfo/db.cpp
@@ -27,7 +27,6 @@
// -----------------------------------------------------------------------------
#include "icqoscar.h"
-
void ChangeInfoData::LoadSettingsFromDb(int keepChanged)
{
for (int i=0; i < settingCount; i++)
@@ -86,7 +85,6 @@ void ChangeInfoData::LoadSettingsFromDb(int keepChanged)
}
}
-
void ChangeInfoData::FreeStoredDbSettings(void)
{
for (int i=0; i < settingCount; i++ )
@@ -94,7 +92,6 @@ void ChangeInfoData::FreeStoredDbSettings(void)
SAFE_FREE((void**)&settingData[i].value);
}
-
int ChangeInfoData::ChangesMade(void)
{
for (int i=0; i < settingCount; i++ )
@@ -103,7 +100,6 @@ int ChangeInfoData::ChangesMade(void)
return 0;
}
-
void ChangeInfoData::ClearChangeFlags(void)
{
for (int i=0; i < settingCount; i++)
@@ -163,17 +159,16 @@ static INT_PTR CALLBACK PwConfirmDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
return FALSE;
}
-
int ChangeInfoData::SaveSettingsToDb(HWND hwndDlg)
{
int ret = 1;
for (int i = 0; i < settingCount; i++)
- {
+ {
if (!settingData[i].changed) continue;
if (!(setting[i].displayType & LIF_ZEROISVALID) && settingData[i].value==0)
- {
- ppro->deleteSetting(NULL, setting[i].szDbSetting);
+ {
+ db_unset(NULL, ppro->m_szModuleName, setting[i].szDbSetting);
continue;
}
switch(setting[i].dbType) {
@@ -198,25 +193,25 @@ int ChangeInfoData::SaveSettingsToDb(HWND hwndDlg)
}
else {
if (*(char*)settingData[i].value)
- ppro->setSettingStringUtf(NULL, setting[i].szDbSetting, (char*)settingData[i].value);
+ db_set_utf(NULL, ppro->m_szModuleName, setting[i].szDbSetting, (char*)settingData[i].value);
else
- ppro->deleteSetting(NULL, setting[i].szDbSetting);
+ db_unset(NULL, ppro->m_szModuleName, setting[i].szDbSetting);
}
break;
- case DBVT_UTF8:
+ case DBVT_UTF8:
if (*(char*)settingData[i].value)
- ppro->setSettingStringUtf(NULL, setting[i].szDbSetting, (char*)settingData[i].value);
+ db_set_utf(NULL, ppro->m_szModuleName, setting[i].szDbSetting, (char*)settingData[i].value);
else
- ppro->deleteSetting(NULL, setting[i].szDbSetting);
- break;
+ db_unset(NULL, ppro->m_szModuleName, setting[i].szDbSetting);
+ break;
case DBVT_WORD:
- ppro->setSettingWord(NULL, setting[i].szDbSetting, (WORD)settingData[i].value);
+ ppro->setWord(setting[i].szDbSetting, (WORD)settingData[i].value);
break;
case DBVT_BYTE:
- ppro->setSettingByte(NULL, setting[i].szDbSetting, (BYTE)settingData[i].value);
+ ppro->setByte(setting[i].szDbSetting, (BYTE)settingData[i].value);
break;
}
}
diff --git a/protocols/IcqOscarJ/src/changeinfo/upload.cpp b/protocols/IcqOscarJ/src/changeinfo/upload.cpp
index 165d65fa22..13d017e7cb 100644
--- a/protocols/IcqOscarJ/src/changeinfo/upload.cpp
+++ b/protocols/IcqOscarJ/src/changeinfo/upload.cpp
@@ -87,7 +87,7 @@ int ChangeInfoData::UploadSettings(void)
CallService(MS_DB_CRYPT_ENCODESTRING, sizeof(ptmp), (LPARAM)ptmp);
- ppro->setSettingString(NULL, "Password", ptmp);
+ ppro->setString("Password", ptmp);
}
}
}
diff --git a/protocols/IcqOscarJ/src/cookies.cpp b/protocols/IcqOscarJ/src/cookies.cpp
index 87ffb4bc07..36aa83c329 100644
--- a/protocols/IcqOscarJ/src/cookies.cpp
+++ b/protocols/IcqOscarJ/src/cookies.cpp
@@ -283,7 +283,7 @@ cookie_message_data* CIcqProto::CreateMessageCookieData(BYTE bMsgType, HANDLE hC
BYTE bAckType;
WORD wStatus = getContactStatus(hContact);
- if (!getSettingByte(hContact, "SlowSend", getSettingByte(NULL, "SlowSend", DEFAULT_SLOWSEND)) ||
+ if (!getByte(hContact, "SlowSend", getByte("SlowSend", DEFAULT_SLOWSEND)) ||
(!dwUin && wStatus == ID_STATUS_OFFLINE))
bAckType = ACKTYPE_NONE;
else if (bUseSrvRelay)
diff --git a/protocols/IcqOscarJ/src/directpackets.cpp b/protocols/IcqOscarJ/src/directpackets.cpp
index fa21a949d5..cf9f698500 100644
--- a/protocols/IcqOscarJ/src/directpackets.cpp
+++ b/protocols/IcqOscarJ/src/directpackets.cpp
@@ -81,7 +81,7 @@ DWORD CIcqProto::icq_sendGetAwayMsgDirect(HANDLE hContact, int type)
DWORD dwCookie;
cookie_message_data *pCookieData;
- if (getSettingWord(hContact, "Version", 0) == 9)
+ if (getWord(hContact, "Version", 0) == 9)
return 0; // v9 DC protocol does not support this message
pCookieData = CreateMessageCookie(MTYPE_AUTOAWAY, (BYTE)type);
diff --git a/protocols/IcqOscarJ/src/fam_01service.cpp b/protocols/IcqOscarJ/src/fam_01service.cpp
index a7c45d0e1c..3923e813c5 100644
--- a/protocols/IcqOscarJ/src/fam_01service.cpp
+++ b/protocols/IcqOscarJ/src/fam_01service.cpp
@@ -103,8 +103,8 @@ void CIcqProto::handleServiceFam(BYTE *pBuffer, WORD wBufferLength, snac_header
cookie_servlist_action* ack;
DWORD dwCookie;
- DWORD dwLastUpdate = getSettingDword(NULL, "SrvLastUpdate", 0);
- WORD wRecordCount = getSettingWord(NULL, "SrvRecordCount", 0);
+ DWORD dwLastUpdate = getDword("SrvLastUpdate", 0);
+ WORD wRecordCount = getWord("SrvRecordCount", 0);
// CLI_REQLISTS - we want to use SSI
#ifdef _DEBUG
@@ -294,14 +294,14 @@ void CIcqProto::handleServiceFam(BYTE *pBuffer, WORD wBufferLength, snac_header
// Save external IP
dwValue = chain->getDWord(0x0A, 1);
- setSettingDword(NULL, "IP", dwValue);
+ setDword("IP", dwValue);
// Save member since timestamp
dwValue = chain->getDWord(0x05, 1);
- if (dwValue) setSettingDword(NULL, "MemberTS", dwValue);
+ if (dwValue) setDword("MemberTS", dwValue);
dwValue = chain->getDWord(0x03, 1);
- setSettingDword(NULL, "LogonTS", dwValue ? dwValue : time(NULL));
+ setDword("LogonTS", dwValue ? dwValue : time(NULL));
disposeChain(&chain);
@@ -453,7 +453,7 @@ void CIcqProto::handleServiceFam(BYTE *pBuffer, WORD wBufferLength, snac_header
#endif
if (m_bAvatarsEnabled && !info->bMyAvatarInited) // signal the server after login
{ // this refreshes avatar state - it used to work automatically, but now it does not
- if (getSettingByte(NULL, "ForceOurAvatar", 0))
+ if (getByte("ForceOurAvatar", 0))
{ // keep our avatar
TCHAR *file = GetOwnAvatarFileName();
SetMyAvatar(0, (LPARAM)file);
@@ -557,18 +557,18 @@ char* CIcqProto::buildUinList(int subtype, WORD wMaxLen, HANDLE* hContactResume)
{
case BUL_VISIBLE:
- add = ID_STATUS_ONLINE == getSettingWord(hContact, "ApparentMode", 0);
+ add = ID_STATUS_ONLINE == getWord(hContact, "ApparentMode", 0);
break;
case BUL_INVISIBLE:
- add = ID_STATUS_OFFLINE == getSettingWord(hContact, "ApparentMode", 0);
+ add = ID_STATUS_OFFLINE == getWord(hContact, "ApparentMode", 0);
break;
case BUL_TEMPVISIBLE:
- add = getSettingByte(hContact, "TemporaryVisible", 0);
+ add = getByte(hContact, "TemporaryVisible", 0);
// clear temporary flag
// Here we assume that all temporary contacts will be in one packet
- setSettingByte(hContact, "TemporaryVisible", 0);
+ setByte(hContact, "TemporaryVisible", 0);
break;
default:
@@ -577,8 +577,8 @@ char* CIcqProto::buildUinList(int subtype, WORD wMaxLen, HANDLE* hContactResume)
// If we are in SS mode, we only add those contacts that are
// not in our SS list, or are awaiting authorization, to our
// client side list
- if (m_bSsiEnabled && getSettingWord(hContact, DBSETTING_SERVLIST_ID, 0) &&
- !getSettingByte(hContact, "Auth", 0))
+ if (m_bSsiEnabled && getWord(hContact, DBSETTING_SERVLIST_ID, 0) &&
+ !getByte(hContact, "Auth", 0))
add = 0;
// Never add hidden contacts to CS list
@@ -841,7 +841,7 @@ void CIcqProto::handleServUINSettings(int nPort, serverthread_info *info)
packWord(&packet, wStatus); // Status
packTLVWord(&packet, 0x0008, 0x0A06); // TLV 8: Independent Status Messages
packDWord(&packet, 0x000c0025); // TLV C: Direct connection info
- packDWord(&packet, getSettingDword(NULL, "RealIP", 0));
+ packDWord(&packet, getDword("RealIP", 0));
packDWord(&packet, nPort);
packByte(&packet, DC_TYPE); // TCP/FLAG firewall settings
packWord(&packet, ICQ_VERSION);
@@ -877,8 +877,8 @@ void CIcqProto::handleServUINSettings(int nPort, serverthread_info *info)
packBuffer(&packet, (LPBYTE)szMoodData, wStatusMoodLen); // Mood
// Save current status note & mood
- setSettingStringUtf(NULL, DBSETTING_STATUS_NOTE, szStatusNote);
- setSettingString(NULL, DBSETTING_STATUS_MOOD, szMoodData);
+ db_set_utf(NULL, m_szModuleName, DBSETTING_STATUS_NOTE, szStatusNote);
+ setString(DBSETTING_STATUS_MOOD, szMoodData);
}
// Release memory
SAFE_FREE(&szStatusNote);
diff --git a/protocols/IcqOscarJ/src/fam_02location.cpp b/protocols/IcqOscarJ/src/fam_02location.cpp
index 7687c18444..0c7c563fe3 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
- deleteSetting(hContact, "CapBuf");
+ db_unset(hContact, m_szModuleName, "CapBuf");
pTLV = pChain->getTLV(0x01, 1);
if (pTLV && (pTLV->wLen >= 1))
@@ -212,7 +212,7 @@ void CIcqProto::handleLocationUserInfoReply(BYTE* buf, WORD wLen, DWORD dwCookie
disposeChain(&pChain);
}
- setSettingString(hContact, "About", szMsg);
+ setString(hContact, "About", szMsg);
ProtoBroadcastAck(hContact, ACKTYPE_GETINFO, ACKRESULT_SUCCESS, (HANDLE)1 ,0);
SAFE_FREE((void**)&szMsg);
diff --git a/protocols/IcqOscarJ/src/fam_03buddy.cpp b/protocols/IcqOscarJ/src/fam_03buddy.cpp
index 020c8af1eb..0d5010bb74 100644
--- a/protocols/IcqOscarJ/src/fam_03buddy.cpp
+++ b/protocols/IcqOscarJ/src/fam_03buddy.cpp
@@ -488,26 +488,26 @@ void CIcqProto::handleUserOnline(BYTE *buf, WORD wLen, serverthread_info *info)
// Save contacts details in database
if (hContact != NULL)
{
- setSettingDword(hContact, "LogonTS", dwOnlineSince);
- setSettingDword(hContact, "AwayTS", dwAwaySince);
- setSettingDword(hContact, "IdleTS", tIdleTS);
+ setDword(hContact, "LogonTS", dwOnlineSince);
+ setDword(hContact, "AwayTS", dwAwaySince);
+ setDword(hContact, "IdleTS", tIdleTS);
if (dwMemberSince)
- setSettingDword(hContact, "MemberTS", dwMemberSince);
+ setDword(hContact, "MemberTS", dwMemberSince);
if (nIsICQ)
{ // on AIM these are not used
- setSettingDword(hContact, "DirectCookie", dwDirectConnCookie);
- setSettingByte(hContact, "DCType", (BYTE)nTCPFlag);
- setSettingWord(hContact, "UserPort", (WORD)(dwPort & 0xffff));
- setSettingWord(hContact, "Version", wVersion);
+ setDword(hContact, "DirectCookie", dwDirectConnCookie);
+ setByte(hContact, "DCType", (BYTE)nTCPFlag);
+ setWord(hContact, "UserPort", (WORD)(dwPort & 0xffff));
+ setWord(hContact, "Version", wVersion);
}
else
{
- deleteSetting(hContact, "DirectCookie");
- deleteSetting(hContact, "DCType");
- deleteSetting(hContact, "UserPort");
- deleteSetting(hContact, "Version");
+ db_unset(hContact, m_szModuleName, "DirectCookie");
+ db_unset(hContact, m_szModuleName, "DCType");
+ db_unset(hContact, m_szModuleName, "UserPort");
+ db_unset(hContact, m_szModuleName, "Version");
}
if (!szClient)
@@ -517,23 +517,23 @@ void CIcqProto::handleUserOnline(BYTE *buf, WORD wLen, serverthread_info *info)
}
if (szClient != (char*)-1)
{
- setSettingStringUtf(hContact, "MirVer", szClient);
- setSettingByte(hContact, "ClientID", bClientId);
+ db_set_utf(hContact, m_szModuleName, "MirVer", szClient);
+ setByte(hContact, "ClientID", bClientId);
}
if (wOldStatus == ID_STATUS_OFFLINE)
{
- setSettingDword(hContact, "IP", dwIP);
- setSettingDword(hContact, "RealIP", dwRealIP);
+ setDword(hContact, "IP", dwIP);
+ setDword(hContact, "RealIP", dwRealIP);
}
else
{ // if not first notification only write significant information
if (dwIP)
- setSettingDword(hContact, "IP", dwIP);
+ setDword(hContact, "IP", dwIP);
if (dwRealIP)
- setSettingDword(hContact, "RealIP", dwRealIP);
+ setDword(hContact, "RealIP", dwRealIP);
}
- setSettingWord(hContact, "Status", (WORD)IcqStatusToMiranda(wStatus));
+ setWord(hContact, "Status", (WORD)IcqStatusToMiranda(wStatus));
// Update info?
if (dwUIN)
@@ -562,12 +562,12 @@ void CIcqProto::handleUserOnline(BYTE *buf, WORD wLen, serverthread_info *info)
if (szClient == cliSpamBot)
{
- if (getSettingByte(NULL, "KillSpambots", DEFAULT_KILLSPAM_ENABLED) && db_get_b(hContact, "CList", "NotOnList", 0))
+ if (getByte("KillSpambots", DEFAULT_KILLSPAM_ENABLED) && db_get_b(hContact, "CList", "NotOnList", 0))
{ // kill spammer
icq_DequeueUser(dwUIN);
icq_sendRemoveContact(dwUIN, NULL);
AddToSpammerList(dwUIN);
- if (getSettingByte(NULL, "PopupsSpamEnabled", DEFAULT_SPAM_POPUPS_ENABLED))
+ 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, (WPARAM)hContact, 0);
@@ -649,8 +649,8 @@ void CIcqProto::handleUserOffline(BYTE *buf, WORD wLen)
parseStatusNote(dwUIN, szUID, hContact, pChain);
// Update status times
- setSettingDword(hContact, "IdleTS", 0);
- setSettingDword(hContact, "AwayTS", dwAwaySince);
+ setDword(hContact, "IdleTS", 0);
+ setDword(hContact, "AwayTS", dwAwaySince);
// Clear custom status & mood
char tmp = NULL;
@@ -660,11 +660,11 @@ void CIcqProto::handleUserOffline(BYTE *buf, WORD wLen)
{
NetLog_Server("%s went offline.", strUID(dwUIN, szUID));
- setSettingWord(hContact, "Status", ID_STATUS_OFFLINE);
+ setWord(hContact, "Status", ID_STATUS_OFFLINE);
// close Direct Connections to that user
CloseContactDirectConns(hContact);
// Reset DC status
- setSettingByte(hContact, "DCStatus", 0);
+ setByte(hContact, "DCStatus", 0);
}
#ifdef _DEBUG
else
@@ -735,20 +735,20 @@ void CIcqProto::parseStatusNote(DWORD dwUin, char *szUid, HANDLE hContact, oscar
}
}
// Check if the status note was changed
- if (dwStatusNoteTS > getSettingDword(hContact, DBSETTING_STATUS_NOTE_TIME, 0))
+ if (dwStatusNoteTS > getDword(hContact, DBSETTING_STATUS_NOTE_TIME, 0))
{
DBVARIANT dbv = {DBVT_DELETED};
- if (strlennull(szStatusNote) || (!getSettingString(hContact, DBSETTING_STATUS_NOTE, &dbv) && (dbv.type == DBVT_ASCIIZ || dbv.type == DBVT_UTF8) && strlennull(dbv.pszVal)))
+ if (strlennull(szStatusNote) || (!getString(hContact, DBSETTING_STATUS_NOTE, &dbv) && (dbv.type == DBVT_ASCIIZ || dbv.type == DBVT_UTF8) && strlennull(dbv.pszVal)))
NetLog_Server("%s changed status note to \"%s\"", strUID(dwUin, szUid), szStatusNote ? szStatusNote : "");
db_free(&dbv);
if (szStatusNote)
- setSettingStringUtf(hContact, DBSETTING_STATUS_NOTE, szStatusNote);
+ db_set_utf(hContact, m_szModuleName, DBSETTING_STATUS_NOTE, szStatusNote);
else
- deleteSetting(hContact, DBSETTING_STATUS_NOTE);
- setSettingDword(hContact, DBSETTING_STATUS_NOTE_TIME, dwStatusNoteTS);
+ db_unset(hContact, m_szModuleName, DBSETTING_STATUS_NOTE);
+ setDword(hContact, DBSETTING_STATUS_NOTE_TIME, dwStatusNoteTS);
if (getContactXStatus(hContact) != 0 || !CheckContactCapabilities(hContact, CAPF_STATUS_MESSAGES)) {
setStatusMsgVar(hContact, szStatusNote, false);
@@ -765,8 +765,8 @@ void CIcqProto::parseStatusNote(DWORD dwUin, char *szUid, HANDLE hContact, oscar
if (getContactStatus(hContact) == ID_STATUS_OFFLINE)
{
setStatusMsgVar(hContact, NULL, false);
- deleteSetting(hContact, DBSETTING_STATUS_NOTE);
- setSettingDword(hContact, DBSETTING_STATUS_NOTE_TIME, dwStatusNoteTS);
+ db_unset(hContact, m_szModuleName, DBSETTING_STATUS_NOTE);
+ setDword(hContact, DBSETTING_STATUS_NOTE_TIME, dwStatusNoteTS);
}
}
}
diff --git a/protocols/IcqOscarJ/src/fam_04message.cpp b/protocols/IcqOscarJ/src/fam_04message.cpp
index f4b39dd835..f43166a10c 100644
--- a/protocols/IcqOscarJ/src/fam_04message.cpp
+++ b/protocols/IcqOscarJ/src/fam_04message.cpp
@@ -202,7 +202,7 @@ void CIcqProto::handleRecvServMsg(BYTE *buf, WORD wLen, WORD wFlags, DWORD dwRef
char* CIcqProto::convertMsgToUserSpecificUtf(HANDLE hContact, const char *szMsg)
{
- WORD wCP = getSettingWord(hContact, "CodePage", m_wAnsiCodepage);
+ WORD wCP = getWord(hContact, "CodePage", m_wAnsiCodepage);
char *usMsg = NULL;
if (wCP != CP_ACP)
@@ -327,7 +327,7 @@ void CIcqProto::handleRecvServMsgType1(BYTE *buf, WORD wLen, DWORD dwUin, char *
{ // make the resulting message utf-8 encoded - need to append utf-8 encoded part
if (szMsg)
{ // not necessary to convert - appending first part, only set flags
- char *szUtfMsg = ansi_to_utf8_codepage(szMsg, getSettingWord(hContact, "CodePage", m_wAnsiCodepage));
+ char *szUtfMsg = ansi_to_utf8_codepage(szMsg, getWord(hContact, "CodePage", m_wAnsiCodepage));
SAFE_FREE(&szMsg);
szMsg = szUtfMsg;
@@ -336,7 +336,7 @@ void CIcqProto::handleRecvServMsgType1(BYTE *buf, WORD wLen, DWORD dwUin, char *
}
if (!bMsgPartUnicode && pre.flags == PREF_UTF)
{ // convert message part to utf-8 and append
- char *szUtfPart = ansi_to_utf8_codepage((char*)szMsgPart, getSettingWord(hContact, "CodePage", m_wAnsiCodepage));
+ char *szUtfPart = ansi_to_utf8_codepage((char*)szMsgPart, getWord(hContact, "CodePage", m_wAnsiCodepage));
SAFE_FREE(&szMsgPart);
szMsgPart = szUtfPart;
@@ -398,7 +398,7 @@ void CIcqProto::handleRecvServMsgType1(BYTE *buf, WORD wLen, DWORD dwUin, char *
NetLog_Server("Message (format 1) received");
// Save tick value
- setSettingDword(hContact, "TickTS", time(NULL) - (dwMsgID1/1000));
+ setDword(hContact, "TickTS", time(NULL) - (dwMsgID1/1000));
}
else NetLog_Server("Message (format %u) - Ignoring empty message", 1);
@@ -510,18 +510,18 @@ void CIcqProto::handleRecvServMsgType2(BYTE *buf, WORD wLen, DWORD dwUin, char *
WORD wPort;
if (dwExternalIP = chain->getDWord(0x03, 1))
- setSettingDword(hContact, "RealIP", dwExternalIP);
+ setDword(hContact, "RealIP", dwExternalIP);
if (dwIP = chain->getDWord(0x04, 1))
- setSettingDword(hContact, "IP", dwIP);
+ setDword(hContact, "IP", dwIP);
if (wPort = chain->getWord(0x05, 1))
- setSettingWord(hContact, "UserPort", wPort);
+ setWord(hContact, "UserPort", wPort);
// Save tick value
- BYTE bClientID = getSettingByte(hContact, "ClientID", 0);
+ BYTE bClientID = getByte(hContact, "ClientID", 0);
if (bClientID == CLID_GENERIC || bClientID == CLID_ICQ6)
- setSettingDword(hContact, "TickTS", time(NULL) - (dwMsgID1/1000));
+ setDword(hContact, "TickTS", time(NULL) - (dwMsgID1/1000));
else
- setSettingDword(hContact, "TickTS", 0);
+ setDword(hContact, "TickTS", 0);
}
// Parse the next message level
@@ -596,10 +596,10 @@ void CIcqProto::handleRecvServMsgType2(BYTE *buf, WORD wLen, DWORD dwUin, char *
unpackLEDWord(&buf, &dwPort);
unpackLEWord(&buf, &wVersion);
- setSettingDword(hContact, "IP", dwIp);
- setSettingWord(hContact, "UserPort", (WORD)dwPort);
- setSettingByte(hContact, "DCType", bMode);
- setSettingWord(hContact, "Version", wVersion);
+ setDword(hContact, "IP", dwIp);
+ setWord(hContact, "UserPort", (WORD)dwPort);
+ setByte(hContact, "DCType", bMode);
+ setWord(hContact, "Version", wVersion);
if (wVersion > 6)
{
cookie_reverse_connect *pCookie = (cookie_reverse_connect*)SAFE_MALLOC(sizeof(cookie_reverse_connect));
@@ -678,7 +678,7 @@ void CIcqProto::parseServRelayData(BYTE *pDataBuf, WORD wLen, HANDLE hContact, D
wLen -= 2;
if (hContact != INVALID_HANDLE_VALUE)
- setSettingWord(hContact, "Version", wVersion);
+ setWord(hContact, "Version", wVersion);
unpackDWord(&pDataBuf, &dwGuid1); // plugin type GUID
unpackDWord(&pDataBuf, &dwGuid2);
@@ -2524,7 +2524,7 @@ void CIcqProto::handleRecvMsgResponse(BYTE *buf, WORD wLen, WORD wFlags, DWORD d
}
NetLog_Server("Reverse Connect request failed");
// Set DC status to failed
- setSettingByte(hContact, "DCStatus", 2);
+ setByte(hContact, "DCStatus", 2);
ReleaseCookie(dwCookie);
}
@@ -2607,7 +2607,7 @@ void CIcqProto::handleRecvServMsgError(BYTE *buf, WORD wLen, WORD wFlags, DWORD
break;
}
// TODO: this needs better solution
- setSettingWord(hContact, "Status", ID_STATUS_OFFLINE);
+ setWord(hContact, "Status", ID_STATUS_OFFLINE);
}
pszErrorMessage = Translate("The user has logged off. Select 'Retry' to send an offline message.\r\nSNAC(4.1) Error x04");
break;
diff --git a/protocols/IcqOscarJ/src/fam_09bos.cpp b/protocols/IcqOscarJ/src/fam_09bos.cpp
index 327e045a96..daa7589c3e 100644
--- a/protocols/IcqOscarJ/src/fam_09bos.cpp
+++ b/protocols/IcqOscarJ/src/fam_09bos.cpp
@@ -90,7 +90,7 @@ void CIcqProto::makeContactTemporaryVisible(HANDLE hContact)
DWORD dwUin;
uid_str szUid;
- if (getSettingByte(hContact, "TemporaryVisible", 0))
+ if (getByte(hContact, "TemporaryVisible", 0))
return; // already there
if (getContactUid(hContact, &dwUin, &szUid))
@@ -98,7 +98,7 @@ void CIcqProto::makeContactTemporaryVisible(HANDLE hContact)
icq_sendGenericContact(dwUin, szUid, ICQ_BOS_FAMILY, ICQ_CLI_ADDTEMPVISIBLE);
- setSettingByte(hContact, "TemporaryVisible", 1);
+ setByte(hContact, "TemporaryVisible", 1);
#ifdef _DEBUG
NetLog_Server("Added contact %s to temporary visible list", strUID(dwUin, szUid));
diff --git a/protocols/IcqOscarJ/src/fam_13servclist.cpp b/protocols/IcqOscarJ/src/fam_13servclist.cpp
index d0f61d5e7c..7f94637781 100644
--- a/protocols/IcqOscarJ/src/fam_13servclist.cpp
+++ b/protocols/IcqOscarJ/src/fam_13servclist.cpp
@@ -419,7 +419,7 @@ void CIcqProto::handleServerCListAck(cookie_servlist_action* sc, WORD wError)
NetLog_Server("Contact could not be added without authorization, add with await auth flag.");
- setSettingByte(sc->hContact, "Auth", 1); // we need auth
+ setByte(sc->hContact, "Auth", 1); // we need auth
dwCookie = AllocateCookie(CKT_SERVERLIST, ICQ_LISTS_ADDTOLIST, sc->hContact, sc);
icq_sendServerContact(sc->hContact, dwCookie, ICQ_LISTS_ADDTOLIST, sc->wGroupId, sc->wContactId, SSOP_ITEM_ACTION | SSOF_CONTACT, 500, NULL);
@@ -440,8 +440,8 @@ void CIcqProto::handleServerCListAck(cookie_servlist_action* sc, WORD wError)
void* groupData;
int groupSize;
- setSettingWord(sc->hContact, DBSETTING_SERVLIST_ID, sc->wContactId);
- setSettingWord(sc->hContact, DBSETTING_SERVLIST_GROUP, sc->wGroupId);
+ setWord(sc->hContact, DBSETTING_SERVLIST_ID, sc->wContactId);
+ setWord(sc->hContact, DBSETTING_SERVLIST_GROUP, sc->wGroupId);
servlistPendingRemoveContact(sc->hContact, sc->wContactId, sc->wGroupId, PENDING_RESULT_SUCCESS);
@@ -517,8 +517,8 @@ void CIcqProto::handleServerCListAck(cookie_servlist_action* sc, WORD wError)
void* groupData;
int groupSize;
- setSettingWord(sc->hContact, DBSETTING_SERVLIST_ID, 0); // clear the values
- setSettingWord(sc->hContact, DBSETTING_SERVLIST_GROUP, 0);
+ setWord(sc->hContact, DBSETTING_SERVLIST_ID, 0); // clear the values
+ setWord(sc->hContact, DBSETTING_SERVLIST_GROUP, 0);
FreeServerID(sc->wContactId, SSIT_ITEM);
@@ -611,17 +611,17 @@ void CIcqProto::handleServerCListAck(cookie_servlist_action* sc, WORD wError)
{ // second ack - adding failed with error 0x0E, try to add with AVAIT_AUTH flag
DWORD dwCookie;
- if (!getSettingByte(sc->hContact, "Auth", 0))
+ if (!getByte(sc->hContact, "Auth", 0))
{ // we tried without AWAIT_AUTH, try again with it
NetLog_Server("Contact could not be added without authorization, add with await auth flag.");
- setSettingByte(sc->hContact, "Auth", 1); // we need auth
+ setByte(sc->hContact, "Auth", 1); // we need auth
}
else
{ // we tried with AWAIT_AUTH, try again without
NetLog_Server("Contact count not be added awaiting authorization, try authorized.");
- setSettingByte(sc->hContact, "Auth", 0);
+ setByte(sc->hContact, "Auth", 0);
}
dwCookie = AllocateCookie(CKT_SERVERLIST, ICQ_LISTS_ADDTOLIST, sc->hContact, sc);
icq_sendServerContact(sc->hContact, dwCookie, ICQ_LISTS_ADDTOLIST, sc->wNewGroupId, sc->wNewContactId, SSOP_ITEM_ACTION | SSOF_CONTACT, 400, NULL);
@@ -651,8 +651,8 @@ void CIcqProto::handleServerCListAck(cookie_servlist_action* sc, WORD wError)
int groupSize;
int bEnd = 1; // shall we end the sever modifications
- setSettingWord(sc->hContact, DBSETTING_SERVLIST_ID, sc->wNewContactId);
- setSettingWord(sc->hContact, DBSETTING_SERVLIST_GROUP, sc->wNewGroupId);
+ setWord(sc->hContact, DBSETTING_SERVLIST_ID, sc->wNewContactId);
+ setWord(sc->hContact, DBSETTING_SERVLIST_GROUP, sc->wNewGroupId);
servlistPendingRemoveContact(sc->hContact, sc->wNewContactId, sc->wNewGroupId, PENDING_RESULT_SUCCESS);
@@ -678,8 +678,8 @@ void CIcqProto::handleServerCListAck(cookie_servlist_action* sc, WORD wError)
}
else // contact was deleted from server-list
{
- deleteSetting(sc->hContact, DBSETTING_SERVLIST_ID);
- deleteSetting(sc->hContact, DBSETTING_SERVLIST_GROUP);
+ db_unset(sc->hContact, m_szModuleName, DBSETTING_SERVLIST_ID);
+ db_unset(sc->hContact, m_szModuleName, DBSETTING_SERVLIST_GROUP);
FreeServerID(sc->wContactId, SSIT_ITEM); // release old contact id
sc->lParam = 1;
sc = NULL; // wait for second ack
@@ -727,12 +727,12 @@ void CIcqProto::handleServerCListAck(cookie_servlist_action* sc, WORD wError)
if (sc->wGroupId) // is avatar added or updated?
{
FreeServerID(sc->wContactId, SSIT_ITEM);
- deleteSetting(NULL, DBSETTING_SERVLIST_AVATAR); // to fix old versions
+ db_unset(NULL, m_szModuleName, DBSETTING_SERVLIST_AVATAR); // to fix old versions
}
}
else
{
- setSettingWord(NULL, DBSETTING_SERVLIST_AVATAR, sc->wContactId);
+ setWord(DBSETTING_SERVLIST_AVATAR, sc->wContactId);
}
break;
}
@@ -743,7 +743,7 @@ void CIcqProto::handleServerCListAck(cookie_servlist_action* sc, WORD wError)
else
{
FreeServerID(sc->wContactId, SSIT_ITEM);
- deleteSetting(NULL, DBSETTING_SERVLIST_AVATAR);
+ db_unset(NULL, m_szModuleName, DBSETTING_SERVLIST_AVATAR);
}
break;
}
@@ -758,8 +758,8 @@ void CIcqProto::handleServerCListAck(cookie_servlist_action* sc, WORD wError)
NetLog_Server("Re-starting import sequence failed, error %d", wError);
else
{
- setSettingWord(NULL, "SrvImportID", 0);
- deleteSetting(NULL, "ImportTS");
+ setWord("SrvImportID", 0);
+ db_unset(NULL, m_szModuleName, "ImportTS");
}
break;
}
@@ -934,11 +934,11 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server
}
// Save group and item ID
- setSettingWord(hContact, DBSETTING_SERVLIST_ID, wItemId);
- setSettingWord(hContact, DBSETTING_SERVLIST_GROUP, wGroupId);
+ setWord(hContact, DBSETTING_SERVLIST_ID, wItemId);
+ setWord(hContact, DBSETTING_SERVLIST_GROUP, wGroupId);
ReserveServerID(wItemId, SSIT_ITEM, 0);
- if (!bAdded && getSettingByte(NULL, "LoadServerDetails", DEFAULT_SS_LOAD))
+ if (!bAdded && getByte("LoadServerDetails", DEFAULT_SS_LOAD))
{ // check if the contact has been moved on the server
if (wActiveSrvGroupId != wGroupId || !szActiveSrvGroup)
{
@@ -1003,7 +1003,7 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server
bNicked = 1;
// Write nickname to database
- if (getSettingByte(NULL, "LoadServerDetails", DEFAULT_SS_LOAD) || bAdded)
+ if (getByte("LoadServerDetails", DEFAULT_SS_LOAD) || bAdded)
{ // if just added contact, save details always - does no harm
char *szOldNick;
@@ -1016,7 +1016,7 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server
// Yes, we really do need to delete it first. Otherwise the CLUI nick
// cache isn't updated (I'll look into it)
db_unset(hContact,"CList","MyHandle");
- setSettingStringUtf(hContact, "CList", "MyHandle", pszNick);
+ db_set_utf(hContact, "CList", "MyHandle", pszNick);
}
}
SAFE_FREE(&szOldNick);
@@ -1024,7 +1024,7 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server
else if (strlennull(pszNick) > 0)
{
db_unset(hContact,"CList","MyHandle");
- setSettingStringUtf(hContact, "CList", "MyHandle", pszNick);
+ db_set_utf(hContact, "CList", "MyHandle", pszNick);
}
}
SAFE_FREE(&pszNick);
@@ -1056,7 +1056,7 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server
NetLog_Server("Comment is '%s'", pszComment);
// Write comment to database
- if (getSettingByte(NULL, "LoadServerDetails", DEFAULT_SS_LOAD) || bAdded)
+ if (getByte("LoadServerDetails", DEFAULT_SS_LOAD) || bAdded)
{ // if just added contact, save details always - does no harm
char *szOldComment;
@@ -1066,14 +1066,14 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server
{ // check if the truncated comment changed, i.e. do not overwrite locally stored longer comment
if (strlennull(szOldComment) <= strlennull(pszComment) || strncmp((char*)szOldComment, (char*)pszComment, null_strcut(szOldComment, MAX_SSI_TLV_COMMENT_SIZE)))
{
- setSettingStringUtf(hContact, "UserInfo", "MyNotes", pszComment);
+ db_set_utf(hContact, "UserInfo", "MyNotes", pszComment);
}
}
SAFE_FREE((void**)&szOldComment);
}
else if (strlennull(pszComment) > 0)
{
- setSettingStringUtf(hContact, "UserInfo", "MyNotes", pszComment);
+ db_set_utf(hContact, "UserInfo", "MyNotes", pszComment);
}
}
SAFE_FREE((void**)&pszComment);
@@ -1087,12 +1087,12 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server
// Look for need-authorization TLV
if (pChain->getTLV(SSI_TLV_AWAITING_AUTH, 1))
{
- setSettingByte(hContact, "Auth", 1);
+ setByte(hContact, "Auth", 1);
NetLog_Server("SSI contact need authorization");
}
else
{
- setSettingByte(hContact, "Auth", 0);
+ setByte(hContact, "Auth", 0);
}
if (pTLV = pChain->getTLV(SSI_TLV_METAINFO_TOKEN, 1))
@@ -1104,8 +1104,8 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server
}
else
{
- deleteSetting(hContact, DBSETTING_METAINFO_TOKEN);
- deleteSetting(hContact, DBSETTING_METAINFO_TIME);
+ db_unset(hContact, m_szModuleName, DBSETTING_METAINFO_TOKEN);
+ db_unset(hContact, m_szModuleName, 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
- deleteSetting(hContact, DBSETTING_SERVLIST_DATA);
+ db_unset(hContact, m_szModuleName, DBSETTING_SERVLIST_DATA);
SAFE_FREE((void**)&data);
}
@@ -1191,10 +1191,10 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server
NetLog_Server("SSI %s contact already exists '%s'", "Permit", szRecordName);
// Save permit ID
- setSettingWord(hContact, DBSETTING_SERVLIST_PERMIT, wItemId);
+ setWord(hContact, DBSETTING_SERVLIST_PERMIT, wItemId);
ReserveServerID(wItemId, SSIT_ITEM, 0);
// Set apparent mode
- setSettingWord(hContact, "ApparentMode", ID_STATUS_ONLINE);
+ setWord(hContact, "ApparentMode", ID_STATUS_ONLINE);
NetLog_Server("Visible-contact (%s)", szRecordName);
}
else
@@ -1231,11 +1231,11 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server
NetLog_Server("SSI %s contact already exists '%s'", "Deny", szRecordName);
// Save Deny ID
- setSettingWord(hContact, DBSETTING_SERVLIST_DENY, wItemId);
+ setWord(hContact, DBSETTING_SERVLIST_DENY, wItemId);
ReserveServerID(wItemId, SSIT_ITEM, 0);
// Set apparent mode
- setSettingWord(hContact, "ApparentMode", ID_STATUS_OFFLINE);
+ setWord(hContact, "ApparentMode", ID_STATUS_OFFLINE);
NetLog_Server("Invisible-contact (%s)", szRecordName);
}
else
@@ -1254,7 +1254,7 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server
// Look for visibility TLV
if (bVisibility = pChain->getByte(SSI_TLV_VISIBILITY, 1))
{ // found it, store the id, we do not need current visibility - we do not rely on it
- setSettingWord(NULL, DBSETTING_SERVLIST_PRIVACY, wItemId);
+ setWord(DBSETTING_SERVLIST_PRIVACY, wItemId);
ReserveServerID(wItemId, SSIT_ITEM, 0);
NetLog_Server("Visibility is %u", bVisibility);
@@ -1289,11 +1289,11 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server
NetLog_Server("SSI %s contact already exists '%s'", "Ignore", szRecordName);
// Save Ignore ID
- setSettingWord(hContact, DBSETTING_SERVLIST_IGNORE, wItemId);
+ setWord(hContact, DBSETTING_SERVLIST_IGNORE, wItemId);
ReserveServerID(wItemId, SSIT_ITEM, 0);
// Set apparent mode & ignore
- setSettingWord(hContact, "ApparentMode", ID_STATUS_OFFLINE);
+ setWord(hContact, "ApparentMode", ID_STATUS_OFFLINE);
// set ignore all events
CallService(MS_IGNORE_IGNORE, (WPARAM)hContact, IGNOREEVENT_ALL);
NetLog_Server("Ignore-contact (%s)", szRecordName);
@@ -1319,8 +1319,8 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server
/* time our list was first imported */
/* pszRecordName is "Import Time" */
/* data is TLV(13) {TLV(D4) {time_t importTime}} */
- setSettingDword(NULL, "ImportTS", pChain->getDWord(SSI_TLV_TIMESTAMP, 1));
- setSettingWord(NULL, "SrvImportID", wItemId);
+ setDword("ImportTS", pChain->getDWord(SSI_TLV_TIMESTAMP, 1));
+ setWord("SrvImportID", wItemId);
ReserveServerID(wItemId, SSIT_ITEM, 0);
NetLog_Server("SSI %s item recognized", "first import");
}
@@ -1336,12 +1336,12 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server
/* cause we get the hash again after login */
if (!strcmpnull(szRecordName, "12"))
{ // need to handle Photo Item separately
- setSettingWord(NULL, DBSETTING_SERVLIST_PHOTO, wItemId);
+ setWord(DBSETTING_SERVLIST_PHOTO, wItemId);
NetLog_Server("SSI %s item recognized", "Photo");
}
else
{
- setSettingWord(NULL, DBSETTING_SERVLIST_AVATAR, wItemId);
+ setWord(DBSETTING_SERVLIST_AVATAR, wItemId);
NetLog_Server("SSI %s item recognized", "Avatar");
}
ReserveServerID(wItemId, SSIT_ITEM, 0);
@@ -1361,7 +1361,7 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server
if (pTime)
setSettingDouble(NULL, DBSETTING_METAINFO_TIME, pChain->getDouble(SSI_TLV_METAINFO_TIME, 1));
- setSettingWord(NULL, DBSETTING_SERVLIST_METAINFO, wItemId);
+ setWord(DBSETTING_SERVLIST_METAINFO, wItemId);
ReserveServerID(wItemId, SSIT_ITEM, 0);
NetLog_Server("SSI %s item recognized", "Meta info");
@@ -1397,7 +1397,7 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server
NetLog_Server("Bytes left: %u", wLen);
- setSettingWord(NULL, "SrvRecordCount", (WORD)(wRecord + getSettingWord(NULL, "SrvRecordCount", 0)));
+ setWord("SrvRecordCount", (WORD)(wRecord + getWord("SrvRecordCount", 0)));
if (bIsLastPacket)
{
@@ -1414,7 +1414,7 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server
/* finally we get a time_t of the last update time */
unpackDWord(&buf, &dwLastUpdateTime);
- setSettingDword(NULL, "SrvLastUpdate", dwLastUpdateTime);
+ setDword("SrvLastUpdate", dwLastUpdateTime);
NetLog_Server("Last update of server list was (%u) %s", dwLastUpdateTime, time2text(dwLastUpdateTime));
sendRosterAck();
@@ -1426,7 +1426,7 @@ void CIcqProto::handleServerCListReply(BYTE *buf, WORD wLen, WORD wFlags, server
{
NetLog_Server("Last packet missed update time...");
}
- if (getSettingWord(NULL, "SrvRecordCount", 0) == 0)
+ if (getWord("SrvRecordCount", 0) == 0)
{ // we got empty serv-list, create master group
cookie_servlist_action* ack = (cookie_servlist_action*)SAFE_MALLOC(sizeof(cookie_servlist_action));
if (ack)
@@ -1455,8 +1455,8 @@ void CIcqProto::handleServerCListItemAdd(const char *szRecordName, WORD wGroupId
{
if (pItemData)
{
- setSettingDword(NULL, "ImportTS", pItemData->getDWord(SSI_TLV_TIMESTAMP, 1));
- setSettingWord(NULL, "SrvImportID", wItemId);
+ setDword("ImportTS", pItemData->getDWord(SSI_TLV_TIMESTAMP, 1));
+ setWord("SrvImportID", wItemId);
ReserveServerID(wItemId, SSIT_ITEM, 0);
NetLog_Server("Server added Import timestamp to list");
@@ -1478,7 +1478,7 @@ void CIcqProto::handleServerCListItemUpdate(const char *szRecordName, WORD wGrou
if (pItemData)
{
oscar_tlv* pAuth = pItemData->getTLV(SSI_TLV_AWAITING_AUTH, 1);
- BYTE bAuth = getSettingByte(hContact, "Auth", 0);
+ BYTE bAuth = getByte(hContact, "Auth", 0);
if (bAuth && !pAuth)
{ // server authorized our contact
@@ -1486,7 +1486,7 @@ void CIcqProto::handleServerCListItemUpdate(const char *szRecordName, WORD wGrou
char msg[MAX_PATH];
char *nick = NickFromHandleUtf(hContact);
- setSettingByte(hContact, "Auth", 0);
+ setByte(hContact, "Auth", 0);
null_snprintf(str, MAX_PATH, ICQTranslateUtfStatic(LPGEN("Contact \"%s\" was authorized in the server list."), msg, MAX_PATH), nick);
icq_LogMessage(LOG_WARNING, str);
SAFE_FREE(&nick);
@@ -1497,7 +1497,7 @@ void CIcqProto::handleServerCListItemUpdate(const char *szRecordName, WORD wGrou
char msg[MAX_PATH];
char *nick = NickFromHandleUtf(hContact);
- setSettingByte(hContact, "Auth", 1);
+ setByte(hContact, "Auth", 1);
null_snprintf(str, MAX_PATH, ICQTranslateUtfStatic(LPGEN("Contact \"%s\" lost its authorization in the server list."), msg, MAX_PATH), nick);
icq_LogMessage(LOG_WARNING, str);
SAFE_FREE(&nick);
@@ -1546,7 +1546,7 @@ void CIcqProto::handleServerCListItemUpdate(const char *szRecordName, WORD wGrou
if (datalen > 0)
setSettingBlob(hContact, DBSETTING_SERVLIST_DATA, data, datalen);
else
- deleteSetting(hContact, DBSETTING_SERVLIST_DATA);
+ db_unset(hContact, m_szModuleName, DBSETTING_SERVLIST_DATA);
}
}
}
@@ -1590,11 +1590,11 @@ void CIcqProto::handleServerCListItemDelete(const char *szRecordName, WORD wGrou
if (hContact != INVALID_HANDLE_VALUE && wItemType == SSI_ITEM_BUDDY)
{ // a contact was removed from our list
- if (getSettingWord(hContact, DBSETTING_SERVLIST_ID, 0) == wItemId)
+ if (getWord(hContact, DBSETTING_SERVLIST_ID, 0) == wItemId)
{
- deleteSetting(hContact, DBSETTING_SERVLIST_ID);
- deleteSetting(hContact, DBSETTING_SERVLIST_GROUP);
- deleteSetting(hContact, "Auth");
+ db_unset(hContact, m_szModuleName, DBSETTING_SERVLIST_ID);
+ db_unset(hContact, m_szModuleName, DBSETTING_SERVLIST_GROUP);
+ db_unset(hContact, m_szModuleName, "Auth");
{
char str[MAX_PATH];
@@ -1658,7 +1658,7 @@ void CIcqProto::handleRecvAuthRequest(unsigned char *buf, WORD wLen)
DBVARIANT dbv = { 0 };
if (pre.flags & PREF_UTF)
szNick = getSettingStringUtf(hContact, "Nick", NULL);
- else if (!getSettingString(hContact, "Nick", &dbv))
+ else if (!getString(hContact, "Nick", &dbv))
{
szNick = null_strdup(dbv.pszVal);
db_free(&dbv);
@@ -1670,7 +1670,7 @@ void CIcqProto::handleRecvAuthRequest(unsigned char *buf, WORD wLen)
pre.lParam += nNickLen + nReasonLen;
- setSettingByte(hContact, "Grant", 1);
+ setByte(hContact, "Grant", 1);
/*blob is: uin(DWORD), hcontact(HANDLE), nick(ASCIIZ), first(ASCIIZ), last(ASCIIZ), email(ASCIIZ), reason(ASCIIZ)*/
char *szBlob = (char *)_alloca(pre.lParam);
@@ -1727,7 +1727,7 @@ void CIcqProto::handleRecvAdded(unsigned char *buf, WORD wLen)
if (dwUin)
{
- if (getSettingString(hContact, "Nick", &dbv))
+ if (getString(hContact, "Nick", &dbv))
nNickLen = 0;
else
{
@@ -1813,7 +1813,7 @@ void CIcqProto::handleRecvAuthResponse(unsigned char *buf, WORD wLen)
break;
case 1:
- setSettingByte(hContact, "Auth", 0);
+ setByte(hContact, "Auth", 0);
NetLog_Server("Authorization request %s by %s", "granted", strUID(dwUin, szUid));
// TODO: Add to system history as soon as new auth system is ready
break;
@@ -1847,18 +1847,18 @@ void CIcqProto::updateServVisibilityCode(BYTE bCode)
{
cookie_servlist_action* ack;
DWORD dwCookie;
- BYTE bVisibility = getSettingByte(NULL, "SrvVisibility", 0);
+ BYTE bVisibility = getByte("SrvVisibility", 0);
if (bVisibility == bCode) // if no change was made, not necescary to update that
return;
- setSettingByte(NULL, "SrvVisibility", bCode);
+ setByte("SrvVisibility", bCode);
// Do we have a known server visibility ID? We should, unless we just subscribed to the serv-list for the first time
- if ((wVisibilityID = getSettingWord(NULL, DBSETTING_SERVLIST_PRIVACY, 0)) == 0)
+ if ((wVisibilityID = getWord(DBSETTING_SERVLIST_PRIVACY, 0)) == 0)
{
// No, create a new random ID
wVisibilityID = GenerateServerID(SSIT_ITEM, 0);
- setSettingWord(NULL, DBSETTING_SERVLIST_PRIVACY, wVisibilityID);
+ setWord(DBSETTING_SERVLIST_PRIVACY, wVisibilityID);
wCommand = ICQ_LISTS_ADDTOLIST;
#ifdef _DEBUG
NetLog_Server("Made new srvVisibilityID, id is %u, code is %u", wVisibilityID, bCode);
@@ -1933,7 +1933,7 @@ void CIcqProto::updateServAvatarHash(BYTE *pHash, int size)
DWORD dwCookie;
// Do we have a known server avatar ID?
- if (wAvatarID = getSettingWord(NULL, DBSETTING_SERVLIST_AVATAR, 0))
+ if (wAvatarID = getWord(DBSETTING_SERVLIST_AVATAR, 0))
{
ack = (cookie_servlist_action*)SAFE_MALLOC(sizeof(cookie_servlist_action));
if (!ack)
@@ -1958,7 +1958,7 @@ void CIcqProto::updateServAvatarHash(BYTE *pHash, int size)
WORD hashsize = size - 2;
// Do we have a known server avatar ID? We should, unless we just subscribed to the serv-list for the first time
- if (bResetHash || (wAvatarID = getSettingWord(NULL, DBSETTING_SERVLIST_AVATAR, 0)) == 0)
+ if (bResetHash || (wAvatarID = getWord(DBSETTING_SERVLIST_AVATAR, 0)) == 0)
{
// No, create a new random ID
wAvatarID = GenerateServerID(SSIT_ITEM, 0);
@@ -2010,11 +2010,11 @@ void CIcqProto::updateServAvatarHash(BYTE *pHash, int size)
void CIcqProto::icq_sendServerBeginOperation(int bImport)
{
icq_packet packet;
- WORD wImportID = getSettingWord(NULL, "SrvImportID", 0);
+ WORD wImportID = getWord("SrvImportID", 0);
if (bImport && wImportID)
{ // we should be importing, check if already have import item
- if (getSettingDword(NULL, "ImportTS", 0) + 604800 < getSettingDword(NULL, "LogonTS", 0))
+ if (getDword("ImportTS", 0) + 604800 < getDword("LogonTS", 0))
{ // is the timestamp week older, clear it and begin new import
DWORD dwCookie;
cookie_servlist_action* ack;
diff --git a/protocols/IcqOscarJ/src/fam_15icqserver.cpp b/protocols/IcqOscarJ/src/fam_15icqserver.cpp
index 723a42f68c..890bd8fc41 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);
- deleteSetting(hContact, szItemKey);
+ db_unset(hContact, m_szModuleName, szItemKey);
}
return nRecords;
@@ -925,20 +925,20 @@ void CIcqProto::parseDirectoryUserDetailsData(HANDLE hContact, oscar_tlv_chain *
}
else
{ // Remove old data when phones not available
- deleteSetting(hContact, "Phone");
- deleteSetting(hContact, "CompanyPhone");
- deleteSetting(hContact, "Cellular");
- deleteSetting(hContact, "Fax");
- deleteSetting(hContact, "CompanyFax");
+ 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");
}
}
else
{ // Remove old data when phones not available
- deleteSetting(hContact, "Phone");
- deleteSetting(hContact, "CompanyPhone");
- deleteSetting(hContact, "Cellular");
- deleteSetting(hContact, "Fax");
- deleteSetting(hContact, "CompanyFax");
+ 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");
}
// Emails
parseUserInfoRecord(hContact, cDetails->getTLV(0x8C, 1), rEmail, SIZEOF(rEmail), 4);
@@ -952,13 +952,13 @@ void CIcqProto::parseDirectoryUserDetailsData(HANDLE hContact, oscar_tlv_chain *
switch (cDetails->getNumber(0x82, 1))
{
case 1:
- setSettingByte(hContact, "Gender", 'F');
+ setByte(hContact, "Gender", 'F');
break;
case 2:
- setSettingByte(hContact, "Gender", 'M');
+ setByte(hContact, "Gender", 'M');
break;
default:
- deleteSetting(hContact, "Gender");
+ db_unset(hContact, m_szModuleName, "Gender");
}
writeDbInfoSettingTLVStringUtf(hContact, "Homepage", cDetails, 0xFA);
@@ -996,7 +996,7 @@ void CIcqProto::parseDirectoryUserDetailsData(HANDLE hContact, oscar_tlv_chain *
if (!hContact)
{
- setSettingByte(hContact, "Auth", !cDetails->getByte(0x19A, 1));
+ setByte(hContact, "Auth", !cDetails->getByte(0x19A, 1));
writeDbInfoSettingTLVByte(hContact, "WebAware", cDetails, 0x212);
writeDbInfoSettingTLVByte(hContact, "AllowSpam", cDetails, 0x1EA);
}
@@ -1008,12 +1008,12 @@ void CIcqProto::parseDirectoryUserDetailsData(HANDLE hContact, oscar_tlv_chain *
int nAge = calcAgeFromBirthDate(cDetails->getDouble(0x1A4, 1));
if (nAge)
- setSettingWord(hContact, "Age", nAge);
+ setWord(hContact, "Age", nAge);
else
- deleteSetting(hContact, "Age");
+ db_unset(hContact, m_szModuleName, "Age");
}
else // we do not need to calculate age for owner
- deleteSetting(hContact, "Age");
+ db_unset(hContact, m_szModuleName, "Age");
{ // Save user info last update time and privacy token
double dInfoTime;
@@ -1030,7 +1030,7 @@ void CIcqProto::parseDirectoryUserDetailsData(HANDLE hContact, oscar_tlv_chain *
else if (bHasMetaToken || !hContact)
writeDbInfoSettingTLVDouble(hContact, DBSETTING_METAINFO_SAVED, cDetails, 0x1CC);
else
- setSettingDword(hContact, DBSETTING_METAINFO_SAVED, time(NULL));
+ setDword(hContact, DBSETTING_METAINFO_SAVED, time(NULL));
}
if (wReplySubType == META_DIRECTORY_RESPONSE)
diff --git a/protocols/IcqOscarJ/src/icq_avatar.cpp b/protocols/IcqOscarJ/src/icq_avatar.cpp
index b323030be3..47f04ed32c 100644
--- a/protocols/IcqOscarJ/src/icq_avatar.cpp
+++ b/protocols/IcqOscarJ/src/icq_avatar.cpp
@@ -101,7 +101,7 @@ TCHAR* CIcqProto::GetOwnAvatarFileName()
{
DBVARIANT dbvFile = {DBVT_DELETED};
- if (!getSettingStringT(NULL, "AvatarFile", &dbvFile))
+ if (!getTString(NULL, "AvatarFile", &dbvFile))
{
TCHAR tmp[MAX_PATH * 2];
PathToAbsoluteT(dbvFile.ptszVal, tmp);
@@ -422,7 +422,7 @@ void CIcqProto::handleAvatarOwnerHash(WORD wItemID, BYTE bFlags, BYTE *pData, BY
} // check if we had set any avatar if yes set our, if not download from server
else if (memcmp(hash, pData + 4, 0x10))
{ // we have different avatar, sync that
- if (m_bSsiEnabled && getSettingByte(NULL, "ForceOurAvatar", 1))
+ if (m_bSsiEnabled && getByte("ForceOurAvatar", 1))
{ // we want our avatar, update hash
DWORD dwPaFormat = DetectAvatarFormat(file);
BYTE *pHash = (BYTE*)_alloca(0x14);
@@ -592,7 +592,7 @@ void CIcqProto::handleAvatarContactHash(DWORD dwUIN, char *szUID, HANDLE hContac
{ // check settings, should we request avatar immediatelly?
DBVARIANT dbv = {DBVT_DELETED};
TCHAR tszAvatar[MAX_PATH * 2 +4];
- BYTE bAutoLoad = getSettingByte(NULL, "AvatarsAutoLoad", DEFAULT_LOAD_AVATARS);
+ BYTE bAutoLoad = getByte("AvatarsAutoLoad", DEFAULT_LOAD_AVATARS);
if ((avatarType == AVATAR_HASH_STATIC || avatarType == AVATAR_HASH_MINI) && cbAvatarHash == 0x09 && !memcmp(pAvatarHash + 4, hashEmptyAvatar + 4, 0x05))
{ // empty avatar - unlink image, clear hash
@@ -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));
- deleteSetting(hContact, "AvatarHash");
+ db_unset(hContact, m_szModuleName, "AvatarHash");
ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_STATUS, NULL, 0);
}
#ifdef _DEBUG
@@ -621,7 +621,7 @@ void CIcqProto::handleAvatarContactHash(DWORD dwUIN, char *szUID, HANDLE hContac
// check saved hash and file, if equal only store hash
if (!avatarState)
{ // hashes are the same
- int dwPaFormat = getSettingByte(hContact, "AvatarType", PA_FORMAT_UNKNOWN);
+ int dwPaFormat = getByte(hContact, "AvatarType", PA_FORMAT_UNKNOWN);
GetFullAvatarFileName(dwUIN, szUID, dwPaFormat, tszAvatar, MAX_PATH * 2);
if (_taccess(tszAvatar, 0) == 0)
@@ -671,7 +671,7 @@ void CIcqProto::handleAvatarContactHash(DWORD dwUIN, char *szUID, HANDLE hContac
// we should have file, check if the file really exists
if (!avatarState)
{
- int dwPaFormat = getSettingByte(hContact, "AvatarType", PA_FORMAT_UNKNOWN);
+ int dwPaFormat = getByte(hContact, "AvatarType", PA_FORMAT_UNKNOWN);
if (dwPaFormat == PA_FORMAT_UNKNOWN)
{ // we do not know the format, get avatar again
#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));
- deleteSetting(hContact, "AvatarHash");
+ db_unset(hContact, m_szModuleName, "AvatarHash");
ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_STATUS, NULL, 0);
}
#ifdef _DEBUG
@@ -1243,7 +1243,7 @@ void avatars_server_connection::connectionThread()
// This is the "infinite" loop that receives the packets from the ICQ avatar server
NETLIBPACKETRECVER packetRecv = {0};
DWORD wLastKeepAlive = 0; // we send keep-alive at most one per 30secs
- DWORD dwKeepAliveInterval = ppro->getSettingDword(NULL, "KeepAliveInterval", KEEPALIVE_INTERVAL);
+ DWORD dwKeepAliveInterval = ppro->getDword("KeepAliveInterval", KEEPALIVE_INTERVAL);
hPacketRecver = (HANDLE)CallService(MS_NETLIB_CREATEPACKETRECVER, (WPARAM)hConnection, 65536);
packetRecv.cbSize = sizeof(packetRecv);
@@ -1273,7 +1273,7 @@ void avatars_server_connection::connectionThread()
#endif
if (GetTickCount() > wLastKeepAlive)
{ // limit frequency (HACK: on some systems select() does not work well)
- if (!ppro->m_bGatewayMode && ppro->getSettingByte(NULL, "KeepAlive", DEFAULT_KEEPALIVE_ENABLED))
+ if (!ppro->m_bGatewayMode && ppro->getByte("KeepAlive", DEFAULT_KEEPALIVE_ENABLED))
{ // send keep-alive packet
icq_packet packet;
@@ -1637,7 +1637,7 @@ void avatars_server_connection::handleAvatarFam(BYTE *pBuffer, WORD wBufferLengt
{ // store to file...
int aValid = 1;
- if (pCookieData->hashlen == 0x14 && pCookieData->hash[3] == 0x10 && ppro->getSettingByte(NULL, "StrictAvatarCheck", DEFAULT_AVATARS_CHECK))
+ if (pCookieData->hashlen == 0x14 && pCookieData->hash[3] == 0x10 && ppro->getByte("StrictAvatarCheck", DEFAULT_AVATARS_CHECK))
{ // check only standard hashes
mir_md5_state_t state;
mir_md5_byte_t digest[16];
@@ -1659,7 +1659,7 @@ void avatars_server_connection::handleAvatarFam(BYTE *pBuffer, WORD wBufferLengt
_tcscpy(tszImageFile, pCookieData->szFile);
AddAvatarExt(dwPaFormat, tszImageFile);
- ppro->setSettingByte(pCookieData->hContact, "AvatarType", (BYTE)dwPaFormat);
+ ppro->setByte(pCookieData->hContact, "AvatarType", (BYTE)dwPaFormat);
ai.format = dwPaFormat; // set the format
lstrcpyn(ai.filename, tszImageFile, SIZEOF(ai.filename));
diff --git a/protocols/IcqOscarJ/src/icq_db.cpp b/protocols/IcqOscarJ/src/icq_db.cpp
index 65899ae703..8aa8a97687 100644
--- a/protocols/IcqOscarJ/src/icq_db.cpp
+++ b/protocols/IcqOscarJ/src/icq_db.cpp
@@ -34,33 +34,6 @@ int CIcqProto::getSetting(HANDLE hContact, const char *szSetting, DBVARIANT *dbv
return db_get_s(hContact, m_szModuleName, szSetting, dbv, 0);
}
-BYTE CIcqProto::getSettingByte(HANDLE hContact, const char *szSetting, BYTE byDef)
-{
- return db_get_b(hContact, m_szModuleName, szSetting, byDef);
-}
-
-WORD CIcqProto::getSettingWord(HANDLE hContact, const char *szSetting, WORD wDef)
-{
- return db_get_w(hContact, m_szModuleName, szSetting, wDef);
-}
-
-DWORD CIcqProto::getSettingDword(HANDLE hContact, const char *szSetting, DWORD dwDef)
-{
- DBVARIANT dbv = {DBVT_DELETED};
- DWORD dwRes;
-
- if (getSetting(hContact, szSetting, &dbv))
- return dwDef; // not found, give default
-
- if (dbv.type != DBVT_DWORD)
- dwRes = dwDef; // invalid type, give default
- else // found and valid, give result
- dwRes = dbv.dVal;
-
- db_free(&dbv);
- return dwRes;
-}
-
double CIcqProto::getSettingDouble(HANDLE hContact, const char *szSetting, double dDef)
{
DBVARIANT dbv = {DBVT_DELETED};
@@ -80,7 +53,7 @@ double CIcqProto::getSettingDouble(HANDLE hContact, const char *szSetting, doubl
DWORD CIcqProto::getContactUin(HANDLE hContact)
{
- return getSettingDword(hContact, UNIQUEIDSETTING, 0);
+ return getDword(hContact, UNIQUEIDSETTING, 0);
}
int CIcqProto::getContactUid(HANDLE hContact, DWORD *pdwUin, uid_str *ppszUid)
@@ -109,24 +82,6 @@ int CIcqProto::getContactUid(HANDLE hContact, DWORD *pdwUin, uid_str *ppszUid)
return iRes;
}
-int CIcqProto::getSettingString(HANDLE hContact, const char *szSetting, DBVARIANT *dbv)
-{
- int res = db_get_s(hContact, m_szModuleName, szSetting, dbv);
- if (res)
- db_free(dbv);
-
- return res;
-}
-
-int CIcqProto::getSettingStringW(HANDLE hContact, const char *szSetting, DBVARIANT *dbv)
-{
- int res = db_get_ws(hContact, m_szModuleName, szSetting, dbv);
- if (res)
- db_free(dbv);
-
- return res;
-}
-
char* CIcqProto::getSettingStringUtf(HANDLE hContact, const char *szModule, const char *szSetting, char *szDef)
{
DBVARIANT dbv = {DBVT_DELETED};
@@ -147,7 +102,7 @@ char* CIcqProto::getSettingStringUtf(HANDLE hContact, const char *szSetting, cha
WORD CIcqProto::getContactStatus(HANDLE hContact)
{
- return getSettingWord(hContact, "Status", ID_STATUS_OFFLINE);
+ return getWord(hContact, "Status", ID_STATUS_OFFLINE);
}
int CIcqProto::getSettingStringStatic(HANDLE hContact, const char *szSetting, char *dest, int dest_len)
@@ -175,51 +130,11 @@ int CIcqProto::getSettingStringStatic(HANDLE hContact, const char *szSetting, ch
return (dbv.type != DBVT_ASCIIZ);
}
-int CIcqProto::deleteSetting(HANDLE hContact, const char *szSetting)
-{
- return db_unset(hContact, m_szModuleName, szSetting);
-}
-
-int CIcqProto::setSettingByte(HANDLE hContact, const char *szSetting, BYTE byValue)
-{
- return db_set_b(hContact, m_szModuleName, szSetting, byValue);
-}
-
-int CIcqProto::setSettingWord(HANDLE hContact, const char *szSetting, WORD wValue)
-{
- return db_set_w(hContact, m_szModuleName, szSetting, wValue);
-}
-
-int CIcqProto::setSettingDword(HANDLE hContact, const char *szSetting, DWORD dwValue)
-{
- return db_set_dw(hContact, m_szModuleName, szSetting, dwValue);
-}
-
int CIcqProto::setSettingDouble(HANDLE hContact, const char *szSetting, double dValue)
{
return setSettingBlob(hContact, szSetting, (BYTE*)&dValue, sizeof(double));
}
-int CIcqProto::setSettingString(HANDLE hContact, const char *szSetting, const char *szValue)
-{
- return db_set_s(hContact, m_szModuleName, szSetting, szValue);
-}
-
-int CIcqProto::setSettingStringW(HANDLE hContact, const char *szSetting, const WCHAR *wszValue)
-{
- return db_set_ws(hContact, m_szModuleName, szSetting, wszValue);
-}
-
-int CIcqProto::setSettingStringUtf(HANDLE hContact, const char *szModule, const char *szSetting, const char *szValue)
-{
- return db_set_utf(hContact, szModule, szSetting, szValue);
-}
-
-int CIcqProto::setSettingStringUtf(HANDLE hContact, const char *szSetting, const char *szValue)
-{
- return db_set_utf(hContact, m_szModuleName, szSetting, szValue);
-}
-
int CIcqProto::setSettingBlob(HANDLE hContact, const char *szSetting, const BYTE *pValue, const int cbValue)
{
return db_set_blob(hContact, m_szModuleName, szSetting, (void*)pValue, cbValue);
@@ -266,7 +181,7 @@ void CIcqProto::setStatusMsgVar(HANDLE hContact, char* szStatusMsg, bool isAnsi)
}
if (!oldStatusMsg || strcmp(oldStatusMsg, szStatusMsg))
- setSettingStringUtf(hContact, "CList", "StatusMsg", szStatusMsg);
+ db_set_utf(hContact, "CList", "StatusMsg", szStatusMsg);
SAFE_FREE(&oldStatusMsg);
if (isAnsi) SAFE_FREE(&szStatusMsg);
}
diff --git a/protocols/IcqOscarJ/src/icq_db.h b/protocols/IcqOscarJ/src/icq_db.h
index 180dcfc5fd..1a0266de74 100644
--- a/protocols/IcqOscarJ/src/icq_db.h
+++ b/protocols/IcqOscarJ/src/icq_db.h
@@ -32,11 +32,11 @@
#ifdef _UNICODE
- #define getSettingStringT getSettingStringW
- #define setSettingStringT setSettingStringW
+ #define getTString getSettingStringW
+ #define setSettingStringT setTString
#else
- #define getSettingStringT getSettingString
- #define setSettingStringT setSettingString
+ #define getTString getString
+ #define setSettingStringT setString
#endif
#endif /* __ICQ_DB_H */
diff --git a/protocols/IcqOscarJ/src/icq_direct.cpp b/protocols/IcqOscarJ/src/icq_direct.cpp
index cfe357bc58..4893bbc813 100644
--- a/protocols/IcqOscarJ/src/icq_direct.cpp
+++ b/protocols/IcqOscarJ/src/icq_direct.cpp
@@ -161,10 +161,10 @@ BOOL CIcqProto::IsDirectConnectionOpen(HANDLE hContact, int type, int bPassive)
{ // do not try to open DC to offline contact
if (getContactStatus(hContact) == ID_STATUS_OFFLINE) return FALSE;
// do not try to open DC if previous attempt was not successfull
- if (getSettingByte(hContact, "DCStatus", 0)) return FALSE;
+ if (getByte(hContact, "DCStatus", 0)) return FALSE;
// Set DC status as tried
- setSettingByte(hContact, "DCStatus", 1);
+ setByte(hContact, "DCStatus", 1);
// Create a new connection
OpenDirectConnection(hContact, DIRECTCONN_STANDARD, NULL);
}
@@ -233,12 +233,12 @@ void __cdecl CIcqProto::icq_directThread( directthreadstartinfo *dtsi )
if (!dc.incoming)
{
dc.type = dtsi->type;
- dc.dwRemoteExternalIP = getSettingDword(dtsi->hContact, "IP", 0);
- dc.dwRemoteInternalIP = getSettingDword(dtsi->hContact, "RealIP", 0);
- dc.dwRemotePort = getSettingWord(dtsi->hContact, "UserPort", 0);
+ dc.dwRemoteExternalIP = getDword(dtsi->hContact, "IP", 0);
+ dc.dwRemoteInternalIP = getDword(dtsi->hContact, "RealIP", 0);
+ dc.dwRemotePort = getWord(dtsi->hContact, "UserPort", 0);
dc.dwRemoteUin = getContactUin(dtsi->hContact);
- dc.dwConnectionCookie = getSettingDword(dtsi->hContact, "DirectCookie", 0);
- dc.wVersion = getSettingWord(dtsi->hContact, "Version", 0);
+ dc.dwConnectionCookie = getDword(dtsi->hContact, "DirectCookie", 0);
+ dc.wVersion = getWord(dtsi->hContact, "Version", 0);
if (!dc.dwRemoteExternalIP && !dc.dwRemoteInternalIP)
{ // we do not have any ip, do not try to connect
@@ -278,8 +278,8 @@ void __cdecl CIcqProto::icq_directThread( directthreadstartinfo *dtsi )
SAFE_FREE((void**)&dtsi);
// Load local IP information
- dc.dwLocalExternalIP = getSettingDword(NULL, "IP", 0);
- dc.dwLocalInternalIP = getSettingDword(NULL, "RealIP", 0);
+ dc.dwLocalExternalIP = getDword("IP", 0);
+ dc.dwLocalInternalIP = getDword("RealIP", 0);
// Create outgoing DC
if (!dc.incoming)
@@ -338,7 +338,7 @@ void __cdecl CIcqProto::icq_directThread( directthreadstartinfo *dtsi )
}
}
else // Set DC status to failed
- setSettingByte(dc.hContact, "DCStatus", 2);
+ setByte(dc.hContact, "DCStatus", 2);
if (dc.type == DIRECTCONN_REVERSE) // failed reverse connection
{ // announce we failed
@@ -648,7 +648,7 @@ void CIcqProto::handleDirectPacket(directconnect* dc, PBYTE buf, WORD wLen)
if (dc->incoming)
{ // this is the first PEER_INIT with our cookie
- if (dwCookie != getSettingDword(hContact, "DirectCookie", 0))
+ if (dwCookie != getDword(hContact, "DirectCookie", 0))
{
NetLog_Direct("Error: Received PEER_INIT with broken cookie");
CloseDirectConnection(dc);
@@ -693,8 +693,8 @@ void CIcqProto::handleDirectPacket(directconnect* dc, PBYTE buf, WORD wLen)
{ // store good IP info
dc->hContact = hContact;
dc->dwConnectionCookie = dwCookie;
- setSettingDword(dc->hContact, "IP", dc->dwRemoteExternalIP);
- setSettingDword(dc->hContact, "RealIP", dc->dwRemoteInternalIP);
+ setDword(dc->hContact, "IP", dc->dwRemoteExternalIP);
+ setDword(dc->hContact, "RealIP", dc->dwRemoteInternalIP);
sendPeerInit_v78(dc); // reply with our PEER_INIT
}
else // outgoing
@@ -717,7 +717,7 @@ void CIcqProto::handleDirectPacket(directconnect* dc, PBYTE buf, WORD wLen)
}
}
// Set DC Status to successful
- setSettingByte(dc->hContact, "DCStatus", 0);
+ setByte(dc->hContact, "DCStatus", 0);
}
else
{
@@ -1149,7 +1149,7 @@ void CIcqProto::sendPeerFileInit(directconnect* dc)
int nNickLen;
dbv.type = DBVT_DELETED;
- if (getSettingString(NULL, "Nick", &dbv))
+ if (getString("Nick", &dbv))
szNick = "";
else
szNick = dbv.pszVal;
diff --git a/protocols/IcqOscarJ/src/icq_filetransfer.cpp b/protocols/IcqOscarJ/src/icq_filetransfer.cpp
index 54f58a0181..39dd4de11b 100644
--- a/protocols/IcqOscarJ/src/icq_filetransfer.cpp
+++ b/protocols/IcqOscarJ/src/icq_filetransfer.cpp
@@ -70,7 +70,7 @@ static void file_sendNick(CIcqProto* ppro, directconnect* dc)
WORD wNickLen;
DBVARIANT dbv = {DBVT_DELETED};
- if (ppro->getSettingString(NULL, "Nick", &dbv))
+ if (ppro->getString("Nick", &dbv))
szNick = "";
else
szNick = dbv.pszVal;
diff --git a/protocols/IcqOscarJ/src/icq_firstrun.cpp b/protocols/IcqOscarJ/src/icq_firstrun.cpp
index 9903719a22..f92eaf24a0 100644
--- a/protocols/IcqOscarJ/src/icq_firstrun.cpp
+++ b/protocols/IcqOscarJ/src/icq_firstrun.cpp
@@ -98,11 +98,11 @@ INT_PTR CALLBACK icq_FirstRunDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
{
char str[128];
GetDlgItemTextA(hwndDlg, IDC_UIN, str, sizeof(str));
- ppro->setSettingDword(NULL, UNIQUEIDSETTING, atoi(str));
+ ppro->setDword(UNIQUEIDSETTING, atoi(str));
GetDlgItemTextA(hwndDlg, IDC_PW, str, sizeof(ppro->m_szPassword));
strcpy(ppro->m_szPassword, str);
CallService(MS_DB_CRYPT_ENCODESTRING, sizeof(ppro->m_szPassword), (LPARAM) str);
- ppro->setSettingString(NULL, "Password", str);
+ ppro->setString("Password", str);
}
break;
diff --git a/protocols/IcqOscarJ/src/icq_menu.cpp b/protocols/IcqOscarJ/src/icq_menu.cpp
index 13d7209f4e..93e85a6965 100644
--- a/protocols/IcqOscarJ/src/icq_menu.cpp
+++ b/protocols/IcqOscarJ/src/icq_menu.cpp
@@ -197,13 +197,13 @@ int CIcqProto::OnPreBuildContactMenu(WPARAM wParam, LPARAM)
DWORD dwUin = getContactUin(hContact);
Menu_ShowItem(g_hContactMenuItems[ICMI_AUTH_REQUEST],
- dwUin && (bCtrlPressed || (getSettingByte((HANDLE)wParam, "Auth", 0) && getSettingWord((HANDLE)wParam, DBSETTING_SERVLIST_ID, 0))));
- Menu_ShowItem(g_hContactMenuItems[ICMI_AUTH_GRANT], dwUin && (bCtrlPressed || getSettingByte((HANDLE)wParam, "Grant", 0)));
+ dwUin && (bCtrlPressed || (getByte((HANDLE)wParam, "Auth", 0) && getWord((HANDLE)wParam, DBSETTING_SERVLIST_ID, 0))));
+ Menu_ShowItem(g_hContactMenuItems[ICMI_AUTH_GRANT], dwUin && (bCtrlPressed || getByte((HANDLE)wParam, "Grant", 0)));
Menu_ShowItem(g_hContactMenuItems[ICMI_AUTH_REVOKE],
- dwUin && (bCtrlPressed || (getSettingByte(NULL, "PrivacyItems", 0) && !getSettingByte((HANDLE)wParam, "Grant", 0))));
+ dwUin && (bCtrlPressed || (getByte("PrivacyItems", 0) && !getByte((HANDLE)wParam, "Grant", 0))));
Menu_ShowItem(g_hContactMenuItems[ICMI_ADD_TO_SERVLIST],
- m_bSsiEnabled && !getSettingWord((HANDLE)wParam, DBSETTING_SERVLIST_ID, 0) &&
- !getSettingWord((HANDLE)wParam, DBSETTING_SERVLIST_IGNORE, 0) &&
+ m_bSsiEnabled && !getWord((HANDLE)wParam, DBSETTING_SERVLIST_ID, 0) &&
+ !getWord((HANDLE)wParam, DBSETTING_SERVLIST_IGNORE, 0) &&
!db_get_b(hContact, "CList", "NotOnList", 0));
}
diff --git a/protocols/IcqOscarJ/src/icq_opts.cpp b/protocols/IcqOscarJ/src/icq_opts.cpp
index 166f81ce79..ff7a3b92ef 100644
--- a/protocols/IcqOscarJ/src/icq_opts.cpp
+++ b/protocols/IcqOscarJ/src/icq_opts.cpp
@@ -45,12 +45,12 @@ static BOOL (WINAPI *pfnEnableThemeDialogTexture)(HANDLE, DWORD) = 0;
static void LoadDBCheckState(CIcqProto* ppro, HWND hwndDlg, int idCtrl, const char* szSetting, BYTE bDef)
{
- CheckDlgButton(hwndDlg, idCtrl, ppro->getSettingByte(NULL, szSetting, bDef));
+ CheckDlgButton(hwndDlg, idCtrl, ppro->getByte(szSetting, bDef));
}
static void StoreDBCheckState(CIcqProto* ppro, HWND hwndDlg, int idCtrl, const char* szSetting)
{
- ppro->setSettingByte(NULL, szSetting, (BYTE)IsDlgButtonChecked(hwndDlg, idCtrl));
+ ppro->setByte(szSetting, (BYTE)IsDlgButtonChecked(hwndDlg, idCtrl));
}
static void OptDlgChanged(HWND hwndDlg)
@@ -97,10 +97,10 @@ static INT_PTR CALLBACK DlgProcIcqOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
else
SetDlgItemTextA(hwndDlg, IDC_ICQSERVER, IsDlgButtonChecked(hwndDlg, IDC_SSL) ? DEFAULT_SERVER_HOST_SSL : DEFAULT_SERVER_HOST);
- SetDlgItemInt(hwndDlg, IDC_ICQPORT, ppro->getSettingWord(NULL, "OscarPort", IsDlgButtonChecked(hwndDlg, IDC_SSL) ? DEFAULT_SERVER_PORT_SSL : DEFAULT_SERVER_PORT), FALSE);
+ SetDlgItemInt(hwndDlg, IDC_ICQPORT, ppro->getWord("OscarPort", IsDlgButtonChecked(hwndDlg, IDC_SSL) ? DEFAULT_SERVER_PORT_SSL : DEFAULT_SERVER_PORT), FALSE);
LoadDBCheckState(ppro, hwndDlg, IDC_KEEPALIVE, "KeepAlive", DEFAULT_KEEPALIVE_ENABLED);
SendDlgItemMessage(hwndDlg, IDC_LOGLEVEL, TBM_SETRANGE, FALSE, MAKELONG(0, 4));
- SendDlgItemMessage(hwndDlg, IDC_LOGLEVEL, TBM_SETPOS, TRUE, 4-ppro->getSettingByte(NULL, "ShowLogLevel", LOG_WARNING));
+ SendDlgItemMessage(hwndDlg, IDC_LOGLEVEL, TBM_SETPOS, TRUE, 4-ppro->getByte("ShowLogLevel", LOG_WARNING));
{
char buf[MAX_PATH];
SetDlgItemTextUtf(hwndDlg, IDC_LEVELDESCR, ICQTranslateUtfStatic(szLogLevelDescr[4-SendDlgItemMessage(hwndDlg, IDC_LOGLEVEL, TBM_GETPOS, 0, 0)], buf, MAX_PATH));
@@ -168,7 +168,7 @@ static INT_PTR CALLBACK DlgProcIcqOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
{
char str[128];
- ppro->setSettingDword(NULL, UNIQUEIDSETTING, GetDlgItemInt(hwndDlg, IDC_ICQNUM, NULL, FALSE));
+ ppro->setDword(UNIQUEIDSETTING, GetDlgItemInt(hwndDlg, IDC_ICQNUM, NULL, FALSE));
GetDlgItemTextA(hwndDlg, IDC_PASSWORD, str, sizeof(ppro->m_szPassword));
if (strlennull(str))
{
@@ -176,19 +176,19 @@ static INT_PTR CALLBACK DlgProcIcqOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LP
ppro->m_bRememberPwd = TRUE;
}
else
- ppro->m_bRememberPwd = ppro->getSettingByte(NULL, "RememberPass", 0);
+ ppro->m_bRememberPwd = ppro->getByte("RememberPass", 0);
CallService(MS_DB_CRYPT_ENCODESTRING, sizeof(ppro->m_szPassword), (LPARAM)str);
- ppro->setSettingString(NULL, "Password", str);
+ ppro->setString("Password", str);
GetDlgItemTextA(hwndDlg,IDC_ICQSERVER, str, sizeof(str));
- ppro->setSettingString(NULL, "OscarServer", str);
- ppro->setSettingWord(NULL, "OscarPort", (WORD)GetDlgItemInt(hwndDlg, IDC_ICQPORT, NULL, FALSE));
+ ppro->setString("OscarServer", str);
+ ppro->setWord("OscarPort", (WORD)GetDlgItemInt(hwndDlg, IDC_ICQPORT, NULL, FALSE));
StoreDBCheckState(ppro, hwndDlg, IDC_KEEPALIVE, "KeepAlive");
StoreDBCheckState(ppro, hwndDlg, IDC_SSL, "SecureConnection");
StoreDBCheckState(ppro, hwndDlg, IDC_MD5LOGIN, "SecureLogin");
StoreDBCheckState(ppro, hwndDlg, IDC_LEGACY, "LegacyFix");
StoreDBCheckState(ppro, hwndDlg, IDC_NOERRMULTI, "IgnoreMultiErrorBox");
- ppro->setSettingByte(NULL, "ShowLogLevel", (BYTE)(4-SendDlgItemMessage(hwndDlg, IDC_LOGLEVEL, TBM_GETPOS, 0, 0)));
+ ppro->setByte("ShowLogLevel", (BYTE)(4-SendDlgItemMessage(hwndDlg, IDC_LOGLEVEL, TBM_GETPOS, 0, 0)));
return TRUE;
}
@@ -218,8 +218,8 @@ static INT_PTR CALLBACK DlgProcIcqPrivacyOpts(HWND hwndDlg, UINT msg, WPARAM wPa
ppro = (CIcqProto*)lParam;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
{
- int nDcType = ppro->getSettingByte(NULL, "DCType", 0);
- int nAddAuth = ppro->getSettingByte(NULL, "Auth", 1);
+ int nDcType = ppro->getByte("DCType", 0);
+ int nAddAuth = ppro->getByte("Auth", 1);
if (!ppro->icqOnline())
{
@@ -238,7 +238,7 @@ static INT_PTR CALLBACK DlgProcIcqPrivacyOpts(HWND hwndDlg, UINT msg, WPARAM wPa
LoadDBCheckState(ppro, hwndDlg, IDC_PUBLISHPRIMARY, "PublishPrimaryEmail", 0);
LoadDBCheckState(ppro, hwndDlg, IDC_STATUSMSG_CLIST, "StatusMsgReplyCList", 0);
LoadDBCheckState(ppro, hwndDlg, IDC_STATUSMSG_VISIBLE, "StatusMsgReplyVisible", 0);
- if (!ppro->getSettingByte(NULL, "StatusMsgReplyCList", 0))
+ if (!ppro->getByte("StatusMsgReplyCList", 0))
EnableDlgItem(hwndDlg, IDC_STATUSMSG_VISIBLE, FALSE);
}
return TRUE;
@@ -281,11 +281,11 @@ static INT_PTR CALLBACK DlgProcIcqPrivacyOpts(HWND hwndDlg, UINT msg, WPARAM wPa
StoreDBCheckState(ppro, hwndDlg, IDC_STATUSMSG_CLIST, "StatusMsgReplyCList");
StoreDBCheckState(ppro, hwndDlg, IDC_STATUSMSG_VISIBLE, "StatusMsgReplyVisible");
if (IsDlgButtonChecked(hwndDlg, IDC_DCALLOW_AUTH))
- ppro->setSettingByte(NULL, "DCType", 2);
+ ppro->setByte("DCType", 2);
else if (IsDlgButtonChecked(hwndDlg, IDC_DCALLOW_CLIST))
- ppro->setSettingByte(NULL, "DCType", 1);
+ ppro->setByte("DCType", 1);
else
- ppro->setSettingByte(NULL, "DCType", 0);
+ ppro->setByte("DCType", 0);
StoreDBCheckState(ppro, hwndDlg, IDC_ADD_AUTH, "Auth");
if (ppro->icqOnline())
@@ -293,9 +293,9 @@ static INT_PTR CALLBACK DlgProcIcqPrivacyOpts(HWND hwndDlg, UINT msg, WPARAM wPa
PBYTE buf=NULL;
int buflen=0;
- ppackTLVWord(&buf, &buflen, 0x19A, !ppro->getSettingByte(NULL, "Auth", 1));
- ppackTLVByte(&buf, &buflen, 0x212, ppro->getSettingByte(NULL, "WebAware", 0));
- ppackTLVWord(&buf, &buflen, 0x1F9, ppro->getSettingByte(NULL, "PrivacyLevel", 1));
+ ppackTLVWord(&buf, &buflen, 0x19A, !ppro->getByte("Auth", 1));
+ ppackTLVByte(&buf, &buflen, 0x212, ppro->getByte("WebAware", 0));
+ ppackTLVWord(&buf, &buflen, 0x1F9, ppro->getByte("PrivacyLevel", 1));
ppro->icq_changeUserDirectoryInfoServ(buf, (WORD)buflen, DIRECTORYREQUEST_UPDATEPRIVACY);
@@ -387,20 +387,20 @@ static INT_PTR CALLBACK DlgProcIcqFeaturesOpts(HWND hwndDlg, UINT msg, WPARAM wP
ppro = (CIcqProto*)lParam;
SetWindowLongPtr( hwndDlg, GWLP_USERDATA, lParam );
{
- BYTE byData = ppro->getSettingByte(NULL, "UtfEnabled", DEFAULT_UTF_ENABLED);
+ BYTE byData = ppro->getByte("UtfEnabled", DEFAULT_UTF_ENABLED);
CheckDlgButton(hwndDlg, IDC_UTFENABLE, byData?TRUE:FALSE);
CheckDlgButton(hwndDlg, IDC_UTFALL, byData==2?TRUE:FALSE);
icq_EnableMultipleControls(hwndDlg, icqUnicodeControls, SIZEOF(icqUnicodeControls), byData?TRUE:FALSE);
LoadDBCheckState(ppro, hwndDlg, IDC_TEMPVISIBLE, "TempVisListEnabled",DEFAULT_TEMPVIS_ENABLED);
LoadDBCheckState(ppro, hwndDlg, IDC_SLOWSEND, "SlowSend", DEFAULT_SLOWSEND);
LoadDBCheckState(ppro, hwndDlg, IDC_ONLYSERVERACKS, "OnlyServerAcks", DEFAULT_ONLYSERVERACKS);
- byData = ppro->getSettingByte(NULL, "DirectMessaging", DEFAULT_DCMSG_ENABLED);
+ byData = ppro->getByte("DirectMessaging", DEFAULT_DCMSG_ENABLED);
CheckDlgButton(hwndDlg, IDC_DCENABLE, byData?TRUE:FALSE);
CheckDlgButton(hwndDlg, IDC_DCPASSIVE, byData==1?TRUE:FALSE);
icq_EnableMultipleControls(hwndDlg, icqDCMsgControls, SIZEOF(icqDCMsgControls), byData?TRUE:FALSE);
- BYTE byXStatusEnabled = ppro->getSettingByte(NULL, "XStatusEnabled", DEFAULT_XSTATUS_ENABLED);
+ BYTE byXStatusEnabled = ppro->getByte("XStatusEnabled", DEFAULT_XSTATUS_ENABLED);
CheckDlgButton(hwndDlg, IDC_XSTATUSENABLE, byXStatusEnabled);
- BYTE byMoodsEnabled = ppro->getSettingByte(NULL, "MoodsEnabled", DEFAULT_MOODS_ENABLED);
+ BYTE byMoodsEnabled = ppro->getByte("MoodsEnabled", DEFAULT_MOODS_ENABLED);
CheckDlgButton(hwndDlg, IDC_MOODSENABLE, byMoodsEnabled);
icq_EnableMultipleControls(hwndDlg, icqXStatusControls, SIZEOF(icqXStatusControls), byXStatusEnabled);
icq_EnableMultipleControls(hwndDlg, icqCustomStatusControls, SIZEOF(icqCustomStatusControls), byXStatusEnabled || byMoodsEnabled);
@@ -411,7 +411,7 @@ static INT_PTR CALLBACK DlgProcIcqFeaturesOpts(HWND hwndDlg, UINT msg, WPARAM wP
icq_EnableMultipleControls(hwndDlg, icqAimControls, SIZEOF(icqAimControls), ppro->icqOnline()?FALSE:TRUE);
hCpCombo = GetDlgItem(hwndDlg, IDC_UTFCODEPAGE);
- int sCodePage = ppro->getSettingWord(NULL, "AnsiCodePage", CP_ACP);
+ int sCodePage = ppro->getWord("AnsiCodePage", CP_ACP);
ComboBoxAddStringUtf(GetDlgItem(hwndDlg, IDC_UTFCODEPAGE), LPGEN("System default codepage"), 0);
EnumSystemCodePagesA(FillCpCombo, CP_INSTALLED);
if(sCodePage == 0)
@@ -464,22 +464,22 @@ static INT_PTR CALLBACK DlgProcIcqFeaturesOpts(HWND hwndDlg, UINT msg, WPARAM wP
{
int i = SendDlgItemMessage(hwndDlg, IDC_UTFCODEPAGE, CB_GETCURSEL, 0, 0);
ppro->m_wAnsiCodepage = (WORD)SendDlgItemMessage(hwndDlg, IDC_UTFCODEPAGE, CB_GETITEMDATA, (WPARAM)i, 0);
- ppro->setSettingWord(NULL, "AnsiCodePage", ppro->m_wAnsiCodepage);
+ ppro->setWord("AnsiCodePage", ppro->m_wAnsiCodepage);
}
- ppro->setSettingByte(NULL, "UtfEnabled", ppro->m_bUtfEnabled);
+ ppro->setByte("UtfEnabled", ppro->m_bUtfEnabled);
ppro->m_bTempVisListEnabled = (BYTE)IsDlgButtonChecked(hwndDlg, IDC_TEMPVISIBLE);
- ppro->setSettingByte(NULL, "TempVisListEnabled", ppro->m_bTempVisListEnabled);
+ ppro->setByte("TempVisListEnabled", ppro->m_bTempVisListEnabled);
StoreDBCheckState(ppro, hwndDlg, IDC_SLOWSEND, "SlowSend");
StoreDBCheckState(ppro, hwndDlg, IDC_ONLYSERVERACKS, "OnlyServerAcks");
if (IsDlgButtonChecked(hwndDlg, IDC_DCENABLE))
ppro->m_bDCMsgEnabled = IsDlgButtonChecked(hwndDlg, IDC_DCPASSIVE)?1:2;
else
ppro->m_bDCMsgEnabled = 0;
- ppro->setSettingByte(NULL, "DirectMessaging", ppro->m_bDCMsgEnabled);
+ ppro->setByte("DirectMessaging", ppro->m_bDCMsgEnabled);
ppro->m_bXStatusEnabled = (BYTE)IsDlgButtonChecked(hwndDlg, IDC_XSTATUSENABLE);
- ppro->setSettingByte(NULL, "XStatusEnabled", ppro->m_bXStatusEnabled);
+ ppro->setByte("XStatusEnabled", ppro->m_bXStatusEnabled);
ppro->m_bMoodsEnabled = (BYTE)IsDlgButtonChecked(hwndDlg, IDC_MOODSENABLE);
- ppro->setSettingByte(NULL, "MoodsEnabled", ppro->m_bMoodsEnabled);
+ ppro->setByte("MoodsEnabled", ppro->m_bMoodsEnabled);
StoreDBCheckState(ppro, hwndDlg, IDC_XSTATUSAUTO, "XStatusAuto");
StoreDBCheckState(ppro, hwndDlg, IDC_XSTATUSRESET, "XStatusReset");
StoreDBCheckState(ppro, hwndDlg, IDC_KILLSPAMBOTS , "KillSpambots");
@@ -514,9 +514,9 @@ static INT_PTR CALLBACK DlgProcIcqContactsOpts(HWND hwndDlg, UINT msg, WPARAM wP
LoadDBCheckState(ppro, hwndDlg, IDC_STRICTAVATARCHECK, "StrictAvatarCheck", DEFAULT_AVATARS_CHECK);
icq_EnableMultipleControls(hwndDlg, icqContactsControls, SIZEOF(icqContactsControls),
- ppro->getSettingByte(NULL, "UseServerCList", DEFAULT_SS_ENABLED)?TRUE:FALSE);
+ ppro->getByte("UseServerCList", DEFAULT_SS_ENABLED)?TRUE:FALSE);
icq_EnableMultipleControls(hwndDlg, icqAvatarControls, SIZEOF(icqAvatarControls),
- ppro->getSettingByte(NULL, "AvatarsEnabled", DEFAULT_AVATARS_ENABLED)?TRUE:FALSE);
+ ppro->getByte("AvatarsEnabled", DEFAULT_AVATARS_ENABLED)?TRUE:FALSE);
if (ppro->icqOnline())
{
diff --git a/protocols/IcqOscarJ/src/icq_packet.cpp b/protocols/IcqOscarJ/src/icq_packet.cpp
index 79241cf297..0a727cc5aa 100644
--- a/protocols/IcqOscarJ/src/icq_packet.cpp
+++ b/protocols/IcqOscarJ/src/icq_packet.cpp
@@ -572,9 +572,9 @@ void CIcqProto::ppackTLVDateFromDB(PBYTE *buf, int *buflen, const char *szSettin
SYSTEMTIME sTime = {0};
double time = 0;
- sTime.wYear = getSettingWord(NULL, szSettingYear, 0);
- sTime.wMonth = getSettingByte(NULL, szSettingMonth, 0);
- sTime.wDay = getSettingByte(NULL, szSettingDay, 0);
+ sTime.wYear = getWord(szSettingYear, 0);
+ sTime.wMonth = getByte(szSettingMonth, 0);
+ sTime.wDay = getByte(szSettingDay, 0);
if (sTime.wYear || sTime.wMonth || sTime.wDay)
{
SystemTimeToVariantTime(&sTime, &time);
diff --git a/protocols/IcqOscarJ/src/icq_popups.cpp b/protocols/IcqOscarJ/src/icq_popups.cpp
index bef035a294..fdaa77cb30 100644
--- a/protocols/IcqOscarJ/src/icq_popups.cpp
+++ b/protocols/IcqOscarJ/src/icq_popups.cpp
@@ -55,30 +55,30 @@ INT_PTR CALLBACK DlgProcIcqPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
ppro = (CIcqProto*)lParam;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, lParam);
- CheckDlgButton(hwndDlg, IDC_POPUPS_LOG_ENABLED, ppro->getSettingByte(NULL,"PopupsLogEnabled",DEFAULT_LOG_POPUPS_ENABLED));
- CheckDlgButton(hwndDlg, IDC_POPUPS_SPAM_ENABLED, ppro->getSettingByte(NULL,"PopupsSpamEnabled",DEFAULT_SPAM_POPUPS_ENABLED));
- SendDlgItemMessage(hwndDlg, IDC_POPUP_LOG0_TEXTCOLOR, CPM_SETCOLOUR, 0, ppro->getSettingDword(NULL,"Popups0TextColor",DEFAULT_LOG0_TEXT_COLORS));
- SendDlgItemMessage(hwndDlg, IDC_POPUP_LOG0_BACKCOLOR, CPM_SETCOLOUR, 0, ppro->getSettingDword(NULL,"Popups0BackColor",DEFAULT_LOG0_BACK_COLORS));
- SetDlgItemInt(hwndDlg, IDC_POPUP_LOG0_TIMEOUT, ppro->getSettingDword(NULL,"Popups0Timeout",DEFAULT_LOG0_TIMEOUT),FALSE);
- SendDlgItemMessage(hwndDlg, IDC_POPUP_LOG1_TEXTCOLOR, CPM_SETCOLOUR, 0, ppro->getSettingDword(NULL,"Popups1TextColor",DEFAULT_LOG1_TEXT_COLORS));
- SendDlgItemMessage(hwndDlg, IDC_POPUP_LOG1_BACKCOLOR, CPM_SETCOLOUR, 0, ppro->getSettingDword(NULL,"Popups1BackColor",DEFAULT_LOG1_BACK_COLORS));
- SetDlgItemInt(hwndDlg, IDC_POPUP_LOG1_TIMEOUT, ppro->getSettingDword(NULL,"Popups1Timeout",DEFAULT_LOG1_TIMEOUT),FALSE);
- SendDlgItemMessage(hwndDlg, IDC_POPUP_LOG2_TEXTCOLOR, CPM_SETCOLOUR, 0, ppro->getSettingDword(NULL,"Popups2TextColor",DEFAULT_LOG2_TEXT_COLORS));
- SendDlgItemMessage(hwndDlg, IDC_POPUP_LOG2_BACKCOLOR, CPM_SETCOLOUR, 0, ppro->getSettingDword(NULL,"Popups2BackColor",DEFAULT_LOG2_BACK_COLORS));
- SetDlgItemInt(hwndDlg, IDC_POPUP_LOG2_TIMEOUT, ppro->getSettingDword(NULL,"Popups2Timeout",DEFAULT_LOG2_TIMEOUT),FALSE);
- SendDlgItemMessage(hwndDlg, IDC_POPUP_LOG3_TEXTCOLOR, CPM_SETCOLOUR, 0, ppro->getSettingDword(NULL,"Popups3TextColor",DEFAULT_LOG3_TEXT_COLORS));
- SendDlgItemMessage(hwndDlg, IDC_POPUP_LOG3_BACKCOLOR, CPM_SETCOLOUR, 0, ppro->getSettingDword(NULL,"Popups3BackColor",DEFAULT_LOG3_BACK_COLORS));
- SetDlgItemInt(hwndDlg, IDC_POPUP_LOG3_TIMEOUT, ppro->getSettingDword(NULL,"Popups3Timeout",DEFAULT_LOG3_TIMEOUT),FALSE);
- SendDlgItemMessage(hwndDlg, IDC_POPUP_SPAM_TEXTCOLOR, CPM_SETCOLOUR, 0, ppro->getSettingDword(NULL,"PopupsSpamTextColor",DEFAULT_SPAM_TEXT_COLORS));
- SendDlgItemMessage(hwndDlg, IDC_POPUP_SPAM_BACKCOLOR, CPM_SETCOLOUR, 0, ppro->getSettingDword(NULL,"PopupsSpamBackColor",DEFAULT_SPAM_BACK_COLORS));
- SetDlgItemInt(hwndDlg, IDC_POPUP_SPAM_TIMEOUT, ppro->getSettingDword(NULL,"PopupsSpamTimeout",DEFAULT_SPAM_TIMEOUT),FALSE);
- bEnabled = ppro->getSettingByte(NULL,"PopupsWinColors",DEFAULT_POPUPS_WIN_COLORS);
+ CheckDlgButton(hwndDlg, IDC_POPUPS_LOG_ENABLED, ppro->getByte(NULL,"PopupsLogEnabled",DEFAULT_LOG_POPUPS_ENABLED));
+ CheckDlgButton(hwndDlg, IDC_POPUPS_SPAM_ENABLED, ppro->getByte(NULL,"PopupsSpamEnabled",DEFAULT_SPAM_POPUPS_ENABLED));
+ SendDlgItemMessage(hwndDlg, IDC_POPUP_LOG0_TEXTCOLOR, CPM_SETCOLOUR, 0, ppro->getDword(NULL,"Popups0TextColor",DEFAULT_LOG0_TEXT_COLORS));
+ SendDlgItemMessage(hwndDlg, IDC_POPUP_LOG0_BACKCOLOR, CPM_SETCOLOUR, 0, ppro->getDword(NULL,"Popups0BackColor",DEFAULT_LOG0_BACK_COLORS));
+ SetDlgItemInt(hwndDlg, IDC_POPUP_LOG0_TIMEOUT, ppro->getDword(NULL,"Popups0Timeout",DEFAULT_LOG0_TIMEOUT),FALSE);
+ SendDlgItemMessage(hwndDlg, IDC_POPUP_LOG1_TEXTCOLOR, CPM_SETCOLOUR, 0, ppro->getDword(NULL,"Popups1TextColor",DEFAULT_LOG1_TEXT_COLORS));
+ SendDlgItemMessage(hwndDlg, IDC_POPUP_LOG1_BACKCOLOR, CPM_SETCOLOUR, 0, ppro->getDword(NULL,"Popups1BackColor",DEFAULT_LOG1_BACK_COLORS));
+ SetDlgItemInt(hwndDlg, IDC_POPUP_LOG1_TIMEOUT, ppro->getDword(NULL,"Popups1Timeout",DEFAULT_LOG1_TIMEOUT),FALSE);
+ SendDlgItemMessage(hwndDlg, IDC_POPUP_LOG2_TEXTCOLOR, CPM_SETCOLOUR, 0, ppro->getDword(NULL,"Popups2TextColor",DEFAULT_LOG2_TEXT_COLORS));
+ SendDlgItemMessage(hwndDlg, IDC_POPUP_LOG2_BACKCOLOR, CPM_SETCOLOUR, 0, ppro->getDword(NULL,"Popups2BackColor",DEFAULT_LOG2_BACK_COLORS));
+ SetDlgItemInt(hwndDlg, IDC_POPUP_LOG2_TIMEOUT, ppro->getDword(NULL,"Popups2Timeout",DEFAULT_LOG2_TIMEOUT),FALSE);
+ SendDlgItemMessage(hwndDlg, IDC_POPUP_LOG3_TEXTCOLOR, CPM_SETCOLOUR, 0, ppro->getDword(NULL,"Popups3TextColor",DEFAULT_LOG3_TEXT_COLORS));
+ SendDlgItemMessage(hwndDlg, IDC_POPUP_LOG3_BACKCOLOR, CPM_SETCOLOUR, 0, ppro->getDword(NULL,"Popups3BackColor",DEFAULT_LOG3_BACK_COLORS));
+ SetDlgItemInt(hwndDlg, IDC_POPUP_LOG3_TIMEOUT, ppro->getDword(NULL,"Popups3Timeout",DEFAULT_LOG3_TIMEOUT),FALSE);
+ SendDlgItemMessage(hwndDlg, IDC_POPUP_SPAM_TEXTCOLOR, CPM_SETCOLOUR, 0, ppro->getDword(NULL,"PopupsSpamTextColor",DEFAULT_SPAM_TEXT_COLORS));
+ SendDlgItemMessage(hwndDlg, IDC_POPUP_SPAM_BACKCOLOR, CPM_SETCOLOUR, 0, ppro->getDword(NULL,"PopupsSpamBackColor",DEFAULT_SPAM_BACK_COLORS));
+ SetDlgItemInt(hwndDlg, IDC_POPUP_SPAM_TIMEOUT, ppro->getDword(NULL,"PopupsSpamTimeout",DEFAULT_SPAM_TIMEOUT),FALSE);
+ bEnabled = ppro->getByte(NULL,"PopupsWinColors",DEFAULT_POPUPS_WIN_COLORS);
CheckDlgButton(hwndDlg, IDC_USEWINCOLORS, bEnabled);
- bEnabled |= ppro->getSettingByte(NULL,"PopupsDefColors",DEFAULT_POPUPS_DEF_COLORS);
+ bEnabled |= ppro->getByte(NULL,"PopupsDefColors",DEFAULT_POPUPS_DEF_COLORS);
CheckDlgButton(hwndDlg, IDC_USEDEFCOLORS, bEnabled);
icq_EnableMultipleControls(hwndDlg, icqPopupColorControls, SIZEOF(icqPopupColorControls), bEnabled);
- CheckDlgButton(hwndDlg, IDC_USESYSICONS, ppro->getSettingByte(NULL,"PopupsSysIcons",DEFAULT_POPUPS_SYS_ICONS));
- bEnabled = ppro->getSettingByte(NULL,"PopupsEnabled",DEFAULT_POPUPS_ENABLED);
+ CheckDlgButton(hwndDlg, IDC_USESYSICONS, ppro->getByte(NULL,"PopupsSysIcons",DEFAULT_POPUPS_SYS_ICONS));
+ bEnabled = ppro->getByte(NULL,"PopupsEnabled",DEFAULT_POPUPS_ENABLED);
CheckDlgButton(hwndDlg, IDC_POPUPS_ENABLED, bEnabled);
icq_EnableMultipleControls(hwndDlg, icqPopupsControls, SIZEOF(icqPopupsControls), bEnabled);
if (bEnabled)
@@ -172,27 +172,27 @@ INT_PTR CALLBACK DlgProcIcqPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
case WM_NOTIFY:
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
- ppro->setSettingByte(NULL,"PopupsEnabled",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_POPUPS_ENABLED));
- ppro->setSettingByte(NULL,"PopupsLogEnabled",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_POPUPS_LOG_ENABLED));
- ppro->setSettingByte(NULL,"PopupsSpamEnabled",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_POPUPS_SPAM_ENABLED));
- ppro->setSettingDword(NULL,"Popups0TextColor",SendDlgItemMessage(hwndDlg,IDC_POPUP_LOG0_TEXTCOLOR,CPM_GETCOLOUR,0,0));
- ppro->setSettingDword(NULL,"Popups0BackColor",SendDlgItemMessage(hwndDlg,IDC_POPUP_LOG0_BACKCOLOR,CPM_GETCOLOUR,0,0));
- ppro->setSettingDword(NULL,"Popups0Timeout",GetDlgItemInt(hwndDlg, IDC_POPUP_LOG0_TIMEOUT, NULL, FALSE));
- ppro->setSettingDword(NULL,"Popups1TextColor",SendDlgItemMessage(hwndDlg,IDC_POPUP_LOG1_TEXTCOLOR,CPM_GETCOLOUR,0,0));
- ppro->setSettingDword(NULL,"Popups1BackColor",SendDlgItemMessage(hwndDlg,IDC_POPUP_LOG1_BACKCOLOR,CPM_GETCOLOUR,0,0));
- ppro->setSettingDword(NULL,"Popups1Timeout",GetDlgItemInt(hwndDlg, IDC_POPUP_LOG1_TIMEOUT, NULL, FALSE));
- ppro->setSettingDword(NULL,"Popups2TextColor",SendDlgItemMessage(hwndDlg,IDC_POPUP_LOG2_TEXTCOLOR,CPM_GETCOLOUR,0,0));
- ppro->setSettingDword(NULL,"Popups2BackColor",SendDlgItemMessage(hwndDlg,IDC_POPUP_LOG2_BACKCOLOR,CPM_GETCOLOUR,0,0));
- ppro->setSettingDword(NULL,"Popups2Timeout",GetDlgItemInt(hwndDlg, IDC_POPUP_LOG2_TIMEOUT, NULL, FALSE));
- ppro->setSettingDword(NULL,"Popups3TextColor",SendDlgItemMessage(hwndDlg,IDC_POPUP_LOG3_TEXTCOLOR,CPM_GETCOLOUR,0,0));
- ppro->setSettingDword(NULL,"Popups3BackColor",SendDlgItemMessage(hwndDlg,IDC_POPUP_LOG3_BACKCOLOR,CPM_GETCOLOUR,0,0));
- ppro->setSettingDword(NULL,"Popups3Timeout",GetDlgItemInt(hwndDlg, IDC_POPUP_LOG3_TIMEOUT, NULL, FALSE));
- ppro->setSettingDword(NULL,"PopupsSpamTextColor",SendDlgItemMessage(hwndDlg,IDC_POPUP_SPAM_TEXTCOLOR,CPM_GETCOLOUR,0,0));
- ppro->setSettingDword(NULL,"PopupsSpamBackColor",SendDlgItemMessage(hwndDlg,IDC_POPUP_SPAM_BACKCOLOR,CPM_GETCOLOUR,0,0));
- ppro->setSettingDword(NULL,"PopupsSpamTimeout",GetDlgItemInt(hwndDlg, IDC_POPUP_SPAM_TIMEOUT, NULL, FALSE));
- ppro->setSettingByte(NULL,"PopupsWinColors",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_USEWINCOLORS));
- ppro->setSettingByte(NULL,"PopupsDefColors",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_USEDEFCOLORS));
- ppro->setSettingByte(NULL,"PopupsSysIcons",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_USESYSICONS));
+ ppro->setByte("PopupsEnabled",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_POPUPS_ENABLED));
+ ppro->setByte("PopupsLogEnabled",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_POPUPS_LOG_ENABLED));
+ ppro->setByte("PopupsSpamEnabled",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_POPUPS_SPAM_ENABLED));
+ ppro->setDword("Popups0TextColor",SendDlgItemMessage(hwndDlg,IDC_POPUP_LOG0_TEXTCOLOR,CPM_GETCOLOUR,0,0));
+ ppro->setDword("Popups0BackColor",SendDlgItemMessage(hwndDlg,IDC_POPUP_LOG0_BACKCOLOR,CPM_GETCOLOUR,0,0));
+ ppro->setDword("Popups0Timeout",GetDlgItemInt(hwndDlg, IDC_POPUP_LOG0_TIMEOUT, NULL, FALSE));
+ ppro->setDword("Popups1TextColor",SendDlgItemMessage(hwndDlg,IDC_POPUP_LOG1_TEXTCOLOR,CPM_GETCOLOUR,0,0));
+ ppro->setDword("Popups1BackColor",SendDlgItemMessage(hwndDlg,IDC_POPUP_LOG1_BACKCOLOR,CPM_GETCOLOUR,0,0));
+ ppro->setDword("Popups1Timeout",GetDlgItemInt(hwndDlg, IDC_POPUP_LOG1_TIMEOUT, NULL, FALSE));
+ ppro->setDword("Popups2TextColor",SendDlgItemMessage(hwndDlg,IDC_POPUP_LOG2_TEXTCOLOR,CPM_GETCOLOUR,0,0));
+ ppro->setDword("Popups2BackColor",SendDlgItemMessage(hwndDlg,IDC_POPUP_LOG2_BACKCOLOR,CPM_GETCOLOUR,0,0));
+ ppro->setDword("Popups2Timeout",GetDlgItemInt(hwndDlg, IDC_POPUP_LOG2_TIMEOUT, NULL, FALSE));
+ ppro->setDword("Popups3TextColor",SendDlgItemMessage(hwndDlg,IDC_POPUP_LOG3_TEXTCOLOR,CPM_GETCOLOUR,0,0));
+ ppro->setDword("Popups3BackColor",SendDlgItemMessage(hwndDlg,IDC_POPUP_LOG3_BACKCOLOR,CPM_GETCOLOUR,0,0));
+ ppro->setDword("Popups3Timeout",GetDlgItemInt(hwndDlg, IDC_POPUP_LOG3_TIMEOUT, NULL, FALSE));
+ ppro->setDword("PopupsSpamTextColor",SendDlgItemMessage(hwndDlg,IDC_POPUP_SPAM_TEXTCOLOR,CPM_GETCOLOUR,0,0));
+ ppro->setDword("PopupsSpamBackColor",SendDlgItemMessage(hwndDlg,IDC_POPUP_SPAM_BACKCOLOR,CPM_GETCOLOUR,0,0));
+ ppro->setDword("PopupsSpamTimeout",GetDlgItemInt(hwndDlg, IDC_POPUP_SPAM_TIMEOUT, NULL, FALSE));
+ ppro->setByte("PopupsWinColors",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_USEWINCOLORS));
+ ppro->setByte("PopupsDefColors",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_USEDEFCOLORS));
+ ppro->setByte("PopupsSysIcons",(BYTE)IsDlgButtonChecked(hwndDlg,IDC_USESYSICONS));
return TRUE;
}
break;
@@ -202,7 +202,7 @@ INT_PTR CALLBACK DlgProcIcqPopupOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR
int CIcqProto::ShowPopupMsg(HANDLE hContact, const char *szTitle, const char *szMsg, BYTE bType)
{
- if (bPopupService && getSettingByte(NULL, "PopupsEnabled", DEFAULT_POPUPS_ENABLED))
+ if (bPopupService && getByte("PopupsEnabled", DEFAULT_POPUPS_ENABLED))
{
POPUPDATAT ppd = { 0 };
LPCTSTR rsIcon;
@@ -247,32 +247,32 @@ int CIcqProto::ShowPopupMsg(HANDLE hContact, const char *szTitle, const char *sz
default:
return -1;
}
- if (!getSettingByte(NULL, "PopupsSysIcons", DEFAULT_POPUPS_SYS_ICONS))
+ if (!getByte("PopupsSysIcons", DEFAULT_POPUPS_SYS_ICONS))
ppd.lchIcon = Skin_GetIconByHandle(m_hProtoIcon);
else
ppd.lchIcon = (HICON)LoadImage( NULL, rsIcon, IMAGE_ICON, GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), LR_SHARED);
- if (getSettingByte(NULL, "PopupsWinColors", DEFAULT_POPUPS_WIN_COLORS)) {
+ if (getByte("PopupsWinColors", DEFAULT_POPUPS_WIN_COLORS)) {
ppd.colorText = GetSysColor(COLOR_WINDOWTEXT);
ppd.colorBack = GetSysColor(COLOR_WINDOW);
}
else {
- if (getSettingByte(NULL, "PopupsDefColors", DEFAULT_POPUPS_DEF_COLORS)) {
+ if (getByte("PopupsDefColors", DEFAULT_POPUPS_DEF_COLORS)) {
ppd.colorText = NULL;
ppd.colorBack = NULL;
}
else {
strcpy(szSetting, szPrefix);
strcat(szSetting, "TextColor");
- ppd.colorText = getSettingDword(NULL, szSetting, ppd.colorText);
+ ppd.colorText = getDword(szSetting, ppd.colorText);
strcpy(szSetting, szPrefix);
strcat(szSetting, "BackColor");
- ppd.colorBack = getSettingDword(NULL, szSetting, ppd.colorBack);
+ ppd.colorBack = getDword(szSetting, ppd.colorBack);
}
}
strcpy(szSetting, szPrefix);
strcat(szSetting, "Timeout");
- ppd.iSeconds = getSettingDword(NULL, szSetting, ppd.iSeconds);
+ ppd.iSeconds = getDword(szSetting, ppd.iSeconds);
char str[4096];
make_unicode_string_static( ICQTranslateUtfStatic(szTitle, str, sizeof(str)), ppd.lpwzContactName, MAX_CONTACTNAME);
diff --git a/protocols/IcqOscarJ/src/icq_proto.cpp b/protocols/IcqOscarJ/src/icq_proto.cpp
index cb5ee9948e..04260b55df 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(""));
- deleteSetting(hContact, "Grant");
+ db_unset(hContact, m_szModuleName, "Grant");
return 0; // Success
}
@@ -697,7 +697,7 @@ DWORD_PTR __cdecl CIcqProto::GetCaps( int type, HANDLE hContact )
PF1_ADDED | PF1_CONTACT;
if (!m_bAimEnabled)
nReturn |= PF1_NUMERICUSERID;
- if (m_bSsiEnabled && getSettingByte(NULL, "ServerAddRemove", DEFAULT_SS_ADDSERVER))
+ if (m_bSsiEnabled && getByte("ServerAddRemove", DEFAULT_SS_ADDSERVER))
nReturn |= PF1_SERVERCLIST;
break;
@@ -739,7 +739,7 @@ DWORD_PTR __cdecl CIcqProto::GetCaps( int type, HANDLE hContact )
case PFLAG_MAXCONTACTSPERPACKET:
if ( hContact )
{ // determine per contact
- BYTE bClientId = getSettingByte(hContact, "ClientID", CLID_GENERIC);
+ BYTE bClientId = getByte(hContact, "ClientID", CLID_GENERIC);
if (bClientId == CLID_MIRANDA)
{
@@ -1386,7 +1386,7 @@ HANDLE __cdecl CIcqProto::SendFile( HANDLE hContact, const TCHAR* szDescription,
if (dwUin)
{
- WORD wClientVersion = getSettingWord(hContact, "Version", 7);
+ WORD wClientVersion = getWord(hContact, "Version", 7);
if (wClientVersion < 7)
NetLog_Server("IcqSendFile() can't send to version %u", wClientVersion);
@@ -1514,7 +1514,7 @@ int __cdecl CIcqProto::SendMsg( HANDLE hContact, int flags, const char* pszSrc )
BOOL oldAnsi = plain_ascii || !m_bUtfEnabled ||
(!(flags & (PREF_UTF | PREF_UNICODE)) && m_bUtfEnabled == 1) ||
!CheckContactCapabilities(hContact, CAPF_UTF) ||
- !getSettingByte(hContact, "UnicodeSend", 1);
+ !getByte(hContact, "UnicodeSend", 1);
if (m_bTempVisListEnabled && m_iStatus == ID_STATUS_INVISIBLE)
makeContactTemporaryVisible(hContact); // make us temporarily visible to contact
@@ -1568,8 +1568,8 @@ int __cdecl CIcqProto::SendMsg( HANDLE hContact, int flags, const char* pszSrc )
if (!dwUin || !CheckContactCapabilities(hContact, CAPF_SRV_RELAY) ||
wRecipientStatus == ID_STATUS_OFFLINE || wRecipientStatus == ID_STATUS_INVISIBLE ||
- getSettingByte(hContact, "OnlyServerAcks", getSettingByte(NULL, "OnlyServerAcks", DEFAULT_ONLYSERVERACKS)) ||
- !getSettingByte(hContact, "SlowSend", getSettingByte(NULL, "SlowSend", DEFAULT_SLOWSEND)))
+ getByte(hContact, "OnlyServerAcks", getByte("OnlyServerAcks", DEFAULT_ONLYSERVERACKS)) ||
+ !getByte(hContact, "SlowSend", getByte("SlowSend", DEFAULT_SLOWSEND)))
{
/// TODO: add support for RTL & user customizable font
{
@@ -1798,12 +1798,12 @@ int __cdecl CIcqProto::SetApparentMode( HANDLE hContact, int mode )
// Only 3 modes are supported
if (mode == 0 || mode == ID_STATUS_ONLINE || mode == ID_STATUS_OFFLINE)
{
- int oldMode = getSettingWord(hContact, "ApparentMode", 0);
+ int oldMode = getWord(hContact, "ApparentMode", 0);
// Don't send redundant updates
if (mode != oldMode)
{
- setSettingWord(hContact, "ApparentMode", (WORD)mode);
+ setWord(hContact, "ApparentMode", (WORD)mode);
// Not being online is only an error when in SS mode. This is not handled
// yet so we just ignore this for now.
@@ -1811,17 +1811,17 @@ int __cdecl CIcqProto::SetApparentMode( HANDLE hContact, int mode )
{
if (oldMode != 0)
{ // Remove from old list
- if (oldMode == ID_STATUS_OFFLINE && getSettingWord(hContact, DBSETTING_SERVLIST_IGNORE, 0))
+ if (oldMode == ID_STATUS_OFFLINE && getWord(hContact, DBSETTING_SERVLIST_IGNORE, 0))
{ // Need to remove Ignore item as well
- icq_removeServerPrivacyItem(hContact, uin, uid, getSettingWord(hContact, DBSETTING_SERVLIST_IGNORE, 0), SSI_ITEM_IGNORE);
+ icq_removeServerPrivacyItem(hContact, uin, uid, getWord(hContact, DBSETTING_SERVLIST_IGNORE, 0), SSI_ITEM_IGNORE);
- setSettingWord(hContact, DBSETTING_SERVLIST_IGNORE, 0);
+ setWord(hContact, DBSETTING_SERVLIST_IGNORE, 0);
}
icq_sendChangeVisInvis(hContact, uin, uid, oldMode==ID_STATUS_OFFLINE, 0);
}
if (mode != 0)
{ // Add to new list
- if (mode==ID_STATUS_OFFLINE && getSettingWord(hContact, DBSETTING_SERVLIST_IGNORE, 0))
+ if (mode==ID_STATUS_OFFLINE && getWord(hContact, DBSETTING_SERVLIST_IGNORE, 0))
return 0; // Success: offline by ignore item
icq_sendChangeVisInvis(hContact, uin, uid, mode==ID_STATUS_OFFLINE, 1);
@@ -1884,7 +1884,7 @@ int __cdecl CIcqProto::SetStatus(int iNewStatus)
return 0;
// clear custom status on status change
- if (getSettingByte(NULL, "XStatusReset", DEFAULT_XSTATUS_RESET))
+ if (getByte("XStatusReset", DEFAULT_XSTATUS_RESET))
setXStatusEx(0, 0);
// New status is OFFLINE
@@ -2098,10 +2098,10 @@ HANDLE __cdecl CIcqProto::GetAwayMsg( HANDLE hContact )
}
if (CheckContactCapabilities(hContact, CAPF_STATUS_MESSAGES))
return (HANDLE)icq_sendGetAwayMsgServExt(hContact, dwUin, szUID, wMessageType,
- (WORD)(getSettingWord(hContact, "Version", 0)==9?9:ICQ_VERSION)); // Success
+ (WORD)(getWord(hContact, "Version", 0)==9?9:ICQ_VERSION)); // Success
else
return (HANDLE)icq_sendGetAwayMsgServ(hContact, dwUin, wMessageType,
- (WORD)(getSettingWord(hContact, "Version", 0)==9?9:ICQ_VERSION)); // Success
+ (WORD)(getWord(hContact, "Version", 0)==9?9:ICQ_VERSION)); // Success
}
}
else
diff --git a/protocols/IcqOscarJ/src/icq_proto.h b/protocols/IcqOscarJ/src/icq_proto.h
index 81a4c5755e..af852a7b8f 100644
--- a/protocols/IcqOscarJ/src/icq_proto.h
+++ b/protocols/IcqOscarJ/src/icq_proto.h
@@ -427,12 +427,7 @@ struct CIcqProto : public PROTO<CIcqProto>
int IsICQContact(HANDLE hContact);
int getSetting(HANDLE hContact, const char *szSetting, DBVARIANT *dbv);
- BYTE getSettingByte(HANDLE hContact, const char *szSetting, BYTE byDef);
- WORD getSettingWord(HANDLE hContact, const char *szSetting, WORD wDef);
- DWORD getSettingDword(HANDLE hContact, const char *szSetting, DWORD dwDef);
double getSettingDouble(HANDLE hContact, const char *szSetting, double dDef);
- int getSettingString(HANDLE hContact, const char *szSetting, DBVARIANT *dbv);
- int getSettingStringW(HANDLE hContact, const char *szSetting, DBVARIANT *dbv);
int getSettingStringStatic(HANDLE hContact, const char *szSetting, char *dest, int dest_len);
char* getSettingStringUtf(HANDLE hContact, const char *szModule, const char *szSetting, char *szDef);
char* getSettingStringUtf(HANDLE hContact, const char *szSetting, char *szDef);
@@ -441,16 +436,7 @@ struct CIcqProto : public PROTO<CIcqProto>
WORD getContactStatus(HANDLE hContact);
char* getContactCListGroup(HANDLE hContact);
- int deleteSetting(HANDLE hContact, const char *szSetting);
-
- int setSettingByte(HANDLE hContact, const char *szSetting, BYTE byValue);
- int setSettingWord(HANDLE hContact, const char *szSetting, WORD wValue);
- int setSettingDword(HANDLE hContact, const char *szSetting, DWORD dwValue);
int setSettingDouble(HANDLE hContact, const char *szSetting, double dValue);
- int setSettingString(HANDLE hContact, const char *szSetting, const char *szValue);
- int setSettingStringW(HANDLE hContact, const char *szSetting, const WCHAR *wszValue);
- int setSettingStringUtf(HANDLE hContact, const char *szModule, const char *szSetting, const char *szValue);
- int setSettingStringUtf(HANDLE hContact, const char *szSetting, const char *szValue);
int setSettingBlob(HANDLE hContact, const char *szSetting, const BYTE *pValue, const int cbValue);
int setContactHidden(HANDLE hContact, BYTE bHidden);
void setStatusMsgVar(HANDLE hContact, char* szStatusMsg, bool isAnsi);
diff --git a/protocols/IcqOscarJ/src/icq_server.cpp b/protocols/IcqOscarJ/src/icq_server.cpp
index cb02eec4ad..4a4aebba2e 100644
--- a/protocols/IcqOscarJ/src/icq_server.cpp
+++ b/protocols/IcqOscarJ/src/icq_server.cpp
@@ -88,17 +88,17 @@ void __cdecl CIcqProto::ServerThread(serverthread_start_info *infoParam)
// Initialize direct connection ports
{
DWORD dwInternalIP;
- BYTE bConstInternalIP = getSettingByte(NULL, "ConstRealIP", 0);
+ BYTE bConstInternalIP = getByte("ConstRealIP", 0);
info.hDirectBoundPort = NetLib_BindPort(icq_newConnectionReceived, this, &wListenPort, &dwInternalIP);
if (!info.hDirectBoundPort)
{
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) deleteSetting(NULL, "RealIP");
+ if (!bConstInternalIP) db_unset(NULL, m_szModuleName, "RealIP");
}
else if (!bConstInternalIP)
- setSettingDword(NULL, "RealIP", dwInternalIP);
+ setDword("RealIP", dwInternalIP);
}
// Initialize rate limiting queues
@@ -204,7 +204,7 @@ void __cdecl CIcqProto::ServerThread(serverthread_start_info *infoParam)
{
char tmp = 0;
- setSettingWord(hContact, "Status", ID_STATUS_OFFLINE);
+ setWord(hContact, "Status", ID_STATUS_OFFLINE);
handleXStatusCaps(dwUIN, szUID, hContact, (BYTE*)&tmp, 0, &tmp, 0);
}
@@ -213,7 +213,7 @@ void __cdecl CIcqProto::ServerThread(serverthread_start_info *infoParam)
hContact = FindNextContact(hContact);
}
- setSettingDword(NULL, "LogonTS", 0); // clear logon time
+ setDword("LogonTS", 0); // clear logon time
servlistPendingFlushOperations(); // clear pending operations list
@@ -421,7 +421,7 @@ void CIcqProto::icq_login(const char* szPassword)
stsi->nloc.szHost = null_strdup(szServer);
// Server port
- stsi->nloc.wPort = getSettingWord(NULL, "OscarPort", m_bSecureConnection ? DEFAULT_SERVER_PORT_SSL : DEFAULT_SERVER_PORT);
+ stsi->nloc.wPort = getWord("OscarPort", m_bSecureConnection ? DEFAULT_SERVER_PORT_SSL : DEFAULT_SERVER_PORT);
if (stsi->nloc.wPort == 0)
stsi->nloc.wPort = RandRange(1024, 65535);
diff --git a/protocols/IcqOscarJ/src/icq_servlist.cpp b/protocols/IcqOscarJ/src/icq_servlist.cpp
index 19f029f6ff..ee23a072c5 100644
--- a/protocols/IcqOscarJ/src/icq_servlist.cpp
+++ b/protocols/IcqOscarJ/src/icq_servlist.cpp
@@ -968,15 +968,15 @@ void CIcqProto::LoadServerIDs()
int nGroups = 0, nContacts = 0, nPermits = 0, nDenys = 0, nIgnores = 0, nUnhandled = 0;
servlistMutex->Enter();
- if (wSrvID = getSettingWord(NULL, DBSETTING_SERVLIST_AVATAR, 0))
+ if (wSrvID = getWord(DBSETTING_SERVLIST_AVATAR, 0))
ReserveServerID(wSrvID, SSIT_ITEM, 0);
- if (wSrvID = getSettingWord(NULL, DBSETTING_SERVLIST_PHOTO, 0))
+ if (wSrvID = getWord(DBSETTING_SERVLIST_PHOTO, 0))
ReserveServerID(wSrvID, SSIT_ITEM, 0);
- if (wSrvID = getSettingWord(NULL, DBSETTING_SERVLIST_PRIVACY, 0))
+ if (wSrvID = getWord(DBSETTING_SERVLIST_PRIVACY, 0))
ReserveServerID(wSrvID, SSIT_ITEM, 0);
- if (wSrvID = getSettingWord(NULL, DBSETTING_SERVLIST_METAINFO, 0))
+ if (wSrvID = getWord(DBSETTING_SERVLIST_METAINFO, 0))
ReserveServerID(wSrvID, SSIT_ITEM, 0);
- if (wSrvID = getSettingWord(NULL, "SrvImportID", 0))
+ if (wSrvID = getWord("SrvImportID", 0))
ReserveServerID(wSrvID, SSIT_ITEM, 0);
DBCONTACTENUMSETTINGS dbces;
@@ -997,22 +997,22 @@ void CIcqProto::LoadServerIDs()
while (hContact)
{ // search all our contacts, reserve their server IDs
- if (wSrvID = getSettingWord(hContact, DBSETTING_SERVLIST_ID, 0))
+ if (wSrvID = getWord(hContact, DBSETTING_SERVLIST_ID, 0))
{
ReserveServerID(wSrvID, SSIT_ITEM, 0);
nContacts++;
}
- if (wSrvID = getSettingWord(hContact, DBSETTING_SERVLIST_DENY, 0))
+ if (wSrvID = getWord(hContact, DBSETTING_SERVLIST_DENY, 0))
{
ReserveServerID(wSrvID, SSIT_ITEM, 0);
nDenys++;
}
- if (wSrvID = getSettingWord(hContact, DBSETTING_SERVLIST_PERMIT, 0))
+ if (wSrvID = getWord(hContact, DBSETTING_SERVLIST_PERMIT, 0))
{
ReserveServerID(wSrvID, SSIT_ITEM, 0);
nPermits++;
}
- if (wSrvID = getSettingWord(hContact, DBSETTING_SERVLIST_IGNORE, 0))
+ if (wSrvID = getWord(hContact, DBSETTING_SERVLIST_IGNORE, 0))
{
ReserveServerID(wSrvID, SSIT_ITEM, 0);
nIgnores++;
@@ -1068,7 +1068,7 @@ void CIcqProto::StoreServerIDs() /// TODO: allow delayed
if (pUnhandled)
setSettingBlob(NULL, DBSETTING_SERVLIST_UNHANDLED, pUnhandled, cbUnhandled);
else
- deleteSetting(NULL, DBSETTING_SERVLIST_UNHANDLED);
+ db_unset(NULL, m_szModuleName, DBSETTING_SERVLIST_UNHANDLED);
SAFE_FREE((void**)&pUnhandled);
}
@@ -1159,7 +1159,7 @@ DWORD CIcqProto::icq_sendServerItem(DWORD dwCookie, WORD wAction, WORD wGroupId,
}
// Force reload of server-list after change
- setSettingWord(NULL, "SrvRecordCount", 0);
+ setWord("SrvRecordCount", 0);
return dwCookie;
}
@@ -1184,7 +1184,7 @@ DWORD CIcqProto::icq_sendServerContact(HANDLE hContact, DWORD dwCookie, WORD wAc
return 0;
}
- bAuth = getSettingByte(hContact, "Auth", 0);
+ bAuth = getByte(hContact, "Auth", 0);
szNick = getSettingStringUtf(hContact, "CList", "MyHandle", NULL);
szNote = getSettingStringUtf(hContact, "UserInfo", "MyNotes", NULL);
@@ -1347,7 +1347,7 @@ int CIcqProto::IsServerGroupsDefined()
{
int iRes = 1;
- if (getSettingDword(NULL, "Version", 0) < 0x00030608)
+ if (getDword("Version", 0) < 0x00030608)
{ // group cache & linking data too old, flush, reload from server
char szModule[MAX_PATH];
@@ -1358,7 +1358,7 @@ int CIcqProto::IsServerGroupsDefined()
iRes = 0; // no groups defined, or older version
}
// store our current version
- setSettingDword(NULL, "Version", ICQ_PLUG_VERSION & 0x00FFFFFF);
+ setDword("Version", ICQ_PLUG_VERSION & 0x00FFFFFF);
return iRes;
}
@@ -1385,9 +1385,9 @@ void* CIcqProto::collectBuddyGroup(WORD wGroupID, int *count)
while (hContact)
{ // search all contacts
- if (wGroupID == getSettingWord(hContact, DBSETTING_SERVLIST_GROUP, 0))
+ if (wGroupID == getWord(hContact, DBSETTING_SERVLIST_GROUP, 0))
{ // add only buddys from specified group
- wItemID = getSettingWord(hContact, DBSETTING_SERVLIST_ID, 0);
+ wItemID = getWord(hContact, DBSETTING_SERVLIST_ID, 0);
if (wItemID)
{ // valid ID, add
@@ -1420,7 +1420,7 @@ void* CIcqProto::collectGroups(int *count)
while (hContact)
{ // search all contacts
- if (wGroupID = getSettingWord(hContact, DBSETTING_SERVLIST_GROUP, 0))
+ if (wGroupID = getWord(hContact, DBSETTING_SERVLIST_GROUP, 0))
{ // add only valid IDs
for (i = 0; i<cnt; i++)
{ // check for already added ids
@@ -1529,7 +1529,7 @@ void CIcqProto::setServListGroupName(WORD wGroupID, const char *szGroupName)
_itoa(wGroupID, szGroup, 0x10);
if (szGroupName)
- setSettingStringUtf(NULL, szModule, szGroup, szGroupName);
+ db_set_utf(NULL, szModule, szGroup, szGroupName);
else
{
db_unset(NULL, szModule, szGroup);
@@ -1640,7 +1640,7 @@ int CIcqProto::moveContactToCListGroup(HANDLE hContact, const char *szGroup)
if (ServiceExists(MS_CLIST_CONTACTCHANGEGROUP))
return CallService(MS_CLIST_CONTACTCHANGEGROUP, (WPARAM)hContact, hGroup);
else /// TODO: is this neccessary ?
- return setSettingStringUtf(hContact, "CList", "Group", szGroup);
+ return db_set_utf(hContact, "CList", "Group", szGroup);
}
@@ -2040,7 +2040,7 @@ int CIcqProto::servlistAddContact_gotGroup(const char *szGroup, WORD wGroupID, L
return CALLBACK_RESULT_CONTINUE;
}
- WORD wItemID = getSettingWord(ack->hContact, DBSETTING_SERVLIST_ID, 0);
+ WORD wItemID = getWord(ack->hContact, DBSETTING_SERVLIST_ID, 0);
if (wItemID) /// TODO: redundant ???
{ // Only add the contact if it doesnt already have an ID
@@ -2076,11 +2076,11 @@ int CIcqProto::servlistAddContact_Ready(HANDLE hContact, WORD wContactID, WORD w
return CALLBACK_RESULT_CONTINUE;
}
- WORD wItemID = getSettingWord(ack->hContact, DBSETTING_SERVLIST_ID, 0);
+ WORD wItemID = getWord(ack->hContact, DBSETTING_SERVLIST_ID, 0);
if (wItemID)
{ // Only add the contact if it doesn't already have an ID
- servlistPendingRemoveContact(ack->hContact, wItemID, getSettingWord(hContact, DBSETTING_SERVLIST_GROUP, 0), PENDING_RESULT_SUCCESS);
+ servlistPendingRemoveContact(ack->hContact, wItemID, getWord(hContact, DBSETTING_SERVLIST_GROUP, 0), PENDING_RESULT_SUCCESS);
NetLog_Server("Failed to add contact to server side list (%s)", "already there");
SAFE_FREE((void**)&ack->szGroup);
SAFE_FREE((void**)&ack);
@@ -2138,7 +2138,7 @@ int CIcqProto::servlistRemoveContact_Ready(HANDLE hContact, WORD contactID, WORD
}
// Get the contact's group ID
- if (!(wGroupID = getSettingWord(hContact, DBSETTING_SERVLIST_GROUP, 0)))
+ if (!(wGroupID = getWord(hContact, DBSETTING_SERVLIST_GROUP, 0)))
{ // Could not find a usable group ID
servlistPendingRemoveContact(hContact, contactID, groupID, PENDING_RESULT_FAILED);
@@ -2148,7 +2148,7 @@ int CIcqProto::servlistRemoveContact_Ready(HANDLE hContact, WORD contactID, WORD
}
// Get the contact's item ID
- if (!(wItemID = getSettingWord(hContact, DBSETTING_SERVLIST_ID, 0)))
+ if (!(wItemID = getWord(hContact, DBSETTING_SERVLIST_ID, 0)))
{ // Could not find usable item ID
servlistPendingRemoveContact(hContact, contactID, wGroupID, PENDING_RESULT_FAILED);
@@ -2219,8 +2219,8 @@ int CIcqProto::servlistMoveContact_gotTargetGroup(const char *szGroup, WORD wNew
return CALLBACK_RESULT_CONTINUE;
}
- WORD wItemID = getSettingWord(ack->hContact, DBSETTING_SERVLIST_ID, 0);
- WORD wGroupID = getSettingWord(ack->hContact, DBSETTING_SERVLIST_GROUP, 0);
+ WORD wItemID = getWord(ack->hContact, DBSETTING_SERVLIST_ID, 0);
+ WORD wGroupID = getWord(ack->hContact, DBSETTING_SERVLIST_GROUP, 0);
if (!wItemID)
{ // We have no ID, so try to simply add the contact to serv-list
@@ -2268,8 +2268,8 @@ int CIcqProto::servlistMoveContact_Ready(HANDLE hContact, WORD contactID, WORD g
return CALLBACK_RESULT_CONTINUE;
}
- WORD wItemID = getSettingWord(ack->hContact, DBSETTING_SERVLIST_ID, 0);
- WORD wGroupID = getSettingWord(ack->hContact, DBSETTING_SERVLIST_GROUP, 0);
+ WORD wItemID = getWord(ack->hContact, DBSETTING_SERVLIST_ID, 0);
+ WORD wGroupID = getWord(ack->hContact, DBSETTING_SERVLIST_GROUP, 0);
if (!wGroupID && wItemID)
{ // Only move the contact if it had an GroupID
@@ -2309,9 +2309,9 @@ void CIcqProto::servlistMoveContact(HANDLE hContact, const char *pszNewGroup)
return;
}
- if (!getSettingWord(hContact, DBSETTING_SERVLIST_ID, 0)) /// FIXME:::: this should be in _ready
+ if (!getWord(hContact, DBSETTING_SERVLIST_ID, 0)) /// FIXME:::: this should be in _ready
{ // the contact is not stored on the server, check if we should try to add
- if (!getSettingByte(NULL, "ServerAddRemove", DEFAULT_SS_ADDSERVER) ||
+ if (!getByte("ServerAddRemove", DEFAULT_SS_ADDSERVER) ||
db_get_b(hContact, "CList", "Hidden", 0))
return;
}
@@ -2346,7 +2346,7 @@ int CIcqProto::servlistUpdateContact_Ready(HANDLE hContact, WORD contactID, WORD
WORD wGroupID;
// Get the contact's group ID
- if (!(wGroupID = getSettingWord(hContact, DBSETTING_SERVLIST_GROUP, 0)))
+ if (!(wGroupID = getWord(hContact, DBSETTING_SERVLIST_GROUP, 0)))
{
servlistPendingRemoveContact(hContact, contactID, groupID, PENDING_RESULT_FAILED);
// Could not find a usable group ID
@@ -2356,7 +2356,7 @@ int CIcqProto::servlistUpdateContact_Ready(HANDLE hContact, WORD contactID, WORD
}
// Get the contact's item ID
- if (!(wItemID = getSettingWord(hContact, DBSETTING_SERVLIST_ID, 0)))
+ if (!(wItemID = getWord(hContact, DBSETTING_SERVLIST_ID, 0)))
{
servlistPendingRemoveContact(hContact, contactID, wGroupID, PENDING_RESULT_FAILED);
// Could not find usable item ID
@@ -2591,8 +2591,8 @@ void CIcqProto::servlistRemoveGroup(const char *szGroup, WORD wGroupId)
void CIcqProto::resetServContactAuthState(HANDLE hContact, DWORD dwUin)
{
- WORD wContactId = getSettingWord(hContact, DBSETTING_SERVLIST_ID, 0);
- WORD wGroupId = getSettingWord(hContact, DBSETTING_SERVLIST_GROUP, 0);
+ WORD wContactId = getWord(hContact, DBSETTING_SERVLIST_ID, 0);
+ WORD wGroupId = getWord(hContact, DBSETTING_SERVLIST_GROUP, 0);
if (wContactId && wGroupId)
{
@@ -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);
- deleteSetting(hContact, DBSETTING_METAINFO_TOKEN);
- deleteSetting(hContact, DBSETTING_METAINFO_TIME);
- deleteSetting(hContact, DBSETTING_SERVLIST_DATA);
+ db_unset(hContact, m_szModuleName, DBSETTING_METAINFO_TOKEN);
+ db_unset(hContact, m_szModuleName, DBSETTING_METAINFO_TIME);
+ db_unset(hContact, m_szModuleName, DBSETTING_SERVLIST_DATA);
icq_sendServerContact(hContact, dwCookie, ICQ_LISTS_ADDTOLIST, wGroupId, wContactId, SSO_CONTACT_FIXAUTH | SSOF_BEGIN_OPERATION | SSOF_END_OPERATION, 200, &doubleObject);
}
}
@@ -2647,14 +2647,14 @@ int CIcqProto::ServListDbSettingChanged(WPARAM wParam, LPARAM lParam)
{
// Has contact been renamed?
if (!strcmpnull(cws->szSetting, "MyHandle") &&
- getSettingByte(NULL, "StoreServerDetails", DEFAULT_SS_STORE))
+ getByte("StoreServerDetails", DEFAULT_SS_STORE))
{ // Update contact's details in server-list
servlistUpdateContact((HANDLE)wParam);
}
// Has contact been moved to another group?
if (!strcmpnull(cws->szSetting, "Group") &&
- getSettingByte(NULL, "StoreServerDetails", DEFAULT_SS_STORE))
+ getByte("StoreServerDetails", DEFAULT_SS_STORE))
{ // Read group from DB
char* szNewGroup = getContactCListGroup((HANDLE)wParam);
@@ -2664,7 +2664,7 @@ int CIcqProto::ServListDbSettingChanged(WPARAM wParam, LPARAM lParam)
else if (!strcmpnull(cws->szModule, "UserInfo"))
{
if (!strcmpnull(cws->szSetting, "MyNotes") &&
- getSettingByte(NULL, "StoreServerDetails", DEFAULT_SS_STORE))
+ getByte("StoreServerDetails", DEFAULT_SS_STORE))
{ // Update contact's details in server-list
servlistUpdateContact((HANDLE)wParam);
}
@@ -2684,7 +2684,7 @@ int CIcqProto::ServListDbContactDeleted(WPARAM wParam, LPARAM lParam)
if ( !icqOnline() && m_bSsiEnabled)
{ // contact was deleted only locally - retrieve full list on next connect
- setSettingWord((HANDLE)wParam, "SrvRecordCount", 0);
+ setWord((HANDLE)wParam, "SrvRecordCount", 0);
}
if ( !icqOnline() || !m_bSsiEnabled)
@@ -2697,11 +2697,11 @@ int CIcqProto::ServListDbContactDeleted(WPARAM wParam, LPARAM lParam)
if (getContactUid((HANDLE)wParam, &dwUIN, &szUID))
return 0;
- WORD wContactID = getSettingWord((HANDLE)wParam, DBSETTING_SERVLIST_ID, 0);
- WORD wGroupID = getSettingWord((HANDLE)wParam, DBSETTING_SERVLIST_GROUP, 0);
- WORD wVisibleID = getSettingWord((HANDLE)wParam, DBSETTING_SERVLIST_PERMIT, 0);
- WORD wInvisibleID = getSettingWord((HANDLE)wParam, DBSETTING_SERVLIST_DENY, 0);
- WORD wIgnoreID = getSettingWord((HANDLE)wParam, DBSETTING_SERVLIST_IGNORE, 0);
+ WORD wContactID = getWord((HANDLE)wParam, DBSETTING_SERVLIST_ID, 0);
+ WORD wGroupID = getWord((HANDLE)wParam, DBSETTING_SERVLIST_GROUP, 0);
+ WORD wVisibleID = getWord((HANDLE)wParam, DBSETTING_SERVLIST_PERMIT, 0);
+ WORD wInvisibleID = getWord((HANDLE)wParam, DBSETTING_SERVLIST_DENY, 0);
+ WORD wIgnoreID = getWord((HANDLE)wParam, DBSETTING_SERVLIST_IGNORE, 0);
// Remove from queue for user details request
icq_DequeueUser(dwUIN);
@@ -2746,7 +2746,7 @@ int CIcqProto::ServListCListGroupChange(WPARAM wParam, LPARAM lParam)
return 0;
// only change server-list if it is allowed
- if (!getSettingByte(NULL, "StoreServerDetails", DEFAULT_SS_STORE))
+ if (!getByte("StoreServerDetails", DEFAULT_SS_STORE))
return 0;
diff --git a/protocols/IcqOscarJ/src/icq_uploadui.cpp b/protocols/IcqOscarJ/src/icq_uploadui.cpp
index 0b37e6ad22..8275a03f4a 100644
--- a/protocols/IcqOscarJ/src/icq_uploadui.cpp
+++ b/protocols/IcqOscarJ/src/icq_uploadui.cpp
@@ -93,7 +93,7 @@ static int UpdateCheckmarks(HWND hwndList, CIcqProto* ppro, HANDLE phItemAll)
HANDLE hItem = (HANDLE)SendMessage(hwndList, CLM_FINDCONTACT, (WPARAM)hContact, 0);
if (hItem)
{
- if (ppro->getSettingWord(hContact, DBSETTING_SERVLIST_ID, 0))
+ if (ppro->getWord(hContact, DBSETTING_SERVLIST_ID, 0))
SendMessage(hwndList, CLM_SETCHECKMARK, (WPARAM)hItem, 1);
else
bAll = 0;
@@ -345,9 +345,9 @@ static INT_PTR CALLBACK DlgProcUploadList(HWND hwndDlg,UINT message,WPARAM wPara
case ACTION_ADDBUDDY:
if (ack->result == ACKRESULT_SUCCESS)
{
- ppro->setSettingByte(hCurrentContact, "Auth", 0);
- ppro->setSettingWord(hCurrentContact, DBSETTING_SERVLIST_ID, wNewContactId);
- ppro->setSettingWord(hCurrentContact, DBSETTING_SERVLIST_GROUP, wNewGroupId);
+ ppro->setByte(hCurrentContact, "Auth", 0);
+ ppro->setWord(hCurrentContact, DBSETTING_SERVLIST_ID, wNewContactId);
+ ppro->setWord(hCurrentContact, DBSETTING_SERVLIST_GROUP, wNewGroupId);
break;
}
else
@@ -356,7 +356,7 @@ static INT_PTR CALLBACK DlgProcUploadList(HWND hwndDlg,UINT message,WPARAM wPara
DWORD dwUIN;
uid_str szUID;
- ppro->setSettingByte(hCurrentContact, "Auth", 1);
+ ppro->setByte(hCurrentContact, "Auth", 1);
if (!ppro->getContactUid(hCurrentContact, &dwUIN, &szUID))
{
@@ -370,12 +370,12 @@ static INT_PTR CALLBACK DlgProcUploadList(HWND hwndDlg,UINT message,WPARAM wPara
case ACTION_ADDBUDDYAUTH:
if (ack->result == ACKRESULT_SUCCESS)
{
- ppro->setSettingWord(hCurrentContact, DBSETTING_SERVLIST_ID, wNewContactId);
- ppro->setSettingWord(hCurrentContact, DBSETTING_SERVLIST_GROUP, wNewGroupId);
+ ppro->setWord(hCurrentContact, DBSETTING_SERVLIST_ID, wNewContactId);
+ ppro->setWord(hCurrentContact, DBSETTING_SERVLIST_GROUP, wNewGroupId);
}
else
{
- ppro->deleteSetting(hCurrentContact, "Auth");
+ db_unset(hCurrentContact, ppro->m_szModuleName, "Auth");
ppro->FreeServerID(wNewContactId, SSIT_ITEM);
}
@@ -385,9 +385,9 @@ static INT_PTR CALLBACK DlgProcUploadList(HWND hwndDlg,UINT message,WPARAM wPara
if (ack->result == ACKRESULT_SUCCESS)
{ // clear obsolete settings
ppro->FreeServerID(wNewContactId, SSIT_ITEM);
- ppro->deleteSetting(hCurrentContact, DBSETTING_SERVLIST_ID);
- ppro->deleteSetting(hCurrentContact, DBSETTING_SERVLIST_GROUP);
- ppro->deleteSetting(hCurrentContact, "Auth");
+ db_unset(hCurrentContact, ppro->m_szModuleName, DBSETTING_SERVLIST_ID);
+ db_unset(hCurrentContact, ppro->m_szModuleName, DBSETTING_SERVLIST_GROUP);
+ db_unset(hCurrentContact, ppro->m_szModuleName, "Auth");
}
break;
@@ -458,23 +458,23 @@ static INT_PTR CALLBACK DlgProcUploadList(HWND hwndDlg,UINT message,WPARAM wPara
case ACTION_MOVECONTACT:
if (ack->result == ACKRESULT_SUCCESS)
{
- ppro->FreeServerID(ppro->getSettingWord(hCurrentContact, DBSETTING_SERVLIST_ID, 0), SSIT_ITEM);
- ppro->setSettingWord(hCurrentContact, DBSETTING_SERVLIST_ID, wNewContactId);
- ppro->setSettingWord(hCurrentContact, DBSETTING_SERVLIST_GROUP, wNewGroupId);
+ ppro->FreeServerID(ppro->getWord(hCurrentContact, DBSETTING_SERVLIST_ID, 0), SSIT_ITEM);
+ ppro->setWord(hCurrentContact, DBSETTING_SERVLIST_ID, wNewContactId);
+ ppro->setWord(hCurrentContact, DBSETTING_SERVLIST_GROUP, wNewGroupId);
dwUploadDelay *= 2; // we double the delay here (2 packets)
}
break;
case ACTION_ADDVISIBLE:
if (ack->result == ACKRESULT_SUCCESS)
- ppro->setSettingWord(hCurrentContact, DBSETTING_SERVLIST_PERMIT, wNewContactId);
+ ppro->setWord(hCurrentContact, DBSETTING_SERVLIST_PERMIT, wNewContactId);
else
ppro->FreeServerID(wNewContactId, SSIT_ITEM);
break;
case ACTION_ADDINVISIBLE:
if (ack->result == ACKRESULT_SUCCESS)
- ppro->setSettingWord(hCurrentContact, DBSETTING_SERVLIST_DENY, wNewContactId);
+ ppro->setWord(hCurrentContact, DBSETTING_SERVLIST_DENY, wNewContactId);
else
ppro->FreeServerID(wNewContactId, SSIT_ITEM);
break;
@@ -483,7 +483,7 @@ static INT_PTR CALLBACK DlgProcUploadList(HWND hwndDlg,UINT message,WPARAM wPara
if (ack->result == ACKRESULT_SUCCESS)
{
ppro->FreeServerID(wNewContactId, SSIT_ITEM);
- ppro->setSettingWord(hCurrentContact, DBSETTING_SERVLIST_PERMIT, 0);
+ ppro->setWord(hCurrentContact, DBSETTING_SERVLIST_PERMIT, 0);
}
break;
@@ -491,7 +491,7 @@ static INT_PTR CALLBACK DlgProcUploadList(HWND hwndDlg,UINT message,WPARAM wPara
if (ack->result == ACKRESULT_SUCCESS)
{
ppro->FreeServerID(wNewContactId, SSIT_ITEM);
- ppro->setSettingWord(hCurrentContact, DBSETTING_SERVLIST_DENY, 0);
+ ppro->setWord(hCurrentContact, DBSETTING_SERVLIST_DENY, 0);
}
break;
}
@@ -572,7 +572,7 @@ static INT_PTR CALLBACK DlgProcUploadList(HWND hwndDlg,UINT message,WPARAM wPara
if (hItem)
{
isChecked = SendMessage(hwndList, CLM_GETCHECKMARK, (WPARAM)hItem, 0) != 0;
- isOnServer = ppro->getSettingWord(hContact, DBSETTING_SERVLIST_ID, 0) != 0;
+ isOnServer = ppro->getWord(hContact, DBSETTING_SERVLIST_ID, 0) != 0;
bUidOk = !ppro->getContactUid(hContact, &dwUin, &szUid);
@@ -643,8 +643,8 @@ static INT_PTR CALLBACK DlgProcUploadList(HWND hwndDlg,UINT message,WPARAM wPara
else
AppendToUploadLog(hwndDlg, ICQTranslateUtfStatic(LPGEN("Deleting %s..."), str, MAX_PATH), strUID(dwUin, szUid));
- wNewGroupId = ppro->getSettingWord(hContact, DBSETTING_SERVLIST_GROUP, 0);
- wNewContactId = ppro->getSettingWord(hContact, DBSETTING_SERVLIST_ID, 0);
+ wNewGroupId = ppro->getWord(hContact, DBSETTING_SERVLIST_GROUP, 0);
+ wNewContactId = ppro->getWord(hContact, DBSETTING_SERVLIST_ID, 0);
currentAction = ACTION_REMOVEBUDDY;
currentSequence = sendUploadBuddy(ppro, hContact, ICQ_LISTS_REMOVEFROMLIST, dwUin, szUid,
wNewContactId, wNewGroupId, SSI_ITEM_BUDDY);
@@ -655,7 +655,7 @@ static INT_PTR CALLBACK DlgProcUploadList(HWND hwndDlg,UINT message,WPARAM wPara
}
else if (bUidOk && isChecked)
{ // the contact is and should be on server, check if it is in correct group, move otherwise
- WORD wCurrentGroupId = ppro->getSettingWord(hContact, DBSETTING_SERVLIST_GROUP, 0);
+ WORD wCurrentGroupId = ppro->getWord(hContact, DBSETTING_SERVLIST_GROUP, 0);
pszGroup = ppro->getContactCListGroup(hContact);
if (!strlennull(pszGroup))
@@ -679,8 +679,8 @@ static INT_PTR CALLBACK DlgProcUploadList(HWND hwndDlg,UINT message,WPARAM wPara
}
if (wNewGroupId && (wNewGroupId != wCurrentGroupId))
{ // we have a group the contact should be in, move it
- WORD wCurrentContactId = ppro->getSettingWord(hContact, DBSETTING_SERVLIST_ID, 0);
- BYTE bAuth = ppro->getSettingByte(hContact, "Auth", 0);
+ WORD wCurrentContactId = ppro->getWord(hContact, DBSETTING_SERVLIST_ID, 0);
+ BYTE bAuth = ppro->getByte(hContact, "Auth", 0);
pszNick = ppro->getSettingStringUtf(hContact, "CList", "MyHandle", NULL);
@@ -725,10 +725,10 @@ static INT_PTR CALLBACK DlgProcUploadList(HWND hwndDlg,UINT message,WPARAM wPara
while (hContact)
{
- WORD wApparentMode = ppro->getSettingWord(hContact, "ApparentMode", 0);
- WORD wDenyId = ppro->getSettingWord(hContact, DBSETTING_SERVLIST_DENY, 0);
- WORD wPermitId = ppro->getSettingWord(hContact, DBSETTING_SERVLIST_PERMIT, 0);
- WORD wIgnoreId = ppro->getSettingWord(hContact, DBSETTING_SERVLIST_IGNORE, 0);
+ WORD wApparentMode = ppro->getWord(hContact, "ApparentMode", 0);
+ WORD wDenyId = ppro->getWord(hContact, DBSETTING_SERVLIST_DENY, 0);
+ WORD wPermitId = ppro->getWord(hContact, DBSETTING_SERVLIST_PERMIT, 0);
+ WORD wIgnoreId = ppro->getWord(hContact, DBSETTING_SERVLIST_IGNORE, 0);
hCurrentContact = hContact;
ppro->getContactUid(hContact, &dwUin, &szUid);
diff --git a/protocols/IcqOscarJ/src/icq_xstatus.cpp b/protocols/IcqOscarJ/src/icq_xstatus.cpp
index 59da80a08d..9f6222bf8e 100644
--- a/protocols/IcqOscarJ/src/icq_xstatus.cpp
+++ b/protocols/IcqOscarJ/src/icq_xstatus.cpp
@@ -47,7 +47,7 @@ BYTE CIcqProto::getContactXStatus(HANDLE hContact)
if (!m_bXStatusEnabled && !m_bMoodsEnabled)
return 0;
- BYTE bXStatus = getSettingByte(hContact, DBSETTING_XSTATUS_ID, 0);
+ BYTE bXStatus = getByte(hContact, DBSETTING_XSTATUS_ID, 0);
return (bXStatus < 1 || bXStatus > XSTATUS_COUNT) ? 0 : bXStatus;
}
@@ -426,9 +426,9 @@ void CIcqProto::handleXStatusCaps(DWORD dwUIN, char *szUID, HANDLE hContact, BYT
// only write default name when it is really needed, i.e. on Custom Status change
if (nOldXStatusID != bXStatusId) {
- setSettingByte(hContact, DBSETTING_XSTATUS_ID, bXStatusId);
- setSettingStringUtf(hContact, DBSETTING_XSTATUS_NAME, ICQTranslateUtfStatic(nameXStatus[i], str, MAX_PATH));
- deleteSetting(hContact, DBSETTING_XSTATUS_MSG);
+ 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);
NetLog_Server("%s changed mood to %s.", strUID(dwUIN, szUID), ICQTranslateUtfStatic(nameXStatus[i], str, MAX_PATH));
bChanged = TRUE;
@@ -459,15 +459,15 @@ void CIcqProto::handleXStatusCaps(DWORD dwUIN, char *szUID, HANDLE hContact, BYT
// only write default name when it is really needed, i.e. on Custom Status change
if (nMoodID == 0 && nOldXStatusID != bXStatusId) {
- setSettingByte(hContact, DBSETTING_XSTATUS_ID, bXStatusId);
- setSettingStringUtf(hContact, DBSETTING_XSTATUS_NAME, ICQTranslateUtfStatic(nameXStatus[i], str, MAX_PATH));
- deleteSetting(hContact, DBSETTING_XSTATUS_MSG);
+ 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);
NetLog_Server("%s changed custom status to %s.", strUID(dwUIN, szUID), ICQTranslateUtfStatic(nameXStatus[i], str, MAX_PATH));
bChanged = TRUE;
}
- if (getSettingByte(NULL, "XStatusAuto", DEFAULT_XSTATUS_AUTO))
+ if (getByte("XStatusAuto", DEFAULT_XSTATUS_AUTO))
requestXStatusDetails(hContact, TRUE);
nCustomStatusID = bXStatusId;
@@ -484,11 +484,11 @@ void CIcqProto::handleXStatusCaps(DWORD dwUIN, char *szUID, HANDLE hContact, BYT
NetLog_Server("Warning: Diverse custom statuses detected, using mood status.");
if ((nCustomStatusID == 0 && (caps || !m_bXStatusEnabled)) && (nMoodID == 0 && (moods || !m_bMoodsEnabled))) {
- if (getSettingByte(hContact, DBSETTING_XSTATUS_ID, -1) != -1)
+ if (getByte(hContact, DBSETTING_XSTATUS_ID, -1) != -1)
bChanged = TRUE;
- deleteSetting(hContact, DBSETTING_XSTATUS_ID);
- deleteSetting(hContact, DBSETTING_XSTATUS_NAME);
- deleteSetting(hContact, DBSETTING_XSTATUS_MSG);
+ db_unset(hContact, m_szModuleName, DBSETTING_XSTATUS_ID);
+ db_unset(hContact, m_szModuleName, DBSETTING_XSTATUS_NAME);
+ db_unset(hContact, m_szModuleName, DBSETTING_XSTATUS_MSG);
}
if (m_bXStatusEnabled != 10 && m_bMoodsEnabled != 10)
@@ -664,7 +664,7 @@ static INT_PTR CALLBACK SetXStatusDlgProc(HWND hwndDlg,UINT message,WPARAM wPara
SendMessage(GetDlgItem(hwndDlg, IDC_XTITLE), EM_SETREADONLY, 1, 0);
SendMessage(GetDlgItem(hwndDlg, IDC_XMSG), EM_SETREADONLY, 1, 0);
- if (dat->ppro->CheckContactCapabilities(dat->hContact, CAPF_XSTATUS) && !dat->ppro->getSettingByte(NULL, "XStatusAuto", DEFAULT_XSTATUS_AUTO)) {
+ if (dat->ppro->CheckContactCapabilities(dat->hContact, CAPF_XSTATUS) && !dat->ppro->getByte("XStatusAuto", DEFAULT_XSTATUS_AUTO)) {
SetDlgItemTextUtf(hwndDlg,IDOK,ICQTranslateUtfStatic(LPGEN("Cancel"), str, MAX_PATH));
dat->hEvent = HookEventMessage(ME_PROTO_ACK, hwndDlg, HM_PROTOACK);
ShowDlgItem(hwndDlg, IDC_RETRXSTATUS, SW_SHOW);
@@ -739,18 +739,18 @@ static INT_PTR CALLBACK SetXStatusDlgProc(HWND hwndDlg,UINT message,WPARAM wPara
if (!dat->bAction) { // set our xStatus
char szSetting[64];
- dat->ppro->setSettingByte(NULL, DBSETTING_XSTATUS_ID, dat->bXStatus);
+ dat->ppro->setByte(DBSETTING_XSTATUS_ID, dat->bXStatus);
char *szValue = GetDlgItemTextUtf(hwndDlg,IDC_XMSG);
null_snprintf(szSetting, 64, "XStatus%dMsg", dat->bXStatus);
- dat->ppro->setSettingStringUtf(NULL, szSetting, szValue);
- dat->ppro->setSettingStringUtf(NULL, DBSETTING_XSTATUS_MSG, szValue);
+ db_set_utf(NULL, dat->ppro->m_szModuleName, szSetting, szValue);
+ db_set_utf(NULL, dat->ppro->m_szModuleName, DBSETTING_XSTATUS_MSG, szValue);
SAFE_FREE(&szValue);
if (dat->ppro->m_bXStatusEnabled) {
szValue = GetDlgItemTextUtf(hwndDlg,IDC_XTITLE);
null_snprintf(szSetting, 64, "XStatus%dName", dat->bXStatus);
- dat->ppro->setSettingStringUtf(NULL, szSetting, szValue);
- dat->ppro->setSettingStringUtf(NULL, DBSETTING_XSTATUS_NAME, szValue);
+ db_set_utf(NULL, dat->ppro->m_szModuleName, szSetting, szValue);
+ db_set_utf(NULL, dat->ppro->m_szModuleName, DBSETTING_XSTATUS_NAME, szValue);
SAFE_FREE(&szValue);
if (dat->bXStatus) {
@@ -775,7 +775,7 @@ static INT_PTR CALLBACK SetXStatusDlgProc(HWND hwndDlg,UINT message,WPARAM wPara
void CIcqProto::setXStatusEx(BYTE bXStatus, BYTE bQuiet)
{
- BYTE bOldXStatus = getSettingByte(NULL, DBSETTING_XSTATUS_ID, 0);
+ BYTE bOldXStatus = getByte(DBSETTING_XSTATUS_ID, 0);
if (!m_bHideXStatusUI) {
CLISTMENUITEM mi = { sizeof(mi) };
@@ -801,7 +801,7 @@ void CIcqProto::setXStatusEx(BYTE bXStatus, BYTE bQuiet)
szMsg = getSettingStringUtf(NULL, szSetting, "");
null_snprintf(szSetting, 64, "XStatus%dStat", bXStatus);
- if (!bQuiet && !getSettingByte(NULL, szSetting, 0)) {
+ if (!bQuiet && !getByte(szSetting, 0)) {
InitXStatusData init;
init.ppro = this;
init.bAction = 0; // set
@@ -811,10 +811,10 @@ void CIcqProto::setXStatusEx(BYTE bXStatus, BYTE bQuiet)
CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_SETXSTATUS), NULL, SetXStatusDlgProc, (LPARAM)&init);
}
else {
- setSettingByte(NULL, DBSETTING_XSTATUS_ID, bXStatus);
+ setByte(DBSETTING_XSTATUS_ID, bXStatus);
if (m_bXStatusEnabled)
- setSettingStringUtf(NULL, DBSETTING_XSTATUS_NAME, szName);
- setSettingStringUtf(NULL, DBSETTING_XSTATUS_MSG, szMsg);
+ db_set_utf(NULL, m_szModuleName, DBSETTING_XSTATUS_NAME, szName);
+ db_set_utf(NULL, m_szModuleName, DBSETTING_XSTATUS_MSG, szMsg);
updateServerCustomStatus(TRUE);
}
@@ -822,9 +822,9 @@ void CIcqProto::setXStatusEx(BYTE bXStatus, BYTE bQuiet)
SAFE_FREE(&szMsg);
}
else {
- setSettingByte(NULL, DBSETTING_XSTATUS_ID, bXStatus);
- deleteSetting(NULL, DBSETTING_XSTATUS_NAME);
- deleteSetting(NULL, DBSETTING_XSTATUS_MSG);
+ setByte(DBSETTING_XSTATUS_ID, bXStatus);
+ db_unset(NULL, m_szModuleName, DBSETTING_XSTATUS_NAME);
+ db_unset(NULL, m_szModuleName, DBSETTING_XSTATUS_MSG);
updateServerCustomStatus(TRUE);
}
@@ -942,15 +942,15 @@ INT_PTR CIcqProto::SetXStatusEx(WPARAM wParam, LPARAM lParam)
if (m_bXStatusEnabled && (pData->flags & CSSF_MASK_NAME)) { // set custom status name
if (pData->flags & CSSF_UNICODE)
- setSettingStringW(NULL, DBSETTING_XSTATUS_NAME, pData->pwszName);
+ setTString(DBSETTING_XSTATUS_NAME, pData->pwszName);
else
- setSettingString(NULL, DBSETTING_XSTATUS_NAME, pData->pszName);
+ setString(DBSETTING_XSTATUS_NAME, pData->pszName);
}
if (pData->flags & CSSF_MASK_MESSAGE) { // set custom status message
if (pData->flags & CSSF_UNICODE)
- setSettingStringW(NULL, DBSETTING_XSTATUS_MSG, pData->pwszMessage);
+ setTString(DBSETTING_XSTATUS_MSG, pData->pwszMessage);
else
- setSettingString(NULL, DBSETTING_XSTATUS_MSG, pData->pszMessage);
+ setString(DBSETTING_XSTATUS_MSG, pData->pszMessage);
// update status note if used for custom status message
updateServerCustomStatus(FALSE);
@@ -1007,7 +1007,7 @@ INT_PTR CIcqProto::GetXStatusEx(WPARAM wParam, LPARAM lParam)
}
else {
DBVARIANT dbv;
- if ( !getSettingString(hContact, DBSETTING_XSTATUS_NAME, &dbv) && dbv.pszVal) {
+ if ( !getString(hContact, DBSETTING_XSTATUS_NAME, &dbv) && dbv.pszVal) {
strcpy(pData->pszName, dbv.pszVal);
db_free(&dbv);
}
@@ -1028,7 +1028,7 @@ INT_PTR CIcqProto::GetXStatusEx(WPARAM wParam, LPARAM lParam)
else {
DBVARIANT dbv = {0};
- if (!getSettingString(hContact, CheckContactCapabilities(hContact, CAPF_STATUS_MOOD) ? DBSETTING_STATUS_NOTE : DBSETTING_XSTATUS_MSG, &dbv) && dbv.pszVal)
+ if (!getString(hContact, CheckContactCapabilities(hContact, CAPF_STATUS_MOOD) ? DBSETTING_STATUS_NOTE : DBSETTING_XSTATUS_MSG, &dbv) && dbv.pszVal)
strcpy(pData->pszMessage, dbv.pszVal);
else
strcpy(pData->pszMessage, "");
@@ -1053,7 +1053,7 @@ INT_PTR CIcqProto::GetXStatusEx(WPARAM wParam, LPARAM lParam)
DBVARIANT dbv = {DBVT_DELETED};
if (pData->wParam) {
- if (m_bXStatusEnabled && !getSettingString(hContact, DBSETTING_XSTATUS_NAME, &dbv))
+ if (m_bXStatusEnabled && !getString(hContact, DBSETTING_XSTATUS_NAME, &dbv))
*pData->wParam = strlennull(dbv.pszVal);
else
*pData->wParam = 0;
@@ -1061,7 +1061,7 @@ INT_PTR CIcqProto::GetXStatusEx(WPARAM wParam, LPARAM lParam)
}
if (pData->lParam) {
- if (!getSettingString(hContact, CheckContactCapabilities(hContact, CAPF_STATUS_MOOD) ? DBSETTING_STATUS_NOTE : DBSETTING_XSTATUS_MSG, &dbv))
+ if (!getString(hContact, CheckContactCapabilities(hContact, CAPF_STATUS_MOOD) ? DBSETTING_STATUS_NOTE : DBSETTING_XSTATUS_MSG, &dbv))
*pData->lParam = strlennull(dbv.pszVal);
else
*pData->lParam = 0;
@@ -1094,7 +1094,7 @@ INT_PTR CIcqProto::RequestXStatusDetails(WPARAM wParam, LPARAM lParam)
return 0;
// user has xstatus, no auto-retrieve details, valid contact, request details
- if (hContact && !getSettingByte(NULL, "XStatusAuto", DEFAULT_XSTATUS_AUTO) && getContactXStatus(hContact) && CheckContactCapabilities(hContact, CAPF_XSTATUS))
+ if (hContact && !getByte("XStatusAuto", DEFAULT_XSTATUS_AUTO) && getContactXStatus(hContact) && CheckContactCapabilities(hContact, CAPF_XSTATUS))
return requestXStatusDetails(hContact, TRUE);
return 0;
diff --git a/protocols/IcqOscarJ/src/icq_xtraz.cpp b/protocols/IcqOscarJ/src/icq_xtraz.cpp
index c616dffd0e..6a746c2e57 100644
--- a/protocols/IcqOscarJ/src/icq_xtraz.cpp
+++ b/protocols/IcqOscarJ/src/icq_xtraz.cpp
@@ -245,7 +245,7 @@ NextVal:
if (strcmpnull(szOldXName, szXName))
bChanged = TRUE;
SAFE_FREE(&szOldXName);
- setSettingStringUtf(hContact, DBSETTING_XSTATUS_NAME, szXName);
+ db_set_utf(hContact, m_szModuleName, DBSETTING_XSTATUS_NAME, szXName);
SAFE_FREE(&szXName);
*szEnd = ' ';
}
@@ -262,7 +262,7 @@ NextVal:
if (strcmpnull(szOldXMsg, szXMsg))
bChanged = TRUE;
SAFE_FREE(&szOldXMsg);
- setSettingStringUtf(hContact, DBSETTING_XSTATUS_MSG, szXMsg);
+ db_set_utf(hContact, m_szModuleName, DBSETTING_XSTATUS_MSG, szXMsg);
SAFE_FREE(&szXMsg);
}
ProtoBroadcastAck(hContact, ICQACKTYPE_XSTATUS_RESPONSE, ACKRESULT_SUCCESS, (HANDLE)wCookie, 0);
diff --git a/protocols/IcqOscarJ/src/icqosc_svcs.cpp b/protocols/IcqOscarJ/src/icqosc_svcs.cpp
index 100312d45b..1bb0b08f11 100644
--- a/protocols/IcqOscarJ/src/icqosc_svcs.cpp
+++ b/protocols/IcqOscarJ/src/icqosc_svcs.cpp
@@ -38,7 +38,7 @@ INT_PTR CIcqProto::AddServerContact(WPARAM wParam, LPARAM lParam)
if (!m_bSsiEnabled) return 0;
// Does this contact have a UID?
- if (!getContactUid((HANDLE)wParam, &dwUin, &szUid) && !getSettingWord((HANDLE)wParam, DBSETTING_SERVLIST_ID, 0) && !getSettingWord((HANDLE)wParam, DBSETTING_SERVLIST_IGNORE, 0))
+ if (!getContactUid((HANDLE)wParam, &dwUin, &szUid) && !getWord((HANDLE)wParam, DBSETTING_SERVLIST_ID, 0) && !getWord((HANDLE)wParam, DBSETTING_SERVLIST_IGNORE, 0))
{ /// TODO: remove possible 0x6A TLV in contact server-list data!!!
// Read group from DB
char *pszGroup = getContactCListGroup((HANDLE)wParam);
@@ -194,7 +194,7 @@ INT_PTR CIcqProto::ChangeInfoEx(WPARAM wParam, LPARAM lParam)
nItems += ppackTLVWordStringItemFromDB(&pBlock, &cbBlock, "CompanyFax", 0x6E, 0x64, 0x05);
ppackTLVBlockItems(&buf, &buflen, 0xC8, &nItems, &pBlock, (WORD*)&cbBlock, FALSE);
- ppackTLVByte(&buf, &buflen, 0x1EA, getSettingByte(NULL, "AllowSpam", 0));
+ ppackTLVByte(&buf, &buflen, 0x1EA, getByte("AllowSpam", 0));
}
if (wParam & CIXT_BASIC)
@@ -207,16 +207,16 @@ INT_PTR CIcqProto::ChangeInfoEx(WPARAM wParam, LPARAM lParam)
if (wParam & CIXT_MORE)
{
- b = getSettingByte(NULL, "Gender", 0);
+ b = getByte("Gender", 0);
ppackTLVByte(&buf, &buflen, 0x82, (BYTE)(b ? (b == 'M' ? 2 : 1) : 0));
ppackTLVDateFromDB(&buf, &buflen, "BirthYear", "BirthMonth", "BirthDay", 0x1A4);
- ppackTLVWord(&buf, &buflen, 0xAA, getSettingByte(NULL, "Language1", 0));
- ppackTLVWord(&buf, &buflen, 0xB4, getSettingByte(NULL, "Language2", 0));
- ppackTLVWord(&buf, &buflen, 0xBE, getSettingByte(NULL, "Language3", 0));
+ ppackTLVWord(&buf, &buflen, 0xAA, getByte("Language1", 0));
+ ppackTLVWord(&buf, &buflen, 0xB4, getByte("Language2", 0));
+ ppackTLVWord(&buf, &buflen, 0xBE, getByte("Language3", 0));
- ppackTLVWord(&buf, &buflen, 0x12C, getSettingByte(NULL, "MaritalStatus", 0));
+ ppackTLVWord(&buf, &buflen, 0x12C, getByte("MaritalStatus", 0));
}
if (wParam & CIXT_WORK)
@@ -230,16 +230,16 @@ INT_PTR CIcqProto::ChangeInfoEx(WPARAM wParam, LPARAM lParam)
ppackTLVStringUtfFromDB(&pBlock, &cbBlock, "Company", 0x6E);
ppackTLVStringUtfFromDB(&pBlock, &cbBlock, "CompanyDepartment", 0x7D);
ppackTLVStringFromDB(&pBlock, &cbBlock, "CompanyHomepage", 0x78);
- ppackTLVWord(&pBlock, &cbBlock, 0x82, getSettingWord(NULL, "CompanyIndustry", 0));
+ ppackTLVWord(&pBlock, &cbBlock, 0x82, getWord("CompanyIndustry", 0));
ppackTLVStringUtfFromDB(&pBlock, &cbBlock, "CompanyStreet", 0xAA);
ppackTLVStringUtfFromDB(&pBlock, &cbBlock, "CompanyCity", 0xB4);
ppackTLVStringUtfFromDB(&pBlock, &cbBlock, "CompanyState", 0xBE);
ppackTLVStringUtfFromDB(&pBlock, &cbBlock, "CompanyZIP", 0xC8);
- ppackTLVDWord(&pBlock, &cbBlock, 0xD2, getSettingWord(NULL, "CompanyCountry", 0));
+ ppackTLVDWord(&pBlock, &cbBlock, 0xD2, getWord("CompanyCountry", 0));
/// TODO: pack unknown data (need to preserve them in Block Items)
ppackTLVBlockItems(&buf, &buflen, 0x118, &nItems, &pBlock, (WORD*)&cbBlock, TRUE);
- // ppackTLVWord(&buf, &buflen, getSettingWord(NULL, "CompanyOccupation", 0), TLV_OCUPATION, 1); // Lost In Conversion
+ // ppackTLVWord(&buf, &buflen, getWord("CompanyOccupation", 0), TLV_OCUPATION, 1); // Lost In Conversion
}
if (wParam & CIXT_EDUCATION)
@@ -249,10 +249,10 @@ INT_PTR CIcqProto::ChangeInfoEx(WPARAM wParam, LPARAM lParam)
int nItems = 1;
// Studies
- ppackTLVWord(&pBlock, &cbBlock, 0x64, getSettingWord(NULL, "StudyLevel", 0));
+ ppackTLVWord(&pBlock, &cbBlock, 0x64, getWord("StudyLevel", 0));
ppackTLVStringUtfFromDB(&pBlock, &cbBlock, "StudyInstitute", 0x6E);
ppackTLVStringUtfFromDB(&pBlock, &cbBlock, "StudyDegree", 0x78);
- ppackTLVWord(&pBlock, &cbBlock, 0x8C, getSettingWord(NULL, "StudyYear", 0));
+ ppackTLVWord(&pBlock, &cbBlock, 0x8C, getWord("StudyYear", 0));
ppackTLVBlockItems(&buf, &buflen, 0x10E, &nItems, &pBlock, (WORD*)&cbBlock, TRUE);
}
@@ -267,7 +267,7 @@ INT_PTR CIcqProto::ChangeInfoEx(WPARAM wParam, LPARAM lParam)
ppackTLVStringUtfFromDB(&pBlock, &cbBlock, "City", 0x6E);
ppackTLVStringUtfFromDB(&pBlock, &cbBlock, "State", 0x78);
ppackTLVStringUtfFromDB(&pBlock, &cbBlock, "ZIP", 0x82);
- ppackTLVDWord(&pBlock, &cbBlock, 0x8C, getSettingWord(NULL, "Country", 0));
+ ppackTLVDWord(&pBlock, &cbBlock, 0x8C, getWord("Country", 0));
ppackTLVBlockItems(&buf, &buflen, 0x96, &nItems, &pBlock, (WORD*)&cbBlock, TRUE);
nItems = 1;
@@ -275,13 +275,13 @@ INT_PTR CIcqProto::ChangeInfoEx(WPARAM wParam, LPARAM lParam)
ppackTLVStringUtfFromDB(&pBlock, &cbBlock, "OriginStreet", 0x64);
ppackTLVStringUtfFromDB(&pBlock, &cbBlock, "OriginCity", 0x6E);
ppackTLVStringUtfFromDB(&pBlock, &cbBlock, "OriginState", 0x78);
- ppackTLVDWord(&pBlock, &cbBlock, 0x8C, getSettingWord(NULL, "OriginCountry", 0));
+ ppackTLVDWord(&pBlock, &cbBlock, 0x8C, getWord("OriginCountry", 0));
ppackTLVBlockItems(&buf, &buflen, 0xA0, &nItems, &pBlock, (WORD*)&cbBlock, TRUE);
ppackTLVStringFromDB(&buf, &buflen, "Homepage", 0xFA);
// Timezone
- WORD wTimezone = getSettingByte(NULL, "Timezone", 0);
+ WORD wTimezone = getByte("Timezone", 0);
if ((wTimezone & 0x0080) == 0x80) wTimezone |= 0xFF00; // extend signed number
ppackTLVWord(&buf, &buflen, 0x17C, wTimezone);
}
@@ -293,10 +293,10 @@ INT_PTR CIcqProto::ChangeInfoEx(WPARAM wParam, LPARAM lParam)
int nItems = 0;
// Interests
- nItems += ppackTLVWordStringUtfItemFromDB(&pBlock, &cbBlock, "Interest0Text", 0x6E, 0x64, getSettingWord(NULL, "Interest0Cat", 0));
- nItems += ppackTLVWordStringUtfItemFromDB(&pBlock, &cbBlock, "Interest1Text", 0x6E, 0x64, getSettingWord(NULL, "Interest1Cat", 0));
- nItems += ppackTLVWordStringUtfItemFromDB(&pBlock, &cbBlock, "Interest2Text", 0x6E, 0x64, getSettingWord(NULL, "Interest2Cat", 0));
- nItems += ppackTLVWordStringUtfItemFromDB(&pBlock, &cbBlock, "Interest3Text", 0x6E, 0x64, getSettingWord(NULL, "Interest3Cat", 0));
+ nItems += ppackTLVWordStringUtfItemFromDB(&pBlock, &cbBlock, "Interest0Text", 0x6E, 0x64, getWord("Interest0Cat", 0));
+ nItems += ppackTLVWordStringUtfItemFromDB(&pBlock, &cbBlock, "Interest1Text", 0x6E, 0x64, getWord("Interest1Cat", 0));
+ nItems += ppackTLVWordStringUtfItemFromDB(&pBlock, &cbBlock, "Interest2Text", 0x6E, 0x64, getWord("Interest2Cat", 0));
+ nItems += ppackTLVWordStringUtfItemFromDB(&pBlock, &cbBlock, "Interest3Text", 0x6E, 0x64, getWord("Interest3Cat", 0));
ppackTLVBlockItems(&buf, &buflen, 0x122, &nItems, &pBlock, (WORD*)&cbBlock, FALSE);
@@ -401,7 +401,7 @@ INT_PTR CIcqProto::GetAvatarInfo(WPARAM wParam, LPARAM lParam)
return GAIR_NOAVATAR; // we do not support avatars for invalid contacts
}
- int dwPaFormat = getSettingByte(pai->hContact, "AvatarType", PA_FORMAT_UNKNOWN);
+ int dwPaFormat = getByte(pai->hContact, "AvatarType", PA_FORMAT_UNKNOWN);
if (dwPaFormat != PA_FORMAT_UNKNOWN)
{ // we know the format, test file
@@ -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
- deleteSetting((HANDLE)wParam, "Grant");
+ db_unset((HANDLE)wParam, m_szModuleName, "Grant");
}
return 0;
@@ -489,7 +489,7 @@ int CIcqProto::OnIdleChanged(WPARAM wParam, LPARAM lParam)
if (bPrivacy) return 0;
- setSettingDword(NULL, "IdleTS", bIdle ? time(0) : 0);
+ setDword("IdleTS", bIdle ? time(0) : 0);
if (m_bTempVisListEnabled) // remove temporary visible users
sendEntireListServ(ICQ_BOS_FAMILY, ICQ_CLI_REMOVETEMPVISIBLE, BUL_TEMPVISIBLE);
@@ -607,7 +607,7 @@ INT_PTR CIcqProto::SetMyAvatar(WPARAM wParam, LPARAM lParam)
}
else
{ // delete user avatar
- deleteSetting(NULL, "AvatarFile");
+ db_unset(NULL, m_szModuleName, "AvatarFile");
setSettingBlob(NULL, "AvatarHash", hashEmptyAvatar, 9);
updateServAvatarHash(hashEmptyAvatar, 9); // set blank avatar
iRet = 0;
@@ -622,9 +622,9 @@ INT_PTR CIcqProto::SetNickName(WPARAM wParam, LPARAM lParam)
return 0; // failure
if (wParam & SMNN_UNICODE)
- setSettingStringW(NULL, "Nick", (WCHAR*)lParam);
+ setTString("Nick", (WCHAR*)lParam);
else
- setSettingString(NULL, "Nick", (char*)lParam);
+ setString("Nick", (char*)lParam);
return ChangeInfoEx(CIXT_BASIC, 0);
}
@@ -701,7 +701,7 @@ void CIcqProto::ICQAddRecvEvent(HANDLE hContact, WORD wType, PROTORECVEVENT* pre
//setContactHidden(hContact, 0);
// if the contact was hidden, add to client-list if not in server-list authed
- if (!getSettingWord(hContact, DBSETTING_SERVLIST_ID, 0) || getSettingByte(hContact, "Auth", 0))
+ if (!getWord(hContact, DBSETTING_SERVLIST_ID, 0) || getByte(hContact, "Auth", 0))
{
getContactUid(hContact, &dwUin, &szUid);
icq_sendNewContact(dwUin, szUid); /// FIXME
diff --git a/protocols/IcqOscarJ/src/init.cpp b/protocols/IcqOscarJ/src/init.cpp
index fd428c02ed..a23b01554e 100644
--- a/protocols/IcqOscarJ/src/init.cpp
+++ b/protocols/IcqOscarJ/src/init.cpp
@@ -140,14 +140,14 @@ void CIcqProto::UpdateGlobalSettings()
char szServer[MAX_PATH] = "";
getSettingStringStatic(NULL, "OscarServer", szServer, MAX_PATH);
- m_bSecureConnection = getSettingByte(NULL, "SecureConnection", DEFAULT_SECURE_CONNECTION);
+ m_bSecureConnection = getByte("SecureConnection", DEFAULT_SECURE_CONNECTION);
if (szServer[0]) {
if (strstr(szServer, "aol.com"))
- setSettingString(NULL, "OscarServer", m_bSecureConnection ? DEFAULT_SERVER_HOST_SSL : DEFAULT_SERVER_HOST);
+ setString("OscarServer", m_bSecureConnection ? DEFAULT_SERVER_HOST_SSL : DEFAULT_SERVER_HOST);
if (m_bSecureConnection && !_strnicmp(szServer, "login.", 6)) {
- setSettingString(NULL, "OscarServer", DEFAULT_SERVER_HOST_SSL);
- setSettingWord(NULL, "OscarPort", DEFAULT_SERVER_PORT_SSL);
+ setString("OscarServer", DEFAULT_SERVER_HOST_SSL);
+ setWord("OscarPort", DEFAULT_SERVER_PORT_SSL);
}
}
@@ -162,16 +162,16 @@ void CIcqProto::UpdateGlobalSettings()
else m_bGatewayMode = 0;
}
- m_bSecureLogin = getSettingByte(NULL, "SecureLogin", DEFAULT_SECURE_LOGIN);
- m_bLegacyFix = getSettingByte(NULL, "LegacyFix", DEFAULT_LEGACY_FIX);
- m_bAimEnabled = getSettingByte(NULL, "AimEnabled", DEFAULT_AIM_ENABLED);
- m_bUtfEnabled = getSettingByte(NULL, "UtfEnabled", DEFAULT_UTF_ENABLED);
- m_wAnsiCodepage = getSettingWord(NULL, "AnsiCodePage", DEFAULT_ANSI_CODEPAGE);
- m_bDCMsgEnabled = getSettingByte(NULL, "DirectMessaging", DEFAULT_DCMSG_ENABLED);
- m_bTempVisListEnabled = getSettingByte(NULL, "TempVisListEnabled", DEFAULT_TEMPVIS_ENABLED);
- m_bSsiEnabled = getSettingByte(NULL, "UseServerCList", DEFAULT_SS_ENABLED);
+ m_bSecureLogin = getByte("SecureLogin", DEFAULT_SECURE_LOGIN);
+ m_bLegacyFix = getByte("LegacyFix", DEFAULT_LEGACY_FIX);
+ m_bAimEnabled = getByte("AimEnabled", DEFAULT_AIM_ENABLED);
+ m_bUtfEnabled = getByte("UtfEnabled", DEFAULT_UTF_ENABLED);
+ m_wAnsiCodepage = getWord("AnsiCodePage", DEFAULT_ANSI_CODEPAGE);
+ m_bDCMsgEnabled = getByte("DirectMessaging", DEFAULT_DCMSG_ENABLED);
+ m_bTempVisListEnabled = getByte("TempVisListEnabled", DEFAULT_TEMPVIS_ENABLED);
+ m_bSsiEnabled = getByte("UseServerCList", DEFAULT_SS_ENABLED);
m_bSsiSimpleGroups = FALSE; /// TODO: enable, after server-list revolution is over
- m_bAvatarsEnabled = getSettingByte(NULL, "AvatarsEnabled", DEFAULT_AVATARS_ENABLED);
- m_bXStatusEnabled = getSettingByte(NULL, "XStatusEnabled", DEFAULT_XSTATUS_ENABLED);
- m_bMoodsEnabled = getSettingByte(NULL, "MoodsEnabled", DEFAULT_MOODS_ENABLED);
+ m_bAvatarsEnabled = getByte("AvatarsEnabled", DEFAULT_AVATARS_ENABLED);
+ m_bXStatusEnabled = getByte("XStatusEnabled", DEFAULT_XSTATUS_ENABLED);
+ m_bMoodsEnabled = getByte("MoodsEnabled", DEFAULT_MOODS_ENABLED);
}
diff --git a/protocols/IcqOscarJ/src/log.cpp b/protocols/IcqOscarJ/src/log.cpp
index 881fe82cba..38857473a5 100644
--- a/protocols/IcqOscarJ/src/log.cpp
+++ b/protocols/IcqOscarJ/src/log.cpp
@@ -46,7 +46,7 @@ void __cdecl CIcqProto::icq_LogMessageThread(void* arg)
if (!err)
return;
- if (bPopupService && getSettingByte(NULL, "PopupsLogEnabled", DEFAULT_LOG_POPUPS_ENABLED))
+ if (bPopupService && getByte("PopupsLogEnabled", DEFAULT_LOG_POPUPS_ENABLED))
{
ShowPopupMsg(NULL, err->szTitle, err->szMsg, err->bLevel);
@@ -69,10 +69,10 @@ void CIcqProto::icq_LogMessage(int level, const char *szMsg)
{
NetLog_Server("%s", szMsg);
- int displayLevel = getSettingByte(NULL, "ShowLogLevel", LOG_WARNING);
+ int displayLevel = getByte("ShowLogLevel", LOG_WARNING);
if (level >= displayLevel)
{
- if (!bErrorBoxVisible || !getSettingByte(NULL, "IgnoreMultiErrorBox", 0))
+ if (!bErrorBoxVisible || !getByte("IgnoreMultiErrorBox", 0))
{
// error not shown or allowed multi - show messagebox
LogMessageInfo *lmi = (LogMessageInfo*)SAFE_MALLOC(sizeof(LogMessageInfo));
diff --git a/protocols/IcqOscarJ/src/oscar_filetransfer.cpp b/protocols/IcqOscarJ/src/oscar_filetransfer.cpp
index b0f42a826d..15b85bb475 100644
--- a/protocols/IcqOscarJ/src/oscar_filetransfer.cpp
+++ b/protocols/IcqOscarJ/src/oscar_filetransfer.cpp
@@ -981,7 +981,7 @@ HANDLE CIcqProto::oftInitTransfer(HANDLE hContact, DWORD dwUin, char* szUid, con
// Send packet
if (ft->listener)
{
- oft_sendFileRequest(dwUin, szUid, ft, pszFiles, getSettingDword(NULL, "RealIP", 0));
+ oft_sendFileRequest(dwUin, szUid, ft, pszFiles, getDword("RealIP", 0));
}
else
{ // try stage 1 proxy
@@ -1253,7 +1253,7 @@ int CIcqProto::CreateOscarProxyConnection(oscar_connection *oc)
ProtoBroadcastAck(oc->ft->hContact, ACKTYPE_FILE, ACKRESULT_CONNECTPROXY, oc->ft, 0);
nloc.szHost = OSCAR_PROXY_HOST;
- nloc.wPort = getSettingWord(NULL, "OscarPort", m_bSecureConnection ? DEFAULT_SERVER_PORT_SSL : DEFAULT_SERVER_PORT);
+ nloc.wPort = getWord("OscarPort", m_bSecureConnection ? DEFAULT_SERVER_PORT_SSL : DEFAULT_SERVER_PORT);
if (nloc.wPort == 0)
nloc.wPort = RandRange(1024, 65535);
if (m_bGatewayMode)
@@ -1316,8 +1316,8 @@ void __cdecl CIcqProto::oft_connectionThread( oscarthreadstartinfo *otsi )
}
// Load local IP information
- oc.dwLocalExternalIP = getSettingDword(NULL, "IP", 0);
- oc.dwLocalInternalIP = getSettingDword(NULL, "RealIP", 0);
+ oc.dwLocalExternalIP = getDword("IP", 0);
+ oc.dwLocalInternalIP = getDword("RealIP", 0);
if (!oc.incoming)
{ // create outgoing connection
@@ -1428,7 +1428,7 @@ void __cdecl CIcqProto::oft_connectionThread( oscarthreadstartinfo *otsi )
addr.S_un.S_addr = htonl(oc.ft->dwProxyIP);
nloc.szHost = inet_ntoa(addr);
- nloc.wPort = getSettingWord(NULL, "OscarPort", m_bSecureConnection ? DEFAULT_SERVER_PORT_SSL : DEFAULT_SERVER_PORT);
+ nloc.wPort = getWord("OscarPort", m_bSecureConnection ? DEFAULT_SERVER_PORT_SSL : DEFAULT_SERVER_PORT);
if (nloc.wPort == 0)
nloc.wPort = RandRange(1024, 65535);
if (m_bGatewayMode)
diff --git a/protocols/IcqOscarJ/src/stdpackets.cpp b/protocols/IcqOscarJ/src/stdpackets.cpp
index c90244bdc3..9aaa159ec9 100644
--- a/protocols/IcqOscarJ/src/stdpackets.cpp
+++ b/protocols/IcqOscarJ/src/stdpackets.cpp
@@ -121,7 +121,7 @@ static void packServTLV2711Header(icq_packet *packet, WORD wCookie, WORD wVersio
static void packServDCInfo(icq_packet *p, CIcqProto* ppro, BOOL bEmpty)
{
- packTLVDWord(p, 0x03, bEmpty ? 0 : ppro->getSettingDword(NULL, "RealIP", 0)); // TLV: 0x03 DWORD IP
+ packTLVDWord(p, 0x03, bEmpty ? 0 : ppro->getDword("RealIP", 0)); // TLV: 0x03 DWORD IP
packTLVWord(p, 0x05, (WORD)(bEmpty ? 0 : ppro->wListenPort)); // TLV: 0x05 Listen port
}
@@ -265,7 +265,7 @@ void CIcqProto::icq_setstatus(WORD wStatus, const char *szStatusNote)
{ // status note was changed, update now
DBVARIANT dbv = {DBVT_DELETED};
- if (m_bMoodsEnabled && !getSettingString(NULL, DBSETTING_STATUS_MOOD, &dbv))
+ if (m_bMoodsEnabled && !getString(DBSETTING_STATUS_MOOD, &dbv))
szMoodData = null_strdup(dbv.pszVal);
db_free(&dbv);
@@ -304,7 +304,7 @@ void CIcqProto::icq_setstatus(WORD wStatus, const char *szStatusNote)
packBuffer(&packet, (LPBYTE)szMoodData, wStatusMoodLen); // Mood
// Save current status note
- setSettingStringUtf(NULL, DBSETTING_STATUS_NOTE, szStatusNote);
+ db_set_utf(NULL, m_szModuleName, DBSETTING_STATUS_NOTE, szStatusNote);
}
// Release memory
SAFE_FREE(&szMoodData);
@@ -1617,7 +1617,7 @@ void CIcqProto::icq_sendChangeVisInvis(HANDLE hContact, DWORD dwUin, char* szUID
if (add)
{
// check if we should make the changes, this is 2nd level check
- if (getSettingWord(hContact, szSetting, 0) != 0)
+ if (getWord(hContact, szSetting, 0) != 0)
return;
// Add
@@ -1625,18 +1625,18 @@ void CIcqProto::icq_sendChangeVisInvis(HANDLE hContact, DWORD dwUin, char* szUID
icq_addServerPrivacyItem(hContact, dwUin, szUID, wContactId, wType);
- setSettingWord(hContact, szSetting, wContactId);
+ setWord(hContact, szSetting, wContactId);
}
else
{
// Remove
- wContactId = getSettingWord(hContact, szSetting, 0);
+ wContactId = getWord(hContact, szSetting, 0);
if (wContactId)
{
icq_removeServerPrivacyItem(hContact, dwUin, szUID, wContactId, wType);
- deleteSetting(hContact, szSetting);
+ db_unset(hContact, m_szModuleName, szSetting);
}
}
}
diff --git a/protocols/IcqOscarJ/src/utilities.cpp b/protocols/IcqOscarJ/src/utilities.cpp
index 99d9b690dc..b98dd5034d 100644
--- a/protocols/IcqOscarJ/src/utilities.cpp
+++ b/protocols/IcqOscarJ/src/utilities.cpp
@@ -503,14 +503,14 @@ HANDLE CIcqProto::HContactFromUIN(DWORD dwUin, int *Added)
return INVALID_HANDLE_VALUE;
}
- setSettingDword(hContact, UNIQUEIDSETTING, dwUin);
+ setDword(hContact, UNIQUEIDSETTING, dwUin);
if (!bIsSyncingCL)
{
db_set_b(hContact, "CList", "NotOnList", 1);
setContactHidden(hContact, 1);
- setSettingWord(hContact, "Status", ID_STATUS_OFFLINE);
+ setWord(hContact, "Status", ID_STATUS_OFFLINE);
icq_QueueUser(hContact);
@@ -555,7 +555,7 @@ HANDLE CIcqProto::HContactFromUID(DWORD dwUin, const char *szUid, int *Added)
{
if (strcmpnull(szContactUid, szUid))
{ // fix case in SN
- setSettingString(hContact, UNIQUEIDSETTING, szUid);
+ setString(hContact, UNIQUEIDSETTING, szUid);
}
return hContact;
}
@@ -569,14 +569,14 @@ HANDLE CIcqProto::HContactFromUID(DWORD dwUin, const char *szUid, int *Added)
hContact = (HANDLE)CallService(MS_DB_CONTACT_ADD, 0, 0);
CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)m_szModuleName);
- setSettingString(hContact, UNIQUEIDSETTING, szUid);
+ setString(hContact, UNIQUEIDSETTING, szUid);
if (!bIsSyncingCL)
{
db_set_b(hContact, "CList", "NotOnList", 1);
setContactHidden(hContact, 1);
- setSettingWord(hContact, "Status", ID_STATUS_OFFLINE);
+ setWord(hContact, "Status", ID_STATUS_OFFLINE);
if (icqOnline())
icq_sendNewContact(0, szUid);
@@ -959,25 +959,25 @@ char *ApplyEncoding(const char *string, const char *pszEncoding)
void CIcqProto::ResetSettingsOnListReload()
{
// Reset a bunch of session specific settings
- setSettingWord(NULL, DBSETTING_SERVLIST_PRIVACY, 0);
- setSettingWord(NULL, DBSETTING_SERVLIST_METAINFO, 0);
- setSettingWord(NULL, DBSETTING_SERVLIST_AVATAR, 0);
- setSettingWord(NULL, DBSETTING_SERVLIST_PHOTO, 0);
- setSettingWord(NULL, "SrvRecordCount", 0);
- deleteSetting(NULL, DBSETTING_SERVLIST_UNHANDLED);
+ setWord(DBSETTING_SERVLIST_PRIVACY, 0);
+ setWord(DBSETTING_SERVLIST_METAINFO, 0);
+ setWord(DBSETTING_SERVLIST_AVATAR, 0);
+ setWord(DBSETTING_SERVLIST_PHOTO, 0);
+ setWord("SrvRecordCount", 0);
+ db_unset(NULL, m_szModuleName, DBSETTING_SERVLIST_UNHANDLED);
HANDLE hContact = FindFirstContact();
while (hContact)
{
// All these values will be restored during the serv-list receive
- setSettingWord(hContact, DBSETTING_SERVLIST_ID, 0);
- setSettingWord(hContact, DBSETTING_SERVLIST_GROUP, 0);
- setSettingWord(hContact, DBSETTING_SERVLIST_PERMIT, 0);
- setSettingWord(hContact, DBSETTING_SERVLIST_DENY, 0);
- deleteSetting(hContact, DBSETTING_SERVLIST_IGNORE);
- setSettingByte(hContact, "Auth", 0);
- deleteSetting(hContact, DBSETTING_SERVLIST_DATA);
+ setWord(hContact, DBSETTING_SERVLIST_ID, 0);
+ 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);
+ setByte(hContact, "Auth", 0);
+ db_unset(hContact, m_szModuleName, DBSETTING_SERVLIST_DATA);
hContact = FindNextContact(hContact);
}
@@ -988,21 +988,21 @@ void CIcqProto::ResetSettingsOnListReload()
void CIcqProto::ResetSettingsOnConnect()
{
// Reset a bunch of session specific settings
- setSettingByte(NULL, "SrvVisibility", 0);
- setSettingDword(NULL, "IdleTS", 0);
+ setByte("SrvVisibility", 0);
+ setDword("IdleTS", 0);
HANDLE hContact = FindFirstContact();
while (hContact)
{
- setSettingDword(hContact, "LogonTS", 0);
- setSettingDword(hContact, "IdleTS", 0);
- setSettingDword(hContact, "TickTS", 0);
- setSettingByte(hContact, "TemporaryVisible", 0);
+ setDword(hContact, "LogonTS", 0);
+ setDword(hContact, "IdleTS", 0);
+ setDword(hContact, "TickTS", 0);
+ setByte(hContact, "TemporaryVisible", 0);
// All these values will be restored during the login
if (getContactStatus(hContact) != ID_STATUS_OFFLINE)
- setSettingWord(hContact, "Status", ID_STATUS_OFFLINE);
+ setWord(hContact, "Status", ID_STATUS_OFFLINE);
hContact = FindNextContact(hContact);
}
@@ -1010,25 +1010,25 @@ void CIcqProto::ResetSettingsOnConnect()
void CIcqProto::ResetSettingsOnLoad()
{
- setSettingDword(NULL, "IdleTS", 0);
- setSettingDword(NULL, "LogonTS", 0);
+ setDword("IdleTS", 0);
+ setDword("LogonTS", 0);
HANDLE hContact = FindFirstContact();
while (hContact)
{
- setSettingDword(hContact, "LogonTS", 0);
- setSettingDword(hContact, "IdleTS", 0);
- setSettingDword(hContact, "TickTS", 0);
+ setDword(hContact, "LogonTS", 0);
+ setDword(hContact, "IdleTS", 0);
+ setDword(hContact, "TickTS", 0);
if (getContactStatus(hContact) != ID_STATUS_OFFLINE)
{
- setSettingWord(hContact, "Status", ID_STATUS_OFFLINE);
+ setWord(hContact, "Status", ID_STATUS_OFFLINE);
- deleteSetting(hContact, DBSETTING_XSTATUS_ID);
- deleteSetting(hContact, DBSETTING_XSTATUS_NAME);
- deleteSetting(hContact, DBSETTING_XSTATUS_MSG);
+ db_unset(hContact, m_szModuleName, DBSETTING_XSTATUS_ID);
+ db_unset(hContact, m_szModuleName, DBSETTING_XSTATUS_NAME);
+ db_unset(hContact, m_szModuleName, DBSETTING_XSTATUS_MSG);
}
- setSettingByte(hContact, "DCStatus", 0);
+ setByte(hContact, "DCStatus", 0);
hContact = FindNextContact(hContact);
}
@@ -1221,7 +1221,7 @@ void __cdecl CIcqProto::SetStatusNoteThread(void *pDelay)
char *szCurrentStatusMood = NULL;
DBVARIANT dbv = {DBVT_DELETED};
- if (m_bMoodsEnabled && !getSettingString(NULL, DBSETTING_STATUS_MOOD, &dbv))
+ if (m_bMoodsEnabled && !getString(DBSETTING_STATUS_MOOD, &dbv))
szCurrentStatusMood = dbv.pszVal;
if (!setStatusNoteText && szCurrentStatusNote)
@@ -1231,9 +1231,9 @@ void __cdecl CIcqProto::SetStatusNoteThread(void *pDelay)
if (strcmpnull(szCurrentStatusNote, setStatusNoteText) || (m_bMoodsEnabled && strcmpnull(szCurrentStatusMood, setStatusMoodData)))
{
- setSettingStringUtf(NULL, DBSETTING_STATUS_NOTE, setStatusNoteText);
+ db_set_utf(NULL, m_szModuleName, DBSETTING_STATUS_NOTE, setStatusNoteText);
if (m_bMoodsEnabled)
- setSettingString(NULL, DBSETTING_STATUS_MOOD, setStatusMoodData);
+ setString(DBSETTING_STATUS_MOOD, setStatusMoodData);
WORD wStatusNoteLen = strlennull(setStatusNoteText);
WORD wStatusMoodLen = m_bMoodsEnabled ? strlennull(setStatusMoodData) : 0;
@@ -1328,7 +1328,7 @@ int CIcqProto::SetStatusMood(const char *szMoodData, DWORD dwDelay)
char *szCurrentStatusMood = NULL;
DBVARIANT dbv = {DBVT_DELETED};
- if (!getSettingString(NULL, DBSETTING_STATUS_MOOD, &dbv))
+ if (!getString(DBSETTING_STATUS_MOOD, &dbv))
szCurrentStatusMood = dbv.pszVal;
if (strcmpnull(szCurrentStatusMood, szMoodData))
@@ -1366,10 +1366,10 @@ void CIcqProto::writeDbInfoSettingTLVStringUtf(HANDLE hContact, const char *szSe
memcpy(str, pTLV->pData, pTLV->wLen);
str[pTLV->wLen] = '\0';
- setSettingStringUtf(hContact, szSetting, str);
+ db_set_utf(hContact, m_szModuleName, szSetting, str);
}
else
- deleteSetting(hContact, szSetting);
+ db_unset(hContact, m_szModuleName, szSetting);
}
@@ -1378,9 +1378,9 @@ void CIcqProto::writeDbInfoSettingTLVWord(HANDLE hContact, const char *szSetting
int num = chain->getNumber(wTlv, 1);
if (num > 0)
- setSettingWord(hContact, szSetting, num);
+ setWord(hContact, szSetting, num);
else
- deleteSetting(hContact, szSetting);
+ db_unset(hContact, m_szModuleName, szSetting);
}
@@ -1389,9 +1389,9 @@ void CIcqProto::writeDbInfoSettingTLVByte(HANDLE hContact, const char *szSetting
int num = chain->getNumber(wTlv, 1);
if (num > 0)
- setSettingByte(hContact, szSetting, num);
+ setByte(hContact, szSetting, num);
else
- deleteSetting(hContact, szSetting);
+ db_unset(hContact, m_szModuleName, szSetting);
}
@@ -1402,7 +1402,7 @@ void CIcqProto::writeDbInfoSettingTLVDouble(HANDLE hContact, const char *szSetti
if (num > 0)
setSettingDouble(hContact, szSetting, num);
else
- deleteSetting(hContact, szSetting);
+ db_unset(hContact, m_szModuleName, szSetting);
}
void CIcqProto::writeDbInfoSettingTLVDate(HANDLE hContact, const char* szSettingYear, const char* szSettingMonth, const char* szSettingDay, oscar_tlv_chain* chain, WORD wTlv)
@@ -1414,22 +1414,22 @@ void CIcqProto::writeDbInfoSettingTLVDate(HANDLE hContact, const char* szSetting
SYSTEMTIME sTime = {0};
if (VariantTimeToSystemTime(time + 2, &sTime))
{
- setSettingWord(hContact, szSettingYear, sTime.wYear);
- setSettingByte(hContact, szSettingMonth, (BYTE)sTime.wMonth);
- setSettingByte(hContact, szSettingDay, (BYTE)sTime.wDay);
+ setWord(hContact, szSettingYear, sTime.wYear);
+ setByte(hContact, szSettingMonth, (BYTE)sTime.wMonth);
+ setByte(hContact, szSettingDay, (BYTE)sTime.wDay);
}
else
{
- deleteSetting(hContact, szSettingYear);
- deleteSetting(hContact, szSettingMonth);
- deleteSetting(hContact, szSettingDay);
+ db_unset(hContact, m_szModuleName, szSettingYear);
+ db_unset(hContact, m_szModuleName, szSettingMonth);
+ db_unset(hContact, m_szModuleName, szSettingDay);
}
}
else
{
- deleteSetting(hContact, szSettingYear);
- deleteSetting(hContact, szSettingMonth);
- deleteSetting(hContact, szSettingDay);
+ db_unset(hContact, m_szModuleName, szSettingYear);
+ db_unset(hContact, m_szModuleName, szSettingMonth);
+ db_unset(hContact, m_szModuleName, 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
- deleteSetting(hContact, szSetting);
+ db_unset(hContact, m_szModuleName, szSetting);
}
@@ -1460,7 +1460,7 @@ BOOL CIcqProto::writeDbInfoSettingString(HANDLE hContact, const char* szSetting,
if ((wLen > 0) && (**buf) && ((*buf)[wLen-1]==0)) // Make sure we have a proper string
{
- WORD wCp = getSettingWord(hContact, "InfoCodePage", getSettingWord(hContact, "InfoCP", CP_ACP));
+ WORD wCp = getWord(hContact, "InfoCodePage", getWord(hContact, "InfoCP", CP_ACP));
if (wCp != CP_ACP)
{
@@ -1468,17 +1468,17 @@ BOOL CIcqProto::writeDbInfoSettingString(HANDLE hContact, const char* szSetting,
if (szUtf)
{
- setSettingStringUtf(hContact, szSetting, szUtf);
+ db_set_utf(hContact, m_szModuleName, szSetting, szUtf);
SAFE_FREE((void**)&szUtf);
}
else
- setSettingString(hContact, szSetting, *buf);
+ setString(hContact, szSetting, *buf);
}
else
- setSettingString(hContact, szSetting, *buf);
+ setString(hContact, szSetting, *buf);
}
else
- deleteSetting(hContact, szSetting);
+ db_unset(hContact, m_szModuleName, szSetting);
*buf += wLen;
*pwLength -= wLen;
@@ -1498,9 +1498,9 @@ BOOL CIcqProto::writeDbInfoSettingWord(HANDLE hContact, const char *szSetting, c
*pwLength -= 2;
if (wVal != 0)
- setSettingWord(hContact, szSetting, wVal);
+ setWord(hContact, szSetting, wVal);
else
- deleteSetting(hContact, szSetting);
+ db_unset(hContact, m_szModuleName, szSetting);
return TRUE;
}
@@ -1519,9 +1519,9 @@ BOOL CIcqProto::writeDbInfoSettingWordWithTable(HANDLE hContact, const char *szS
text = LookupFieldNameUtf(table, wVal, sbuf, MAX_PATH);
if (text)
- setSettingStringUtf(hContact, szSetting, text);
+ db_set_utf(hContact, m_szModuleName, szSetting, text);
else
- deleteSetting(hContact, szSetting);
+ db_unset(hContact, m_szModuleName, szSetting);
return TRUE;
}
@@ -1537,9 +1537,9 @@ BOOL CIcqProto::writeDbInfoSettingByte(HANDLE hContact, const char *pszSetting,
*pwLength -= 1;
if (byVal != 0)
- setSettingByte(hContact, pszSetting, byVal);
+ setByte(hContact, pszSetting, byVal);
else
- deleteSetting(hContact, pszSetting);
+ db_unset(hContact, m_szModuleName, pszSetting);
return TRUE;
}
@@ -1558,9 +1558,9 @@ BOOL CIcqProto::writeDbInfoSettingByteWithTable(HANDLE hContact, const char *szS
text = LookupFieldNameUtf(table, byVal, sbuf, MAX_PATH);
if (text)
- setSettingStringUtf(hContact, szSetting, text);
+ db_set_utf(hContact, m_szModuleName, szSetting, text);
else
- deleteSetting(hContact, szSetting);
+ db_unset(hContact, m_szModuleName, szSetting);
return TRUE;
}
@@ -1583,7 +1583,7 @@ char* time2text(time_t time)
BOOL CIcqProto::validateStatusMessageRequest(HANDLE hContact, WORD byMessageType)
{
// Privacy control
- if (getSettingByte(NULL, "StatusMsgReplyCList", 0))
+ if (getByte("StatusMsgReplyCList", 0))
{
// Don't send statusmessage to unknown contacts
if (hContact == INVALID_HANDLE_VALUE)
@@ -1595,7 +1595,7 @@ BOOL CIcqProto::validateStatusMessageRequest(HANDLE hContact, WORD byMessageType
return FALSE;
// Don't send statusmessage to invisible contacts
- if (getSettingByte(NULL, "StatusMsgReplyVisible", 0))
+ if (getByte("StatusMsgReplyVisible", 0))
{
WORD wStatus = getContactStatus(hContact);
if (wStatus == ID_STATUS_OFFLINE)
@@ -1605,7 +1605,7 @@ BOOL CIcqProto::validateStatusMessageRequest(HANDLE hContact, WORD byMessageType
// Dont send messages to people you are hiding from
if (hContact != INVALID_HANDLE_VALUE &&
- getSettingWord(hContact, "ApparentMode", 0) == ID_STATUS_OFFLINE)
+ getWord(hContact, "ApparentMode", 0) == ID_STATUS_OFFLINE)
{
return FALSE;
}
@@ -1622,9 +1622,9 @@ BOOL CIcqProto::validateStatusMessageRequest(HANDLE hContact, WORD byMessageType
}
if (hContact != INVALID_HANDLE_VALUE && m_iStatus==ID_STATUS_INVISIBLE &&
- getSettingWord(hContact, "ApparentMode", 0) != ID_STATUS_ONLINE)
+ getWord(hContact, "ApparentMode", 0) != ID_STATUS_ONLINE)
{
- if (!getSettingByte(hContact, "TemporaryVisible", 0))
+ if (!getByte(hContact, "TemporaryVisible", 0))
{ // Allow request to temporary visible contacts
return FALSE;
}
@@ -1863,11 +1863,11 @@ WORD CIcqProto::GetMyStatusFlags()
WORD wFlags = 0;
// Webaware setting bit flag
- if (getSettingByte(NULL, "WebAware", 0))
+ if (getByte("WebAware", 0))
wFlags |= STATUS_WEBAWARE;
// DC setting bit flag
- switch (getSettingByte(NULL, "DCType", 0))
+ switch (getByte("DCType", 0))
{
case 0:
break;
@@ -2089,7 +2089,7 @@ int MessageBoxUtf(HWND hWnd, const char *szText, const char *szCaption, UINT uTy
char* CIcqProto::ConvertMsgToUserSpecificAnsi(HANDLE hContact, const char* szMsg)
{ // this takes utf-8 encoded message
- WORD wCP = getSettingWord(hContact, "CodePage", m_wAnsiCodepage);
+ WORD wCP = getWord(hContact, "CodePage", m_wAnsiCodepage);
char* szAnsi = NULL;
if (wCP != CP_ACP) // convert to proper codepage