diff options
Diffstat (limited to 'protocols/JabberG')
20 files changed, 249 insertions, 290 deletions
diff --git a/protocols/JabberG/src/jabber_byte.cpp b/protocols/JabberG/src/jabber_byte.cpp index 0ef10c220d..8970a5b657 100644 --- a/protocols/JabberG/src/jabber_byte.cpp +++ b/protocols/JabberG/src/jabber_byte.cpp @@ -155,7 +155,7 @@ void CJabberProto::ByteSendThread(JABBER_BYTE_TRANSFER *jbt) if (m_options.BsProxyManual) {
proxyJid = NULL;
- if ( !db_get_s(NULL, m_szModuleName, "BsProxyServer", &dbv)) {
+ if ( !getString("BsProxyServer", &dbv)) {
proxyJid = mir_a2t(dbv.pszVal);
db_free(&dbv);
}
@@ -199,7 +199,7 @@ void CJabberProto::ByteSendThread(JABBER_BYTE_TRANSFER *jbt) if (bDirect) {
if (m_options.BsDirectManual) {
- if ( !db_get_s(NULL, m_szModuleName, "BsDirectAddr", &dbv))
+ if ( !getString("BsDirectAddr", &dbv))
localAddr = dbv.pszVal;
}
diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp index e725096391..ceca0cac8c 100644 --- a/protocols/JabberG/src/jabber_chat.cpp +++ b/protocols/JabberG/src/jabber_chat.cpp @@ -153,7 +153,7 @@ int CJabberProto::GcInit(JABBER_LIST_ITEM* item) if ( !getTString(hContact, "MyNick", &dbv)) {
if ( !lstrcmp(dbv.ptszVal, szNick))
- JDeleteSetting(hContact, "MyNick");
+ delSetting(hContact, "MyNick");
else
setTString(hContact, "MyNick", item->nick);
db_free(&dbv);
@@ -163,7 +163,7 @@ int CJabberProto::GcInit(JABBER_LIST_ITEM* item) TCHAR *passw = JGetStringCrypt(hContact, "LoginPassword");
if (lstrcmp_null(passw, item->password)) {
if ( !item->password || !item->password[0])
- JDeleteSetting(hContact, "LoginPassword");
+ delSetting(hContact, "LoginPassword");
else
JSetStringCrypt(hContact, "LoginPassword", item->password);
}
@@ -376,7 +376,7 @@ void CJabberProto::GcQuit(JABBER_LIST_ITEM* item, int code, HXML reason) CallServiceSync(MS_GC_EVENT, WINDOW_CLEARLOG, (LPARAM)&gce);
DBVARIANT dbvMessage;
- if ( !db_get_ts(NULL, m_szModuleName, "GcMsgQuit", &dbvMessage)) {
+ if ( !getTString("GcMsgQuit", &dbvMessage)) {
szMessage = NEWTSTR_ALLOCA(dbvMessage.ptszVal);
db_free(&dbvMessage);
}
@@ -1067,7 +1067,7 @@ static void sttNickListHook(CJabberProto* ppro, JABBER_LIST_ITEM* item, GCHOOK* {
if (ppro->m_bJabberOnline) {
DBVARIANT dbv = {0};
- TCHAR *szMessage = db_get_ts(NULL, ppro->m_szModuleName, "GcMsgSlap", &dbv) ?
+ TCHAR *szMessage = ppro->getTString("GcMsgSlap", &dbv) ?
NEWTSTR_ALLOCA(TranslateTS(JABBER_GC_MSG_SLAP)) : dbv.ptszVal;
TCHAR buf[256];
diff --git a/protocols/JabberG/src/jabber_console.cpp b/protocols/JabberG/src/jabber_console.cpp index b7dcadb11b..9fb244cd23 100644 --- a/protocols/JabberG/src/jabber_console.cpp +++ b/protocols/JabberG/src/jabber_console.cpp @@ -374,14 +374,14 @@ void CJabberDlgConsole::OnInitDialog() SendDlgItemMessage(m_hwnd, IDC_CONSOLE, EM_SETEDITSTYLE, SES_EXTENDBACKCOLOR, SES_EXTENDBACKCOLOR);
SendDlgItemMessage(m_hwnd, IDC_CONSOLE, EM_EXLIMITTEXT, 0, 0x80000000);
- m_proto->m_filterInfo.msg = db_get_b(NULL, m_proto->m_szModuleName, "consoleWnd_msg", TRUE);
- m_proto->m_filterInfo.presence = db_get_b(NULL, m_proto->m_szModuleName, "consoleWnd_presence", TRUE);
- m_proto->m_filterInfo.iq = db_get_b(NULL, m_proto->m_szModuleName, "consoleWnd_iq", TRUE);
- m_proto->m_filterInfo.type = (TFilterInfo::Type)db_get_b(NULL, m_proto->m_szModuleName, "consoleWnd_ftype", TFilterInfo::T_OFF);
+ m_proto->m_filterInfo.msg = m_proto->getByte("consoleWnd_msg", TRUE);
+ m_proto->m_filterInfo.presence = m_proto->getByte("consoleWnd_presence", TRUE);
+ m_proto->m_filterInfo.iq = m_proto->getByte("consoleWnd_iq", TRUE);
+ m_proto->m_filterInfo.type = (TFilterInfo::Type)m_proto->getByte("consoleWnd_ftype", TFilterInfo::T_OFF);
DBVARIANT dbv;
*m_proto->m_filterInfo.pattern = 0;
- if ( !m_proto->getTString(NULL, "consoleWnd_fpattern", &dbv)) {
+ if ( !m_proto->getTString("consoleWnd_fpattern", &dbv)) {
lstrcpyn(m_proto->m_filterInfo.pattern, dbv.ptszVal, SIZEOF(m_proto->m_filterInfo.pattern));
db_free(&dbv);
}
@@ -429,11 +429,11 @@ void CJabberDlgConsole::OnInitDialog() void CJabberDlgConsole::OnClose()
{
- db_set_b(NULL, m_proto->m_szModuleName, "consoleWnd_msg", m_proto->m_filterInfo.msg);
- db_set_b(NULL, m_proto->m_szModuleName, "consoleWnd_presence", m_proto->m_filterInfo.presence);
- db_set_b(NULL, m_proto->m_szModuleName, "consoleWnd_iq", m_proto->m_filterInfo.iq);
- db_set_b(NULL, m_proto->m_szModuleName, "consoleWnd_ftype", m_proto->m_filterInfo.type);
- m_proto->setTString(NULL, "consoleWnd_fpattern", m_proto->m_filterInfo.pattern);
+ m_proto->setByte("consoleWnd_msg", m_proto->m_filterInfo.msg);
+ m_proto->setByte("consoleWnd_presence", m_proto->m_filterInfo.presence);
+ m_proto->setByte("consoleWnd_iq", m_proto->m_filterInfo.iq);
+ m_proto->setByte("consoleWnd_ftype", m_proto->m_filterInfo.type);
+ m_proto->setTString("consoleWnd_fpattern", m_proto->m_filterInfo.pattern);
Utils_SaveWindowPosition(m_hwnd, NULL, m_proto->m_szModuleName, "consoleWnd_");
DestroyWindow(m_hwnd);
diff --git a/protocols/JabberG/src/jabber_disco.cpp b/protocols/JabberG/src/jabber_disco.cpp index c45f8172f6..8e19ff37a7 100644 --- a/protocols/JabberG/src/jabber_disco.cpp +++ b/protocols/JabberG/src/jabber_disco.cpp @@ -440,18 +440,18 @@ void CJabberProto::PerformBrowse(HWND hwndDlg) }
else if ( !lstrcmp(szJid, _T(SD_FAKEJID_FAVORITES))) {
sttBrowseMode = SD_BROWSE_FAVORITES;
- int count = getDword(NULL, "discoWnd_favCount", 0);
+ int count = getDword("discoWnd_favCount", 0);
for (int i = 0; i < count; i++)
{
DBVARIANT dbv;
char setting[MAXMODULELABELLENGTH];
mir_snprintf(setting, sizeof(setting), "discoWnd_favName_%d", i);
- if ( !getTString(NULL, setting, &dbv)) {
+ if ( !getTString(setting, &dbv)) {
DBVARIANT dbvJid, dbvNode;
mir_snprintf(setting, sizeof(setting), "discoWnd_favJID_%d", i);
- getTString(NULL, setting, &dbvJid);
+ getTString(setting, &dbvJid);
mir_snprintf(setting, sizeof(setting), "discoWnd_favNode_%d", i);
- getTString(NULL, setting, &dbvNode);
+ getTString(setting, &dbvNode);
CJabberSDNode* pNode = m_SDManager.AddPrimaryNode(dbvJid.ptszVal, dbvNode.ptszVal, dbv.ptszVal);
SendBothRequests(pNode, NULL);
db_free(&dbv);
@@ -651,10 +651,7 @@ void CJabberDlgDiscovery::OnInitDialog() m_btnViewAsTree.MakePush();
m_btnBookmarks.MakePush();
- CheckDlgButton(m_hwnd,
- db_get_b(NULL, m_proto->m_szModuleName, "discoWnd_useTree", 1) ?
- IDC_BTN_VIEWTREE : IDC_BTN_VIEWLIST,
- TRUE);
+ CheckDlgButton(m_hwnd, m_proto->getByte("discoWnd_useTree", 1) ? IDC_BTN_VIEWTREE : IDC_BTN_VIEWLIST, TRUE);
EnableWindow(GetDlgItem(m_hwnd, IDC_BTN_FILTERRESET), FALSE);
@@ -668,15 +665,15 @@ void CJabberDlgDiscovery::OnInitDialog() HWND hwndList = m_lstDiscoTree.GetHwnd();//GetDlgItem(m_hwnd, IDC_TREE_DISCO);
LVCOLUMN lvc = {0};
lvc.mask = LVCF_SUBITEM|LVCF_WIDTH|LVCF_TEXT;
- lvc.cx = db_get_w(NULL, m_proto->m_szModuleName, "discoWnd_cx0", 200);
+ lvc.cx = m_proto->getWord("discoWnd_cx0", 200);
lvc.iSubItem = 0;
lvc.pszText = TranslateT("Node hierarchy");
ListView_InsertColumn(hwndList, 0, &lvc);
- lvc.cx = db_get_w(NULL, m_proto->m_szModuleName, "discoWnd_cx1", 200);
+ lvc.cx = m_proto->getWord("discoWnd_cx1", 200);
lvc.iSubItem = 1;
lvc.pszText = _T("JID");
ListView_InsertColumn(hwndList, 1, &lvc);
- lvc.cx = db_get_w(NULL, m_proto->m_szModuleName, "discoWnd_cx2", 200);
+ lvc.cx = m_proto->getWord("discoWnd_cx2", 200);
lvc.iSubItem = 2;
lvc.pszText = TranslateT("Node");
ListView_InsertColumn(hwndList, 2, &lvc);
@@ -703,7 +700,7 @@ void CJabberDlgDiscovery::OnInitDialog() TreeList_AddIcon(hwndList, m_proto->LoadIconEx("disco_progress"), SD_OVERLAY_PROGRESS);
TreeList_AddIcon(hwndList, m_proto->LoadIconEx("disco_ok"), SD_OVERLAY_REGISTERED);
- TreeList_SetMode(hwndList, db_get_b(NULL, m_proto->m_szModuleName, "discoWnd_useTree", 1) ? TLM_TREE : TLM_REPORT);
+ TreeList_SetMode(hwndList, m_proto->getByte("discoWnd_useTree", 1) ? TLM_TREE : TLM_REPORT);
PostMessage(m_hwnd, WM_COMMAND, MAKEWPARAM(IDC_BUTTON_BROWSE, 0), 0);
@@ -712,17 +709,17 @@ void CJabberDlgDiscovery::OnInitDialog() void CJabberDlgDiscovery::OnClose()
{
- db_set_b(NULL, m_proto->m_szModuleName, "discoWnd_useTree", IsDlgButtonChecked(m_hwnd, IDC_BTN_VIEWTREE));
+ m_proto->setByte("discoWnd_useTree", IsDlgButtonChecked(m_hwnd, IDC_BTN_VIEWTREE));
HWND hwndList = GetDlgItem(m_hwnd, IDC_TREE_DISCO);
LVCOLUMN lvc = {0};
lvc.mask = LVCF_WIDTH;
ListView_GetColumn(hwndList, 0, &lvc);
- db_set_w(NULL, m_proto->m_szModuleName, "discoWnd_cx0", lvc.cx);
+ m_proto->setWord("discoWnd_cx0", lvc.cx);
ListView_GetColumn(hwndList, 1, &lvc);
- db_set_w(NULL, m_proto->m_szModuleName, "discoWnd_cx1", lvc.cx);
+ m_proto->setWord("discoWnd_cx1", lvc.cx);
ListView_GetColumn(hwndList, 2, &lvc);
- db_set_w(NULL, m_proto->m_szModuleName, "discoWnd_cx2", lvc.cx);
+ m_proto->setWord("discoWnd_cx2", lvc.cx);
Utils_SaveWindowPosition(m_hwnd, NULL, m_proto->m_szModuleName, "discoWnd_");
DestroyWindow(m_hwnd);
@@ -803,14 +800,13 @@ void CJabberDlgDiscovery::btnGoHome_OnClick(CCtrlButton *) void CJabberDlgDiscovery::btnBookmarks_OnClick(CCtrlButton *)
{
HMENU hMenu = CreatePopupMenu();
- int count = m_proto->getDword(NULL, "discoWnd_favCount", 0);
- for (int i = 0; i < count; i++)
- {
- DBVARIANT dbv;
+ int count = m_proto->getDword("discoWnd_favCount", 0);
+ for (int i = 0; i < count; i++) {
char setting[MAXMODULELABELLENGTH];
mir_snprintf(setting, sizeof(setting), "discoWnd_favName_%d", i);
- if ( !m_proto->getTString(NULL, setting, &dbv))
- {
+
+ DBVARIANT dbv;
+ if ( !m_proto->getTString(setting, &dbv)) {
HMENU hSubMenu = CreatePopupMenu();
AppendMenu(hSubMenu, MF_STRING, 100+i*10+0, TranslateT("Navigate"));
AppendMenu(hSubMenu, MF_SEPARATOR, 0, NULL);
@@ -838,21 +834,19 @@ void CJabberDlgDiscovery::btnBookmarks_OnClick(CCtrlButton *) CheckDlgButton(m_hwnd, IDC_BTN_FAVORITE, FALSE);
DestroyMenu(hMenu);
- if (res >= 100)
- {
+ if (res >= 100) {
res -= 100;
- if (res % 10)
- {
+ if (res % 10) {
res /= 10;
char setting[MAXMODULELABELLENGTH];
mir_snprintf(setting, sizeof(setting), "discoWnd_favName_%d", res);
- m_proto->JDeleteSetting(NULL, setting);
+ m_proto->delSetting(setting);
mir_snprintf(setting, sizeof(setting), "discoWnd_favJID_%d", res);
- m_proto->JDeleteSetting(NULL, setting);
+ m_proto->delSetting(setting);
mir_snprintf(setting, sizeof(setting), "discoWnd_favNode_%d", res);
- m_proto->JDeleteSetting(NULL, setting);
- } else
- {
+ m_proto->delSetting(setting);
+ }
+ else {
res /= 10;
SetDlgItemText(m_hwnd, IDC_COMBO_JID, _T(""));
@@ -861,10 +855,10 @@ void CJabberDlgDiscovery::btnBookmarks_OnClick(CCtrlButton *) DBVARIANT dbv;
char setting[MAXMODULELABELLENGTH];
mir_snprintf(setting, sizeof(setting), "discoWnd_favJID_%d", res);
- if ( !m_proto->getTString(NULL, setting, &dbv)) SetDlgItemText(m_hwnd, IDC_COMBO_JID, dbv.ptszVal);
+ if ( !m_proto->getTString(setting, &dbv)) SetDlgItemText(m_hwnd, IDC_COMBO_JID, dbv.ptszVal);
db_free(&dbv);
mir_snprintf(setting, sizeof(setting), "discoWnd_favNode_%d", res);
- if ( !m_proto->getTString(NULL, setting, &dbv)) SetDlgItemText(m_hwnd, IDC_COMBO_NODE, dbv.ptszVal);
+ if ( !m_proto->getTString(setting, &dbv)) SetDlgItemText(m_hwnd, IDC_COMBO_NODE, dbv.ptszVal);
db_free(&dbv);
PostMessage(m_hwnd, WM_COMMAND, MAKEWPARAM(IDC_BUTTON_BROWSE, 0), 0);
@@ -872,18 +866,18 @@ void CJabberDlgDiscovery::btnBookmarks_OnClick(CCtrlButton *) } else
if (res == 1)
{
- int count = m_proto->getDword(NULL, "discoWnd_favCount", 0);
+ int count = m_proto->getDword("discoWnd_favCount", 0);
for (int i = 0; i < count; i++)
{
char setting[MAXMODULELABELLENGTH];
mir_snprintf(setting, sizeof(setting), "discoWnd_favName_%d", i);
- m_proto->JDeleteSetting(NULL, setting);
+ m_proto->delSetting(setting);
mir_snprintf(setting, sizeof(setting), "discoWnd_favJID_%d", i);
- m_proto->JDeleteSetting(NULL, setting);
+ m_proto->delSetting(setting);
mir_snprintf(setting, sizeof(setting), "discoWnd_favNode_%d", i);
- m_proto->JDeleteSetting(NULL, setting);
+ m_proto->delSetting(setting);
}
- m_proto->JDeleteSetting(NULL, "discoWnd_favCount");
+ m_proto->delSetting("discoWnd_favCount");
} else
if ((res >= 10) && (res <= 20))
{
@@ -1368,14 +1362,14 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM case SD_ACT_FAVORITE:
{
char setting[MAXMODULELABELLENGTH];
- int count = getDword(NULL, "discoWnd_favCount", 0);
+ int count = getDword("discoWnd_favCount", 0);
mir_snprintf(setting, sizeof(setting), "discoWnd_favName_%d", count);
- setTString(NULL, setting, pNode->GetName() ? pNode->GetName() : pNode->GetJid());
+ setTString(setting, pNode->GetName() ? pNode->GetName() : pNode->GetJid());
mir_snprintf(setting, sizeof(setting), "discoWnd_favJID_%d", count);
- setTString(NULL, setting, pNode->GetJid());
+ setTString(setting, pNode->GetJid());
mir_snprintf(setting, sizeof(setting), "discoWnd_favNode_%d", count);
- setTString(NULL, setting, pNode->GetNode() ? pNode->GetNode() : _T(""));
- setDword(NULL, "discoWnd_favCount", ++count);
+ setTString(setting, pNode->GetNode() ? pNode->GetNode() : _T(""));
+ setDword("discoWnd_favCount", ++count);
break;
}
@@ -1394,7 +1388,7 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM case SD_ACT_PROXY:
m_options.BsDirect = FALSE;
m_options.BsProxyManual = TRUE;
- setTString(NULL, "BsProxyServer", pNode->GetJid());
+ setTString("BsProxyServer", pNode->GetJid());
break;
case SD_ACT_JOIN:
diff --git a/protocols/JabberG/src/jabber_file.cpp b/protocols/JabberG/src/jabber_file.cpp index 45f303153b..42d3ba57d0 100644 --- a/protocols/JabberG/src/jabber_file.cpp +++ b/protocols/JabberG/src/jabber_file.cpp @@ -307,7 +307,7 @@ void __cdecl CJabberProto::FileServerThread(filetransfer *ft) char *myAddr = NULL;
DBVARIANT dbv;
if (m_options.BsDirect && m_options.BsDirectManual) {
- if ( !db_get_s(NULL, m_szModuleName, "BsDirectAddr", &dbv))
+ if ( !getString("BsDirectAddr", &dbv))
myAddr = dbv.pszVal;
}
diff --git a/protocols/JabberG/src/jabber_groupchat.cpp b/protocols/JabberG/src/jabber_groupchat.cpp index 900e21ebc5..a3a76a5131 100644 --- a/protocols/JabberG/src/jabber_groupchat.cpp +++ b/protocols/JabberG/src/jabber_groupchat.cpp @@ -134,19 +134,19 @@ struct JabberGcRecentInfo cleanup();
mir_snprintf(setting, sizeof(setting), "rcMuc_%d_server", iRecent);
- if ( !ppro->getTString(NULL, setting, &dbv)) {
+ if ( !ppro->getTString(setting, &dbv)) {
server = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
}
mir_snprintf(setting, sizeof(setting), "rcMuc_%d_room", iRecent);
- if ( !ppro->getTString(NULL, setting, &dbv)) {
+ if ( !ppro->getTString(setting, &dbv)) {
room = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
}
mir_snprintf(setting, sizeof(setting), "rcMuc_%d_nick", iRecent);
- if ( !ppro->getTString(NULL, setting, &dbv)) {
+ if ( !ppro->getTString(setting, &dbv)) {
nick = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
}
@@ -163,27 +163,27 @@ struct JabberGcRecentInfo mir_snprintf(setting, sizeof(setting), "rcMuc_%d_server", iRecent);
if (server)
- ppro->setTString(NULL, setting, server);
+ ppro->setTString(setting, server);
else
- ppro->JDeleteSetting(NULL, setting);
+ ppro->delSetting(setting);
mir_snprintf(setting, sizeof(setting), "rcMuc_%d_room", iRecent);
if (room)
- ppro->setTString(NULL, setting, room);
+ ppro->setTString(setting, room);
else
- ppro->JDeleteSetting(NULL, setting);
+ ppro->delSetting(setting);
mir_snprintf(setting, sizeof(setting), "rcMuc_%d_nick", iRecent);
if (nick)
- ppro->setTString(NULL, setting, nick);
+ ppro->setTString(setting, nick);
else
- ppro->JDeleteSetting(NULL, setting);
+ ppro->delSetting(setting);
mir_snprintf(setting, sizeof(setting), "rcMuc_%d_passwordW", iRecent);
if (password)
ppro->JSetStringCrypt(NULL, setting, password);
else
- ppro->JDeleteSetting(NULL, setting);
+ ppro->delSetting(setting);
}
private:
@@ -234,7 +234,7 @@ INT_PTR __cdecl CJabberProto::OnJoinChat(WPARAM wParam, LPARAM) return 0;
if (getTString(hContact, "MyNick", &nick))
- if (getTString(NULL, "Nick", &nick)) {
+ if (getTString("Nick", &nick)) {
db_free(&jid);
return 0;
}
@@ -501,7 +501,7 @@ void CJabberDlgGcJoin::OnInitDialog() }
DBVARIANT dbv;
- if ( !m_proto->getTString(NULL, "Nick", &dbv)) {
+ if ( !m_proto->getTString("Nick", &dbv)) {
SetDlgItemText(m_hwnd, IDC_NICK, dbv.ptszVal);
db_free(&dbv);
}
diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp index 3e6c05eeb1..76ac8734e7 100644 --- a/protocols/JabberG/src/jabber_iqid.cpp +++ b/protocols/JabberG/src/jabber_iqid.cpp @@ -280,8 +280,8 @@ void CJabberProto::OnIqResultSetAuth(HXML iqNode) if ( !lstrcmp(type, _T("result"))) {
DBVARIANT dbv;
- if (getTString(NULL, "Nick", &dbv))
- setTString(NULL, "Nick", m_ThreadInfo->username);
+ if (getTString("Nick", &dbv))
+ setTString("Nick", m_ThreadInfo->username);
else
db_free(&dbv);
@@ -855,7 +855,7 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode) }
else {
hasBday = TRUE;
- setTString(NULL, "BirthDate", xmlGetText(n));
+ setTString("BirthDate", xmlGetText(n));
} }
}
else if ( !lstrcmp(xmlGetName(n), _T("GENDER"))) {
@@ -869,7 +869,7 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode) }
else {
hasGender = TRUE;
- setTString(NULL, "GenderString", xmlGetText(n));
+ setTString("GenderString", xmlGetText(n));
} }
}
else if ( !lstrcmp(xmlGetName(n), _T("ADR"))) {
@@ -991,7 +991,7 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode) else {
char text[ 100 ];
sprintf(text, "Phone%d", nPhone);
- setTString(NULL, text, xmlGetText(m));
+ setTString(text, xmlGetText(m));
sprintf(text, "PhoneFlag%d", nPhone);
int nFlag = 0;
@@ -1060,26 +1060,26 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode) setTString(hContact, "Nick", ptrT( db_get_tsa(hContact, m_szModuleName, "FullName")));
}
if ( !hasFn)
- JDeleteSetting(hContact, "FullName");
+ delSetting(hContact, "FullName");
// We are not deleting "Nick"
// if ( !hasNick)
-// JDeleteSetting(hContact, "Nick");
+// delSetting(hContact, "Nick");
if ( !hasGiven)
- JDeleteSetting(hContact, "FirstName");
+ delSetting(hContact, "FirstName");
if ( !hasFamily)
- JDeleteSetting(hContact, "LastName");
+ delSetting(hContact, "LastName");
if ( !hasMiddle)
- JDeleteSetting(hContact, "MiddleName");
+ delSetting(hContact, "MiddleName");
if (hContact != NULL) {
while (true) {
if (nEmail <= 0)
- JDeleteSetting(hContact, "e-mail");
+ delSetting(hContact, "e-mail");
else {
char text[ 100 ];
sprintf(text, "e-mail%d", nEmail-1);
if ( db_get_s(hContact, m_szModuleName, text, &dbv)) break;
db_free(&dbv);
- JDeleteSetting(hContact, text);
+ delSetting(hContact, text);
}
nEmail++;
}
@@ -1088,83 +1088,83 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode) while (true) {
char text[ 100 ];
sprintf(text, "e-mail%d", nEmail);
- if ( db_get_s(NULL, m_szModuleName, text, &dbv)) break;
+ if ( getString(text, &dbv)) break;
db_free(&dbv);
- JDeleteSetting(NULL, text);
+ delSetting(text);
sprintf(text, "e-mailFlag%d", nEmail);
- JDeleteSetting(NULL, text);
+ delSetting(text);
nEmail++;
} }
if ( !hasBday) {
- JDeleteSetting(hContact, "BirthYear");
- JDeleteSetting(hContact, "BirthMonth");
- JDeleteSetting(hContact, "BirthDay");
- JDeleteSetting(hContact, "BirthDate");
- JDeleteSetting(hContact, "Age");
+ delSetting(hContact, "BirthYear");
+ delSetting(hContact, "BirthMonth");
+ delSetting(hContact, "BirthDay");
+ delSetting(hContact, "BirthDate");
+ delSetting(hContact, "Age");
}
if ( !hasGender) {
if (hContact != NULL)
- JDeleteSetting(hContact, "Gender");
+ delSetting(hContact, "Gender");
else
- JDeleteSetting(NULL, "GenderString");
+ delSetting("GenderString");
}
if (hContact != NULL) {
if ( !hasPhone)
- JDeleteSetting(hContact, "Phone");
+ delSetting(hContact, "Phone");
if ( !hasFax)
- JDeleteSetting(hContact, "Fax");
+ delSetting(hContact, "Fax");
if ( !hasCell)
- JDeleteSetting(hContact, "Cellular");
+ delSetting(hContact, "Cellular");
}
else {
while (true) {
char text[ 100 ];
sprintf(text, "Phone%d", nPhone);
- if ( db_get_s(NULL, m_szModuleName, text, &dbv)) break;
+ if ( getString(text, &dbv)) break;
db_free(&dbv);
- JDeleteSetting(NULL, text);
+ delSetting(text);
sprintf(text, "PhoneFlag%d", nPhone);
- JDeleteSetting(NULL, text);
+ delSetting(text);
nPhone++;
} }
if ( !hasHomeStreet)
- JDeleteSetting(hContact, "Street");
+ delSetting(hContact, "Street");
if ( !hasHomeStreet2 && hContact==NULL)
- JDeleteSetting(hContact, "Street2");
+ delSetting(hContact, "Street2");
if ( !hasHomeLocality)
- JDeleteSetting(hContact, "City");
+ delSetting(hContact, "City");
if ( !hasHomeRegion)
- JDeleteSetting(hContact, "State");
+ delSetting(hContact, "State");
if ( !hasHomePcode)
- JDeleteSetting(hContact, "ZIP");
+ delSetting(hContact, "ZIP");
if ( !hasHomeCtry)
- JDeleteSetting(hContact, "Country");
+ delSetting(hContact, "Country");
if ( !hasWorkStreet)
- JDeleteSetting(hContact, "CompanyStreet");
+ delSetting(hContact, "CompanyStreet");
if ( !hasWorkStreet2 && hContact==NULL)
- JDeleteSetting(hContact, "CompanyStreet2");
+ delSetting(hContact, "CompanyStreet2");
if ( !hasWorkLocality)
- JDeleteSetting(hContact, "CompanyCity");
+ delSetting(hContact, "CompanyCity");
if ( !hasWorkRegion)
- JDeleteSetting(hContact, "CompanyState");
+ delSetting(hContact, "CompanyState");
if ( !hasWorkPcode)
- JDeleteSetting(hContact, "CompanyZIP");
+ delSetting(hContact, "CompanyZIP");
if ( !hasWorkCtry)
- JDeleteSetting(hContact, "CompanyCountry");
+ delSetting(hContact, "CompanyCountry");
if ( !hasUrl)
- JDeleteSetting(hContact, "Homepage");
+ delSetting(hContact, "Homepage");
if ( !hasOrgname)
- JDeleteSetting(hContact, "Company");
+ delSetting(hContact, "Company");
if ( !hasOrgunit)
- JDeleteSetting(hContact, "CompanyDepartment");
+ delSetting(hContact, "CompanyDepartment");
if ( !hasRole)
- JDeleteSetting(hContact, "Role");
+ delSetting(hContact, "Role");
if ( !hasTitle)
- JDeleteSetting(hContact, "CompanyPosition");
+ delSetting(hContact, "CompanyPosition");
if ( !hasDesc)
- JDeleteSetting(hContact, "About");
+ delSetting(hContact, "About");
if (id == m_ThreadInfo->resolveID) {
const TCHAR *p = _tcschr(jid, '@');
@@ -1353,11 +1353,11 @@ void CJabberProto::OnIqResultGetVCardAvatar(HXML iqNode) if (vCard == NULL) return;
if (xmlGetChildCount(vCard) == 0) {
- JDeleteSetting(hContact, "AvatarHash");
+ delSetting(hContact, "AvatarHash");
DBVARIANT dbv = {0};
if ( !getTString(hContact, "AvatarSaved", &dbv)) {
db_free(&dbv);
- JDeleteSetting(hContact, "AvatarSaved");
+ delSetting(hContact, "AvatarSaved");
ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, NULL, NULL);
}
@@ -1693,7 +1693,7 @@ void CJabberProto::OnIqResultEntityTime(HXML pIqNode, CJabberIqInfo* pInfo) if (szTz)
setTString(pInfo->m_hContact, "TzName", szTz);
else
- JDeleteSetting(pInfo->m_hContact, "TzName");
+ delSetting(pInfo->m_hContact, "TzName");
return;
}
}
@@ -1703,6 +1703,6 @@ void CJabberProto::OnIqResultEntityTime(HXML pIqNode, CJabberIqInfo* pInfo) return;
}
- JDeleteSetting(pInfo->m_hContact, "Timezone");
- JDeleteSetting(pInfo->m_hContact, "TzName");
+ delSetting(pInfo->m_hContact, "Timezone");
+ delSetting(pInfo->m_hContact, "TzName");
}
diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp index 4c145e1cfc..147e195920 100644 --- a/protocols/JabberG/src/jabber_menu.cpp +++ b/protocols/JabberG/src/jabber_menu.cpp @@ -490,7 +490,7 @@ INT_PTR __cdecl CJabberProto::OnMenuConvertChatContact(WPARAM wParam, LPARAM) if ((bIsChatRoom == GCW_CHATROOM) || bIsChatRoom == 0) {
DBVARIANT dbv;
if ( !getTString((HANDLE) wParam, (bIsChatRoom == GCW_CHATROOM)?(char*)"ChatRoomID":(char*)"jid", &dbv)) {
- JDeleteSetting((HANDLE) wParam, (bIsChatRoom == GCW_CHATROOM)?"ChatRoomID":"jid");
+ delSetting((HANDLE) wParam, (bIsChatRoom == GCW_CHATROOM)?"ChatRoomID":"jid");
setTString((HANDLE) wParam, (bIsChatRoom != GCW_CHATROOM)?"ChatRoomID":"jid", dbv.ptszVal);
db_free(&dbv);
setByte((HANDLE) wParam, "ChatRoom", (bIsChatRoom == GCW_CHATROOM)?0:GCW_CHATROOM);
diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp index b04bba1ad1..8ad48dd6eb 100644 --- a/protocols/JabberG/src/jabber_misc.cpp +++ b/protocols/JabberG/src/jabber_misc.cpp @@ -119,7 +119,7 @@ void JabberContactListCreateGroup(TCHAR* groupName) void CJabberProto::DBAddAuthRequest(const TCHAR *jid, const TCHAR *nick)
{
HANDLE hContact = DBCreateContact(jid, NULL, TRUE, TRUE);
- JDeleteSetting(hContact, "Hidden");
+ delSetting(hContact, "Hidden");
//setTString(hContact, "Nick", nick);
char* szJid = mir_utf8encodeT(jid);
@@ -292,8 +292,8 @@ void CJabberProto::GetAvatarFileName(HANDLE hContact, TCHAR* pszDest, size_t cbL }
else {
DBVARIANT dbv1, dbv2;
- BOOL res1 = db_get_s(NULL, m_szModuleName, "LoginName", &dbv1);
- BOOL res2 = db_get_s(NULL, m_szModuleName, "LoginServer", &dbv2);
+ BOOL res1 = getString("LoginName", &dbv1);
+ BOOL res2 = getString("LoginServer", &dbv2);
mir_sntprintf(pszDest + tPathLen, MAX_PATH - tPathLen, _T("%S@%S avatar.%S"),
res1 ? "noname" : dbv1.pszVal,
res2 ? m_szModuleName : dbv2.pszVal,
@@ -544,7 +544,7 @@ void CJabberProto::UpdateMirVer(HANDLE hContact, JABBER_RESOURCE_STATUS *resourc if (szMirVer[0])
setTString(hContact, "MirVer", szMirVer);
// else
-// JDeleteSetting(hContact, "MirVer");
+// delSetting(hContact, "MirVer");
DBVARIANT dbv;
if ( !getTString(hContact, "jid", &dbv)) {
@@ -594,10 +594,10 @@ void CJabberProto::SetContactOfflineStatus(HANDLE hContact) if (getWord(hContact, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE)
setWord(hContact, "Status", ID_STATUS_OFFLINE);
- JDeleteSetting(hContact, DBSETTING_XSTATUSID);
- JDeleteSetting(hContact, DBSETTING_XSTATUSNAME);
- JDeleteSetting(hContact, DBSETTING_XSTATUSMSG);
- JDeleteSetting(hContact, DBSETTING_DISPLAY_UID);
+ delSetting(hContact, DBSETTING_XSTATUSID);
+ delSetting(hContact, DBSETTING_XSTATUSNAME);
+ delSetting(hContact, DBSETTING_XSTATUSMSG);
+ delSetting(hContact, DBSETTING_DISPLAY_UID);
ResetAdvStatus(hContact, ADVSTATUS_MOOD);
ResetAdvStatus(hContact, ADVSTATUS_TUNE);
diff --git a/protocols/JabberG/src/jabber_opt.cpp b/protocols/JabberG/src/jabber_opt.cpp index 0cc72adcdd..ba28a6d4ee 100644 --- a/protocols/JabberG/src/jabber_opt.cpp +++ b/protocols/JabberG/src/jabber_opt.cpp @@ -346,7 +346,7 @@ static void sttStoreJidFromUI(CJabberProto *ppro, CCtrlEdit &txtUsername, CCtrlC int len = lstrlen(user) + lstrlen(server) + 2;
TCHAR *jid = (TCHAR *)mir_alloc(len * sizeof(TCHAR));
mir_sntprintf(jid, len, _T("%s@%s"), user, server);
- ppro->setTString(NULL, "jid", jid);
+ ppro->setTString("jid", jid);
mir_free(jid);
mir_free(server);
mir_free(user);
@@ -451,8 +451,7 @@ protected: SendDlgItemMessage(m_hwnd, IDC_PRIORITY_SPIN, UDM_SETRANGE, 0, (LPARAM)MAKELONG(127, -128));
TCHAR *passw = m_proto->JGetStringCrypt(NULL, "LoginPassword");
- if (passw)
- {
+ if (passw) {
m_txtPassword.SetText(passw);
mir_free(passw);
}
@@ -470,8 +469,7 @@ protected: if (GetComputerName(szCompName, &dwCompNameLength))
m_cbResource.AddString(szCompName);
- if ( !db_get_ts(NULL, m_proto->m_szModuleName, "Resource", &dbv))
- {
+ if ( !m_proto->getTString("Resource", &dbv)) {
if (CB_ERR == m_cbResource.FindString(dbv.ptszVal, -1, true))
m_cbResource.AddString(dbv.ptszVal);
@@ -519,14 +517,14 @@ protected: m_proto->JSetStringCrypt(NULL, "LoginPassword", text);
mir_free(text);
}
- else m_proto->JDeleteSetting(NULL, "LoginPassword");
+ else m_proto->delSetting("LoginPassword");
int index = m_cbLocale.GetCurSel();
if (index >= 0)
{
TCHAR *szLanguageCode = (TCHAR *)m_cbLocale.GetItemData(index);
if (szLanguageCode) {
- m_proto->setTString(NULL, "XmlLang", szLanguageCode);
+ m_proto->setTString("XmlLang", szLanguageCode);
mir_free(m_proto->m_tszSelectedLang);
m_proto->m_tszSelectedLang = mir_tstrdup(szLanguageCode);
@@ -1693,17 +1691,14 @@ protected: if (GetComputerName(szCompName, &dwCompNameLength))
m_cbResource.AddString(szCompName);
- if ( !db_get_ts(NULL, m_proto->m_szModuleName, "Resource", &dbv))
- {
+ if ( !m_proto->getTString("Resource", &dbv)) {
if (CB_ERR == m_cbResource.FindString(dbv.ptszVal, -1, true))
m_cbResource.AddString(dbv.ptszVal);
m_cbResource.SetText(dbv.ptszVal);
db_free(&dbv);
- } else
- {
- m_cbResource.SetText(_T("Miranda"));
}
+ else m_cbResource.SetText(_T("Miranda"));
m_cbType.AddString(TranslateT("Public XMPP Network"), ACC_PUBLIC);
m_cbType.AddString(TranslateT("Secure XMPP Network"), ACC_TLS);
@@ -1716,40 +1711,33 @@ protected: m_cbType.AddString(TranslateT("S.ms"), ACC_SMS);
m_cbServer.GetTextA(server, SIZEOF(server));
- if ( !db_get_s(NULL, m_proto->m_szModuleName, "ManualHost", &dbv))
- {
+ if ( !db_get_s(NULL, m_proto->m_szModuleName, "ManualHost", &dbv)) {
lstrcpynA(manualServer, dbv.pszVal, SIZEOF(manualServer));
db_free(&dbv);
}
m_canregister = true;
- if ( !lstrcmpA(manualServer, "talk.google.com"))
- {
+ if ( !lstrcmpA(manualServer, "talk.google.com")) {
m_cbType.SetCurSel(ACC_GTALK);
m_canregister = false;
}
- else if ( !lstrcmpA(server, "livejournal.com"))
- {
+ else if ( !lstrcmpA(server, "livejournal.com")) {
m_cbType.SetCurSel(ACC_LJTALK);
m_canregister = false;
}
- else if ( !lstrcmpA(server, "chat.facebook.com"))
- {
+ else if ( !lstrcmpA(server, "chat.facebook.com")) {
m_cbType.SetCurSel(ACC_FBOOK);
m_canregister = false;
}
- else if ( !lstrcmpA(server, "vk.com"))
- {
+ else if ( !lstrcmpA(server, "vk.com")) {
m_cbType.SetCurSel(ACC_VK);
m_canregister = false;
}
- else if ( !lstrcmpA(manualServer, "xmpp.odnoklassniki.ru"))
- {
+ else if ( !lstrcmpA(manualServer, "xmpp.odnoklassniki.ru")) {
m_cbType.SetCurSel(ACC_OK);
m_canregister = false;
}
- else if ( !lstrcmpA(server, "S.ms"))
- {
+ else if ( !lstrcmpA(server, "S.ms")) {
m_cbType.SetCurSel(ACC_SMS);
m_canregister = false;
}
@@ -1759,40 +1747,34 @@ protected: m_cbType.SetCurSel(ACC_TLS);
m_txtPort.SetInt(5222);
}
- else
- m_cbType.SetCurSel(ACC_PUBLIC);
- //cbType_OnChange(&m_cbType);
+ else m_cbType.SetCurSel(ACC_PUBLIC);
- if (m_chkManualHost.Enabled())
- {
- if (m_proto->m_options.ManualConnect)
- {
+ if (m_chkManualHost.Enabled()) {
+ if (m_proto->m_options.ManualConnect) {
m_chkManualHost.SetState(BST_CHECKED);
m_txtManualHost.Enable();
m_txtPort.Enable();
- if ( !db_get_ts(NULL, m_proto->m_szModuleName, "ManualHost", &dbv))
- {
+ if ( !m_proto->getTString("ManualHost", &dbv)) {
m_txtManualHost.SetText(dbv.ptszVal);
db_free(&dbv);
}
m_txtPort.SetInt(m_proto->getWord("ManualPort", m_txtPort.GetInt()));
- } else
- {
+ }
+ else {
int defPort = m_txtPort.GetInt();
int port = m_proto->getWord("Port", defPort);
- if (port != defPort)
- {
+ if (port != defPort) {
m_chkManualHost.SetState(BST_CHECKED);
m_txtManualHost.Enable();
m_txtPort.Enable();
m_txtManualHost.SetTextA(server);
m_txtPort.SetInt(port);
- } else
- {
+ }
+ else {
m_chkManualHost.SetState(BST_UNCHECKED);
m_txtManualHost.Disable();
m_txtPort.Disable();
@@ -1814,26 +1796,21 @@ protected: BOOL bUseHostnameAsResource = FALSE;
TCHAR szCompName[MAX_COMPUTERNAME_LENGTH + 1], szResource[MAX_COMPUTERNAME_LENGTH + 1];
DWORD dwCompNameLength = MAX_COMPUTERNAME_LENGTH;
- if (GetComputerName(szCompName, &dwCompNameLength))
- {
+ if (GetComputerName(szCompName, &dwCompNameLength)) {
m_cbResource.GetText(szResource, SIZEOF(szResource));
if ( !lstrcmp(szCompName, szResource))
bUseHostnameAsResource = TRUE;
}
m_proto->m_options.HostNameAsResource = bUseHostnameAsResource;
- if (m_chkSavePassword.GetState() == BST_CHECKED)
- {
+ if (m_chkSavePassword.GetState() == BST_CHECKED) {
TCHAR *text = m_txtPassword.GetText();
m_proto->JSetStringCrypt(NULL, "LoginPassword", text);
mir_free(text);
- } else
- {
- m_proto->JDeleteSetting(NULL, "LoginPassword");
}
+ else m_proto->delSetting("LoginPassword");
- switch (m_cbType.GetItemData(m_cbType.GetCurSel()))
- {
+ switch (m_cbType.GetItemData(m_cbType.GetCurSel())) {
case ACC_FBOOK:
case ACC_OK:
m_proto->m_options.IgnoreRosterGroups = TRUE;
@@ -1847,13 +1824,11 @@ protected: m_proto->setWord("Priority", 24);
{
int port = m_txtPort.GetInt();
- if (port == 443 || port == 5223)
- {
+ if (port == 443 || port == 5223) {
m_proto->m_options.UseSSL = TRUE;
m_proto->m_options.UseTLS = FALSE;
}
- else if (port == 5222)
- {
+ else if (port == 5222) {
m_proto->m_options.UseSSL = FALSE;
m_proto->m_options.UseTLS = TRUE;
}
@@ -1879,24 +1854,22 @@ protected: m_cbServer.GetTextA(server, SIZEOF(server));
m_txtManualHost.GetTextA(manualServer, SIZEOF(manualServer));
- if ((m_chkManualHost.GetState() == BST_CHECKED) && lstrcmpA(server, manualServer))
- {
+ if ((m_chkManualHost.GetState() == BST_CHECKED) && lstrcmpA(server, manualServer)) {
m_proto->m_options.ManualConnect = TRUE;
m_proto->setString("ManualHost", manualServer);
m_proto->setWord("ManualPort", m_txtPort.GetInt());
m_proto->setWord("Port", m_txtPort.GetInt());
- } else
- {
+ }
+ else {
m_proto->m_options.ManualConnect = FALSE;
- m_proto->JDeleteSetting(NULL, "ManualHost");
- m_proto->JDeleteSetting(NULL, "ManualPort");
+ m_proto->delSetting("ManualHost");
+ m_proto->delSetting("ManualPort");
m_proto->setWord("Port", m_txtPort.GetInt());
}
sttStoreJidFromUI(m_proto, m_txtUsername, m_cbServer);
- if (m_proto->m_bJabberOnline)
- {
+ if (m_proto->m_bJabberOnline) {
if (m_cbType.IsChanged() || m_txtPassword.IsChanged() || m_cbResource.IsChanged() ||
m_cbServer.IsChanged() || m_txtPort.IsChanged() || m_txtManualHost.IsChanged())
{
@@ -1936,8 +1909,7 @@ private: return;
m_txtPassword.GetText(pass, SIZEOF(pass));
- if (lstrcmp(buf, pass))
- {
+ if (lstrcmp(buf, pass)) {
MessageBox(m_hwnd, TranslateT("Passwords do not match."), _T("Miranda NG"), MB_ICONSTOP|MB_OK);
return;
}
diff --git a/protocols/JabberG/src/jabber_privacy.cpp b/protocols/JabberG/src/jabber_privacy.cpp index 3dca46515f..69a816a2fd 100644 --- a/protocols/JabberG/src/jabber_privacy.cpp +++ b/protocols/JabberG/src/jabber_privacy.cpp @@ -852,7 +852,7 @@ void CJabberDlgPrivacyLists::OnInitDialog() CListFilter(GetDlgItem(m_hwnd, IDC_CLIST));
CListApplyList(GetDlgItem(m_hwnd, IDC_CLIST));
- if ( db_get_b(NULL, m_proto->m_szModuleName, "plistsWnd_simpleMode", 1)) {
+ if ( m_proto->getByte("plistsWnd_simpleMode", 1)) {
UIShowControls(m_hwnd, idSimpleControls, SW_SHOW);
UIShowControls(m_hwnd, idAdvancedControls, SW_HIDE);
CheckDlgButton(m_hwnd, IDC_BTN_SIMPLE, TRUE);
@@ -892,7 +892,7 @@ void CJabberDlgPrivacyLists::OnDestroy() // Delete custom bold font
DeleteObject((HFONT)SendDlgItemMessage(m_hwnd, IDC_TXT_LISTS, WM_GETFONT, 0, 0));
- db_set_b(NULL, m_proto->m_szModuleName, "plistsWnd_simpleMode", IsDlgButtonChecked(m_hwnd, IDC_BTN_SIMPLE));
+ m_proto->setByte("plistsWnd_simpleMode", IsDlgButtonChecked(m_hwnd, IDC_BTN_SIMPLE));
Utils_SaveWindowPosition(m_hwnd, NULL, m_proto->m_szModuleName, "plistsWnd_sz");
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index 04241de40e..f6b5e699be 100644 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -179,19 +179,19 @@ CJabberProto::CJabberProto(const char* aProtoName, const TCHAR *aUserName) : db_set_resident(m_szModuleName, "Grant");
DBVARIANT dbv;
- if ( !getTString(NULL, "XmlLang", &dbv)) {
+ if ( !getTString("XmlLang", &dbv)) {
m_tszSelectedLang = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
}
else m_tszSelectedLang = mir_tstrdup(_T("en"));
- if ( !db_get_s(NULL, m_szModuleName, "Password", &dbv)) {
+ if ( !getString("Password", &dbv)) {
CallService(MS_DB_CRYPT_DECODESTRING, lstrlenA(dbv.pszVal) + 1, (LPARAM)dbv.pszVal);
TCHAR *pssw = mir_a2t(dbv.pszVal);
JSetStringCrypt(NULL, "LoginPassword", pssw);
mir_free(pssw);
db_free(&dbv);
- JDeleteSetting(NULL, "Password");
+ delSetting("Password");
}
CleanLastResourceMap();
diff --git a/protocols/JabberG/src/jabber_proto.h b/protocols/JabberG/src/jabber_proto.h index ab737b4656..dbd9c13a20 100644 --- a/protocols/JabberG/src/jabber_proto.h +++ b/protocols/JabberG/src/jabber_proto.h @@ -782,8 +782,6 @@ struct CJabberProto : public PROTO<CJabberProto> void SearchAddToRecent(const TCHAR *szAddr, HWND hwndDialog = NULL);
//---- jabber_std.cpp ----------------------------------------------
-
- void JDeleteSetting(HANDLE hContact, const char* valueName);
void JLoginFailed(int errorCode);
TCHAR* JGetStringCrypt(HANDLE hContact, char* valueName);
diff --git a/protocols/JabberG/src/jabber_search.cpp b/protocols/JabberG/src/jabber_search.cpp index 12987053ef..d4843336d1 100644 --- a/protocols/JabberG/src/jabber_search.cpp +++ b/protocols/JabberG/src/jabber_search.cpp @@ -486,12 +486,12 @@ void CJabberProto::SearchDeleteFromRecent(const TCHAR *szAddr, BOOL deleteLastFr //search in recent
for (int i=0; i<10; i++) {
sprintf(key,"RecentlySearched_%d",i);
- if ( !getTString(NULL, key, &dbv)) {
+ if ( !getTString(key, &dbv)) {
if ( !_tcsicmp(szAddr, dbv.ptszVal)) {
db_free(&dbv);
for (int j=i; j<10; j++) {
sprintf(key, "RecentlySearched_%d", j+1);
- if ( !getTString(NULL, key, &dbv)) {
+ if ( !getTString(key, &dbv)) {
sprintf(key,"RecentlySearched_%d",j);
setTString(NULL,key,dbv.ptszVal);
db_free(&dbv);
@@ -499,7 +499,7 @@ void CJabberProto::SearchDeleteFromRecent(const TCHAR *szAddr, BOOL deleteLastFr else {
if (deleteLastFromDB) {
sprintf(key,"RecentlySearched_%d",j);
- JDeleteSetting(NULL,key);
+ delSetting(NULL,key);
}
break;
} }
@@ -515,14 +515,14 @@ void CJabberProto::SearchAddToRecent(const TCHAR *szAddr, HWND hwndDialog) SearchDeleteFromRecent(szAddr);
for (int j=9; j > 0; j--) {
sprintf(key, "RecentlySearched_%d", j-1);
- if ( !getTString(NULL, key, &dbv)) {
+ if ( !getTString(key, &dbv)) {
sprintf(key,"RecentlySearched_%d",j);
setTString(NULL,key,dbv.ptszVal);
db_free(&dbv);
} }
sprintf(key, "RecentlySearched_%d", 0);
- setTString(NULL, key, szAddr);
+ setTString(key, szAddr);
if (hwndDialog)
JabberSearchAddUrlToRecentCombo(hwndDialog, szAddr);
}
@@ -556,7 +556,7 @@ static INT_PTR CALLBACK JabberSearchAdvancedDlgProc(HWND hwndDlg, UINT msg, WPAR char key[30];
for (i=0; i < 10; i++) {
sprintf(key,"RecentlySearched_%d",i);
- if ( !dat->ppro->getTString(NULL, key, &dbv)) {
+ if ( !dat->ppro->getTString(key, &dbv)) {
JabberSearchAddUrlToRecentCombo(hwndDlg, dbv.ptszVal);
db_free(&dbv);
} }
diff --git a/protocols/JabberG/src/jabber_std.cpp b/protocols/JabberG/src/jabber_std.cpp index ad01670e03..daf1078a8f 100644 --- a/protocols/JabberG/src/jabber_std.cpp +++ b/protocols/JabberG/src/jabber_std.cpp @@ -25,11 +25,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /////////////////////////////////////////////////////////////////////////////////////////
-void CJabberProto::JDeleteSetting(HANDLE hContact, const char* valueName)
-{
- db_unset(hContact, m_szModuleName, valueName);
-}
-
void CJabberProto::JLoginFailed(int errorCode)
{
*m_savedPassword = 0;
diff --git a/protocols/JabberG/src/jabber_svc.cpp b/protocols/JabberG/src/jabber_svc.cpp index 4a321f38a0..d68296ca32 100644 --- a/protocols/JabberG/src/jabber_svc.cpp +++ b/protocols/JabberG/src/jabber_svc.cpp @@ -293,8 +293,8 @@ INT_PTR __cdecl CJabberProto::JabberSetAvatar(WPARAM, LPARAM lParam) GetAvatarFileName(NULL, tFileName, MAX_PATH);
DeleteFile(tFileName);
- JDeleteSetting(NULL, "AvatarSaved");
- JDeleteSetting(NULL, "AvatarHash");
+ delSetting("AvatarSaved");
+ delSetting("AvatarHash");
}
else {
int fileIn = _topen(tszFileName, O_RDWR | O_BINARY, S_IREAD | S_IWRITE);
@@ -351,7 +351,7 @@ INT_PTR __cdecl CJabberProto::JabberSetNickname(WPARAM wParam, LPARAM lParam) {
TCHAR *nickname = (wParam & SMNN_UNICODE) ? mir_u2t((WCHAR *) lParam) : mir_a2t((char *) lParam);
- setTString(NULL, "Nick", nickname);
+ setTString("Nick", nickname);
SetServerVcard(FALSE, _T(""));
return 0;
}
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index 6168589863..8b167609bb 100644 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -79,7 +79,7 @@ static INT_PTR CALLBACK JabberPasswordDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa mir_sntprintf(text, SIZEOF(text), _T("%s %s"), TranslateT("Enter password for"), (TCHAR*)param->ptszJid);
SetDlgItemText(hwndDlg, IDC_JID, text);
- int bSavePassword = param->pro->getByte(NULL, "SaveSessionPassword", 0);
+ int bSavePassword = param->pro->getByte("SaveSessionPassword", 0);
CheckDlgButton(hwndDlg, IDC_SAVEPASSWORD, (bSavePassword) ? BST_CHECKED : BST_UNCHECKED);
}
return TRUE;
@@ -91,12 +91,12 @@ static INT_PTR CALLBACK JabberPasswordDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa break;
case IDOK:
param->saveOnlinePassword = IsDlgButtonChecked(hwndDlg, IDC_SAVEPASSWORD);
- param->pro->setByte(NULL, "SaveSessionPassword", param->saveOnlinePassword);
+ param->pro->setByte("SaveSessionPassword", param->saveOnlinePassword);
GetDlgItemText(hwndDlg, IDC_PASSWORD, param->onlinePassword, SIZEOF(param->onlinePassword));
{
BOOL savePassword = IsDlgButtonChecked(hwndDlg, IDC_SAVE_PERM);
- param->pro->setByte(NULL, "SavePassword", savePassword);
+ param->pro->setByte("SavePassword", savePassword);
if (savePassword) {
param->pro->JSetStringCrypt(NULL,"LoginPassword",param->onlinePassword);
param->saveOnlinePassword = TRUE;
@@ -259,7 +259,7 @@ void CJabberProto::ServerThread(ThreadData* info) info->auth = NULL;
if (m_options.ManualConnect == TRUE) {
- if ( !db_get_s(NULL, m_szModuleName, "ManualHost", &dbv)) {
+ if ( !getString("ManualHost", &dbv)) {
strncpy(info->manualHost, dbv.pszVal, SIZEOF(info->manualHost));
info->manualHost[SIZEOF(info->manualHost)-1] = '\0';
db_free(&dbv);
@@ -291,7 +291,7 @@ LBL_Exit: if (m_szStreamId) mir_free(m_szStreamId);
m_szStreamId = NULL;
- if ( !getTString(NULL, "LoginName", &dbv)) {
+ if ( !getTString("LoginName", &dbv)) {
_tcsncpy(info->username, dbv.ptszVal, SIZEOF(info->username)-1);
db_free(&dbv);
}
@@ -299,7 +299,7 @@ LBL_Exit: if (*rtrimt(info->username) == '\0') {
DWORD dwSize = SIZEOF(info->username);
if (GetUserName(info->username, &dwSize))
- setTString(NULL, "LoginName", info->username);
+ setTString("LoginName", info->username);
else
info->username[0] = 0;
}
@@ -315,7 +315,7 @@ LBL_FatalError: goto LBL_Exit;
}
- if ( !db_get_s(NULL, m_szModuleName, "LoginServer", &dbv)) {
+ if ( !getString("LoginServer", &dbv)) {
strncpy(info->server, dbv.pszVal, SIZEOF(info->server)-1);
db_free(&dbv);
}
@@ -326,7 +326,7 @@ LBL_FatalError: }
if (m_options.HostNameAsResource == FALSE) {
- if ( !getTString(NULL, "Resource", &dbv)) {
+ if ( !getTString("Resource", &dbv)) {
_tcsncpy(info->resource, dbv.ptszVal, SIZEOF(info->resource) - 1);
db_free(&dbv);
}
@@ -461,7 +461,7 @@ LBL_FatalError: m_szJabberJID = (TCHAR*)mir_alloc(sizeof(TCHAR)*(len+1));
mir_sntprintf(m_szJabberJID, len+1, _T("%s@%S"), info->username, info->server);
m_bSendKeepAlive = m_options.KeepAlive != 0;
- setTString(NULL, "jid", m_szJabberJID); // store jid in database
+ setTString("jid", m_szJabberJID); // store jid in database
}
xmlStreamInitializeNow(info);
@@ -913,8 +913,8 @@ void CJabberProto::OnProcessSuccess(HXML node, ThreadData* info) }
Log("Success: Logged-in.");
- if ( db_get_s(NULL, m_szModuleName, "Nick", &dbv))
- setTString(NULL, "Nick", info->username);
+ if ( getString("Nick", &dbv))
+ setTString("Nick", info->username);
else
db_free(&dbv);
xmlStreamInitialize("after successful sasl");
@@ -1575,7 +1575,7 @@ void CJabberProto::UpdateJidDbSettings(const TCHAR *jid) db_unset(hContact, "CList", "StatusMsg");
UpdateMirVer(hContact, &item->resource[nSelectedResource]);
}
- else JDeleteSetting(hContact, DBSETTING_DISPLAY_UID);
+ else delSetting(hContact, DBSETTING_DISPLAY_UID);
if (_tcschr(jid, '@') != NULL || m_options.ShowTransport == TRUE)
if (getWord(hContact, "Status", ID_STATUS_OFFLINE) != status)
@@ -1583,9 +1583,9 @@ void CJabberProto::UpdateJidDbSettings(const TCHAR *jid) if (status == ID_STATUS_OFFLINE)
{ // remove x-status icon
- JDeleteSetting(hContact, DBSETTING_XSTATUSID);
- JDeleteSetting(hContact, DBSETTING_XSTATUSNAME);
- JDeleteSetting(hContact, DBSETTING_XSTATUSMSG);
+ delSetting(hContact, DBSETTING_XSTATUSID);
+ delSetting(hContact, DBSETTING_XSTATUSNAME);
+ delSetting(hContact, DBSETTING_XSTATUSMSG);
//JabberUpdateContactExtraIcon(hContact);
}
@@ -1678,7 +1678,7 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData* info) for (int i = 1; (xNode=xmlGetNthChild(node, _T("x"), i)) != NULL; i++) {
if ( !lstrcmp(xmlGetAttrValue(xNode, _T("xmlns")), _T("jabber:x:avatar"))) {
if ((xNode = xmlGetChild(xNode , "hash")) != NULL && xmlGetText(xNode) != NULL) {
- JDeleteSetting(hContact,"AvatarXVcard");
+ delSetting(hContact,"AvatarXVcard");
Log("AvatarXVcard deleted");
setTString(hContact, "AvatarHash", xmlGetText(xNode));
hasAvatar = true;
@@ -1718,11 +1718,11 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData* info) } } } }
if ( !hasAvatar && removedAvatar) {
Log("Has no avatar");
- JDeleteSetting(hContact, "AvatarHash");
+ delSetting(hContact, "AvatarHash");
DBVARIANT dbv = {0};
if ( !getTString(hContact, "AvatarSaved", &dbv)) {
db_free(&dbv);
- JDeleteSetting(hContact, "AvatarSaved");
+ delSetting(hContact, "AvatarSaved");
ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, NULL, NULL);
} } }
return;
diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp index 834f515da8..bf438b42b7 100644 --- a/protocols/JabberG/src/jabber_util.cpp +++ b/protocols/JabberG/src/jabber_util.cpp @@ -1179,7 +1179,7 @@ void CJabberProto::ComboLoadRecentStrings(HWND hwndDlg, UINT idcCombo, char *par DBVARIANT dbv;
char setting[MAXMODULELABELLENGTH];
mir_snprintf(setting, sizeof(setting), "%s%d", param, i);
- if ( !getTString(NULL, setting, &dbv)) {
+ if ( !getTString(setting, &dbv)) {
SendDlgItemMessage(hwndDlg, idcCombo, CB_ADDSTRING, 0, (LPARAM)dbv.ptszVal);
db_free(&dbv);
} }
@@ -1199,11 +1199,11 @@ void CJabberProto::ComboAddRecentString(HWND hwndDlg, UINT idcCombo, char *param if ((id = SendDlgItemMessage(hwndDlg, idcCombo, CB_FINDSTRING, (WPARAM)-1, (LPARAM)_T(""))) != CB_ERR)
SendDlgItemMessage(hwndDlg, idcCombo, CB_DELETESTRING, id, 0);
- id = getByte(NULL, param, 0);
+ id = getByte(param, 0);
char setting[MAXMODULELABELLENGTH];
mir_snprintf(setting, sizeof(setting), "%s%d", param, id);
- setTString(NULL, setting, string);
- setByte(NULL, param, (id+1)%recentCount);
+ setTString(setting, string);
+ setByte(param, (id+1)%recentCount);
}
/////////////////////////////////////////////////////////////////////////////////////////
diff --git a/protocols/JabberG/src/jabber_vcard.cpp b/protocols/JabberG/src/jabber_vcard.cpp index be168868ce..28226ada40 100644 --- a/protocols/JabberG/src/jabber_vcard.cpp +++ b/protocols/JabberG/src/jabber_vcard.cpp @@ -51,7 +51,7 @@ static void SetDialogField(CJabberProto* ppro, HWND hwndDlg, int nDlgItem, char* {
DBVARIANT dbv;
- if ( !db_get_ts(NULL, ppro->m_szModuleName, key, &dbv)) {
+ if ( !ppro->getTString(key, &dbv)) {
SetDlgItemText(hwndDlg, nDlgItem, (bTranslate) ? TranslateTS(dbv.ptszVal) : dbv.ptszVal);
db_free(&dbv);
}
@@ -566,11 +566,11 @@ static INT_PTR CALLBACK EditEmailDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, SetWindowText(hwndDlg, TranslateT("Jabber vCard: Edit Email Address"));
wsprintfA(idstr, "e-mail%d", dat->id);
- if ( !db_get_s(NULL, dat->ppro->m_szModuleName, idstr, &dbv)) {
+ if ( !dat->ppro->getString(idstr, &dbv)) {
SetDlgItemTextA(hwndDlg, IDC_EMAIL, dbv.pszVal);
db_free(&dbv);
wsprintfA(idstr, "e-mailFlag%d", lParam);
- nFlag = db_get_w(NULL, dat->ppro->m_szModuleName, idstr, 0);
+ nFlag = dat->ppro->getWord(idstr, 0);
if (nFlag & JABBER_VCEMAIL_HOME) CheckDlgButton(hwndDlg, IDC_HOME, TRUE);
if (nFlag & JABBER_VCEMAIL_WORK) CheckDlgButton(hwndDlg, IDC_WORK, TRUE);
if (nFlag & JABBER_VCEMAIL_INTERNET) CheckDlgButton(hwndDlg, IDC_INTERNET, TRUE);
@@ -590,12 +590,12 @@ static INT_PTR CALLBACK EditEmailDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, if (dat->id < 0) {
for (dat->id=0;;dat->id++) {
mir_snprintf(idstr, SIZEOF(idstr), "e-mail%d", dat->id);
- if ( db_get_s(NULL, dat->ppro->m_szModuleName, idstr, &dbv)) break;
+ if ( dat->ppro->getString(idstr, &dbv)) break;
db_free(&dbv);
} }
GetDlgItemText(hwndDlg, IDC_EMAIL, text, SIZEOF(text));
mir_snprintf(idstr, SIZEOF(idstr), "e-mail%d", dat->id);
- dat->ppro->setTString(NULL, idstr, text);
+ dat->ppro->setTString(idstr, text);
nFlag = 0;
if (IsDlgButtonChecked(hwndDlg, IDC_HOME)) nFlag |= JABBER_VCEMAIL_HOME;
@@ -632,7 +632,7 @@ static INT_PTR CALLBACK EditPhoneDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, SetWindowText(hwndDlg, TranslateT("Jabber vCard: Edit Phone Number"));
wsprintfA(idstr, "Phone%d", dat->id);
- if ( !db_get_s(NULL, dat->ppro->m_szModuleName, idstr, &dbv)) {
+ if ( !dat->ppro->getString(idstr, &dbv)) {
SetDlgItemTextA(hwndDlg, IDC_PHONE, dbv.pszVal);
db_free(&dbv);
wsprintfA(idstr, "PhoneFlag%d", dat->id);
@@ -664,7 +664,7 @@ static INT_PTR CALLBACK EditPhoneDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, if (dat->id < 0) {
for (dat->id=0;;dat->id++) {
wsprintfA(idstr, "Phone%d", dat->id);
- if ( db_get_s(NULL, dat->ppro->m_szModuleName, idstr, &dbv)) break;
+ if ( dat->ppro->getString(idstr, &dbv)) break;
db_free(&dbv);
}
}
@@ -747,7 +747,7 @@ static INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM, LPARAM lP lvi.iItem = 0;
for (i=0;;i++) {
wsprintfA(idstr, "e-mail%d", i);
- if ( db_get_ts(NULL, ppro->m_szModuleName, idstr, &dbv)) break;
+ if ( ppro->getTString(idstr, &dbv)) break;
wsprintf(number, _T("%d"), i+1);
lvi.pszText = number;
lvi.lParam = (LPARAM)i;
@@ -766,7 +766,7 @@ static INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM, LPARAM lP lvi.iItem = 0;
for (i=0;;i++) {
wsprintfA(idstr, "Phone%d", i);
- if ( db_get_ts(NULL, ppro->m_szModuleName, idstr, &dbv)) break;
+ if ( ppro->getTString(idstr, &dbv)) break;
wsprintf(number, _T("%d"), i+1);
lvi.pszText = number;
lvi.lParam = (LPARAM)i;
@@ -873,7 +873,7 @@ static INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM, LPARAM lP WORD nFlag;
wsprintfA(idstr, szIdTemplate, i+1);
- if ( db_get_s(NULL, ppro->m_szModuleName, idstr, &dbv)) break;
+ if (ppro->getString(idstr, &dbv)) break;
wsprintfA(idstr,szIdTemplate,i);
ppro->setString(idstr, dbv.pszVal);
wsprintfA(idstr, szFlagTemplate, i+1);
@@ -883,9 +883,9 @@ static INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM, LPARAM lP ppro->setWord(idstr, nFlag);
}
wsprintfA(idstr, szIdTemplate, i);
- ppro->JDeleteSetting(NULL, idstr);
+ ppro->delSetting(idstr);
wsprintfA(idstr, szFlagTemplate, i);
- ppro->JDeleteSetting(NULL, idstr);
+ ppro->delSetting(idstr);
SendMessage(hwndDlg, M_REMAKELISTS, 0, 0);
ppro->m_vCardUpdates |= (1UL<<iPageId);
SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
@@ -934,44 +934,44 @@ void CJabberProto::SaveVcardToDB(HWND hwndPage, int iPage) switch (iPage) {
case 0:
GetDlgItemText(hwndPage, IDC_FULLNAME, text, SIZEOF(text));
- setTString(NULL, "FullName", text);
+ setTString("FullName", text);
GetDlgItemText(hwndPage, IDC_NICKNAME, text, SIZEOF(text));
- setTString(NULL, "Nick", text);
+ setTString("Nick", text);
GetDlgItemText(hwndPage, IDC_FIRSTNAME, text, SIZEOF(text));
- setTString(NULL, "FirstName", text);
+ setTString("FirstName", text);
GetDlgItemText(hwndPage, IDC_MIDDLE, text, SIZEOF(text));
- setTString(NULL, "MiddleName", text);
+ setTString("MiddleName", text);
GetDlgItemText(hwndPage, IDC_LASTNAME, text, SIZEOF(text));
- setTString(NULL, "LastName", text);
+ setTString("LastName", text);
GetDlgItemText(hwndPage, IDC_BIRTH, text, SIZEOF(text));
- setTString(NULL, "BirthDate", text);
+ setTString("BirthDate", text);
switch(SendMessage(GetDlgItem(hwndPage, IDC_GENDER), CB_GETCURSEL, 0, 0)) {
case 0: setString("GenderString", "Male"); break;
case 1: setString("GenderString", "Female"); break;
default: setString("GenderString", ""); break;
}
GetDlgItemText(hwndPage, IDC_OCCUPATION, text, SIZEOF(text));
- setTString(NULL, "Role", text);
+ setTString("Role", text);
GetDlgItemText(hwndPage, IDC_HOMEPAGE, text, SIZEOF(text));
- setTString(NULL, "Homepage", text);
+ setTString("Homepage", text);
break;
// Page 1: Home
case 1:
GetDlgItemText(hwndPage, IDC_ADDRESS1, text, SIZEOF(text));
- setTString(NULL, "Street", text);
+ setTString("Street", text);
GetDlgItemText(hwndPage, IDC_ADDRESS2, text, SIZEOF(text));
- setTString(NULL, "Street2", text);
+ setTString("Street2", text);
GetDlgItemText(hwndPage, IDC_CITY, text, SIZEOF(text));
- setTString(NULL, "City", text);
+ setTString("City", text);
GetDlgItemText(hwndPage, IDC_STATE, text, SIZEOF(text));
- setTString(NULL, "State", text);
+ setTString("State", text);
GetDlgItemText(hwndPage, IDC_ZIP, text, SIZEOF(text));
- setTString(NULL, "ZIP", text);
+ setTString("ZIP", text);
{
int i = SendMessage(GetDlgItem(hwndPage, IDC_COUNTRY), CB_GETCURSEL, 0, 0);
TCHAR *country = mir_a2t((i) ? g_countries[i+2].szName : g_countries[1].szName);
- setTString(NULL, "Country", country);
+ setTString("Country", country);
mir_free(country);
}
break;
@@ -979,25 +979,25 @@ void CJabberProto::SaveVcardToDB(HWND hwndPage, int iPage) // Page 2: Work
case 2:
GetDlgItemText(hwndPage, IDC_COMPANY, text, SIZEOF(text));
- setTString(NULL, "Company", text);
+ setTString("Company", text);
GetDlgItemText(hwndPage, IDC_DEPARTMENT, text, SIZEOF(text));
- setTString(NULL, "CompanyDepartment", text);
+ setTString("CompanyDepartment", text);
GetDlgItemText(hwndPage, IDC_TITLE, text, SIZEOF(text));
- setTString(NULL, "CompanyPosition", text);
+ setTString("CompanyPosition", text);
GetDlgItemText(hwndPage, IDC_ADDRESS1, text, SIZEOF(text));
- setTString(NULL, "CompanyStreet", text);
+ setTString("CompanyStreet", text);
GetDlgItemText(hwndPage, IDC_ADDRESS2, text, SIZEOF(text));
- setTString(NULL, "CompanyStreet2", text);
+ setTString("CompanyStreet2", text);
GetDlgItemText(hwndPage, IDC_CITY, text, SIZEOF(text));
- setTString(NULL, "CompanyCity", text);
+ setTString("CompanyCity", text);
GetDlgItemText(hwndPage, IDC_STATE, text, SIZEOF(text));
- setTString(NULL, "CompanyState", text);
+ setTString("CompanyState", text);
GetDlgItemText(hwndPage, IDC_ZIP, text, SIZEOF(text));
- setTString(NULL, "CompanyZIP", text);
+ setTString("CompanyZIP", text);
{
int i = SendMessage(GetDlgItem(hwndPage, IDC_COUNTRY), CB_GETCURSEL, 0, 0);
TCHAR *country = mir_a2t((i) ? g_countries[i+2].szName : g_countries[1].szName);
- setTString(NULL, "CompanyCountry", country);
+ setTString("CompanyCountry", country);
mir_free(country);
}
break;
@@ -1008,7 +1008,7 @@ void CJabberProto::SaveVcardToDB(HWND hwndPage, int iPage) // Page 4: Note
case 4:
GetDlgItemText(hwndPage, IDC_DESC, text, SIZEOF(text));
- setTString(NULL, "About", text);
+ setTString("About", text);
break;
// Page 5: Contacts
@@ -1021,7 +1021,7 @@ void CJabberProto::AppendVcardFromDB(HXML n, char* tag, char* key) return;
DBVARIANT dbv;
- if ( db_get_ts(NULL, m_szModuleName, key, &dbv))
+ if ( getTString(key, &dbv))
n << XCHILD(_A2T(tag));
else {
n << XCHILD(_A2T(tag), dbv.ptszVal);
@@ -1058,7 +1058,7 @@ void CJabberProto::SetServerVcard(BOOL bPhotoChanged, TCHAR* szPhotoFileName) for (i=0;;i++) {
wsprintfA(idstr, "e-mail%d", i);
- if ( db_get_ts(NULL, m_szModuleName, idstr, &dbv))
+ if ( getTString(idstr, &dbv))
break;
HXML e = v << XCHILD(_T("EMAIL"), dbv.ptszVal);
@@ -1066,7 +1066,7 @@ void CJabberProto::SetServerVcard(BOOL bPhotoChanged, TCHAR* szPhotoFileName) AppendVcardFromDB(e, "USERID", idstr);
wsprintfA(idstr, "e-mailFlag%d", i);
- nFlag = db_get_w(NULL, m_szModuleName, idstr, 0);
+ nFlag = getWord(idstr, 0);
if (nFlag & JABBER_VCEMAIL_HOME) e << XCHILD(_T("HOME"));
if (nFlag & JABBER_VCEMAIL_WORK) e << XCHILD(_T("WORK"));
if (nFlag & JABBER_VCEMAIL_INTERNET) e << XCHILD(_T("INTERNET"));
@@ -1106,7 +1106,7 @@ void CJabberProto::SetServerVcard(BOOL bPhotoChanged, TCHAR* szPhotoFileName) for (i=0;;i++) {
wsprintfA(idstr, "Phone%d", i);
- if ( db_get_ts(NULL, m_szModuleName, idstr, &dbv)) break;
+ if ( getTString(idstr, &dbv)) break;
db_free(&dbv);
n = v << XCHILD(_T("TEL"));
@@ -1140,8 +1140,8 @@ void CJabberProto::SetServerVcard(BOOL bPhotoChanged, TCHAR* szPhotoFileName) if (szFileName == NULL || szFileName[0] == 0) {
v << XCHILD(_T("PHOTO"));
DeleteFile(szAvatarName);
- JDeleteSetting(NULL, "AvatarSaved");
- JDeleteSetting(NULL, "AvatarHash");
+ delSetting("AvatarSaved");
+ delSetting("AvatarHash");
}
else {
HANDLE hFile;
diff --git a/protocols/JabberG/src/jabber_xstatus.cpp b/protocols/JabberG/src/jabber_xstatus.cpp index 922030b6dd..1d39fe75c4 100644 --- a/protocols/JabberG/src/jabber_xstatus.cpp +++ b/protocols/JabberG/src/jabber_xstatus.cpp @@ -285,7 +285,7 @@ void CJabberDlgPepSimple::cbModes_OnChange(CCtrlData *) if ((m_prevSelected >= 0) && (m_modes[m_cbModes.GetItemData(m_prevSelected)].m_id >= 0)) {
TCHAR *txt = m_txtDescription.GetText();
mir_snprintf(szSetting, SIZEOF(szSetting), "PepMsg_%s", m_modes[m_cbModes.GetItemData(m_prevSelected)].m_name);
- m_proto->setTString(NULL, szSetting, txt);
+ m_proto->setTString(szSetting, txt);
mir_free(txt);
}
@@ -294,7 +294,7 @@ void CJabberDlgPepSimple::cbModes_OnChange(CCtrlData *) mir_snprintf(szSetting, SIZEOF(szSetting), "PepMsg_%s", m_modes[m_cbModes.GetItemData(m_prevSelected)].m_name);
DBVARIANT dbv;
- if ( !m_proto->getTString(NULL, szSetting, &dbv)) {
+ if ( !m_proto->getTString(szSetting, &dbv)) {
m_txtDescription.SetText(dbv.ptszVal);
db_free(&dbv);
}
@@ -731,14 +731,14 @@ void CPepMood::SetMood(HANDLE hContact, const TCHAR *szMood, const TCHAR *szText if (szText)
m_proto->setTString(hContact, DBSETTING_XSTATUSMSG, szText);
else
- m_proto->JDeleteSetting(hContact, DBSETTING_XSTATUSMSG);
+ m_proto->delSetting(hContact, DBSETTING_XSTATUSMSG);
m_proto->WriteAdvStatus(hContact, ADVSTATUS_MOOD, szMood, g_MoodIcons.GetIcolibName(g_arrMoods[mood].szTag), TranslateTS(g_arrMoods[mood].szName), szText);
}
else {
- m_proto->JDeleteSetting(hContact, DBSETTING_XSTATUSID);
- m_proto->JDeleteSetting(hContact, DBSETTING_XSTATUSNAME);
- m_proto->JDeleteSetting(hContact, DBSETTING_XSTATUSMSG);
+ m_proto->delSetting(hContact, DBSETTING_XSTATUSID);
+ m_proto->delSetting(hContact, DBSETTING_XSTATUSNAME);
+ m_proto->delSetting(hContact, DBSETTING_XSTATUSMSG);
m_proto->ResetAdvStatus(hContact, ADVSTATUS_MOOD);
}
@@ -1211,7 +1211,7 @@ BOOL CJabberProto::SendPepTune(TCHAR* szArtist, TCHAR* szLength, TCHAR* szSource void CJabberProto::SetContactTune(HANDLE hContact, LPCTSTR szArtist, LPCTSTR szLength, LPCTSTR szSource, LPCTSTR szTitle, LPCTSTR szTrack)
{
if ( !szArtist && !szTitle) {
- JDeleteSetting(hContact, "ListeningTo");
+ delSetting(hContact, "ListeningTo");
ResetAdvStatus(hContact, ADVSTATUS_TUNE);
return;
}
@@ -1269,7 +1269,7 @@ INT_PTR __cdecl CJabberProto::OnSetListeningTo(WPARAM, LPARAM lParam) LISTENINGTOINFO *cm = (LISTENINGTOINFO *)lParam;
if ( !cm || cm->cbSize != sizeof(LISTENINGTOINFO)) {
SendPepTune(NULL, NULL, NULL, NULL, NULL, NULL);
- JDeleteSetting(NULL, "ListeningTo");
+ delSetting("ListeningTo");
}
else {
TCHAR *szArtist = NULL, *szLength = NULL, *szSource = NULL;
|