summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src
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/JabberG/src
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/JabberG/src')
-rw-r--r--protocols/JabberG/src/jabber_adhoc.cpp2
-rw-r--r--protocols/JabberG/src/jabber_archive.cpp6
-rw-r--r--protocols/JabberG/src/jabber_bookmarks.cpp12
-rw-r--r--protocols/JabberG/src/jabber_chat.cpp12
-rw-r--r--protocols/JabberG/src/jabber_console.cpp4
-rw-r--r--protocols/JabberG/src/jabber_disco.cpp32
-rw-r--r--protocols/JabberG/src/jabber_events.cpp12
-rw-r--r--protocols/JabberG/src/jabber_groupchat.cpp34
-rw-r--r--protocols/JabberG/src/jabber_icolib.cpp14
-rw-r--r--protocols/JabberG/src/jabber_iq_handlers.cpp6
-rw-r--r--protocols/JabberG/src/jabber_iqid.cpp114
-rw-r--r--protocols/JabberG/src/jabber_menu.cpp60
-rw-r--r--protocols/JabberG/src/jabber_misc.cpp58
-rw-r--r--protocols/JabberG/src/jabber_notes.cpp2
-rw-r--r--protocols/JabberG/src/jabber_opt.cpp28
-rw-r--r--protocols/JabberG/src/jabber_privacy.cpp6
-rw-r--r--protocols/JabberG/src/jabber_proto.cpp36
-rw-r--r--protocols/JabberG/src/jabber_proto.h9
-rw-r--r--protocols/JabberG/src/jabber_rc.cpp8
-rw-r--r--protocols/JabberG/src/jabber_search.cpp14
-rw-r--r--protocols/JabberG/src/jabber_std.cpp59
-rw-r--r--protocols/JabberG/src/jabber_svc.cpp14
-rw-r--r--protocols/JabberG/src/jabber_thread.cpp38
-rw-r--r--protocols/JabberG/src/jabber_userinfo.cpp8
-rw-r--r--protocols/JabberG/src/jabber_util.cpp32
-rw-r--r--protocols/JabberG/src/jabber_vcard.cpp76
-rw-r--r--protocols/JabberG/src/jabber_xstatus.cpp12
27 files changed, 324 insertions, 384 deletions
diff --git a/protocols/JabberG/src/jabber_adhoc.cpp b/protocols/JabberG/src/jabber_adhoc.cpp
index 9e84e281e4..a4a1a98883 100644
--- a/protocols/JabberG/src/jabber_adhoc.cpp
+++ b/protocols/JabberG/src/jabber_adhoc.cpp
@@ -549,7 +549,7 @@ int __cdecl CJabberProto::ContactMenuRunCommands(WPARAM wParam, LPARAM lParam)
JABBER_LIST_ITEM * item=NULL;
if (((hContact=(HANDLE)wParam)!=NULL || (lParam!=0)) && m_bJabberOnline) {
- if (wParam && !JGetStringT(hContact, "jid", &dbv)) {
+ if (wParam && !getTString(hContact, "jid", &dbv)) {
TCHAR jid[ JABBER_MAX_JID_LEN ];
int selected = 0;
_tcsncpy(jid, dbv.ptszVal, SIZEOF(jid));
diff --git a/protocols/JabberG/src/jabber_archive.cpp b/protocols/JabberG/src/jabber_archive.cpp
index 5e6f742547..af44cfad07 100644
--- a/protocols/JabberG/src/jabber_archive.cpp
+++ b/protocols/JabberG/src/jabber_archive.cpp
@@ -42,7 +42,7 @@ void CJabberProto::RetrieveMessageArchive(HANDLE hContact, JABBER_LIST_ITEM *pIt
XmlNodeIq iq(_T("get"), iqId);
HXML list = iq << XCHILDNS( _T("list"), _T(JABBER_FEAT_ARCHIVE)) << XATTR(_T("with"), pItem->jid);
- time_t tmLast = JGetDword(hContact, "LastCollection", 0);
+ time_t tmLast = getDword(hContact, "LastCollection", 0);
if (tmLast) {
TCHAR buf[40];
list << XATTR(_T("start"), time2str(tmLast, buf, SIZEOF(buf)));
@@ -79,7 +79,7 @@ void CJabberProto::OnIqResultGetCollectionList(HXML iqNode)
if ((hContact = HContactFromJID(with)) == NULL)
continue;
- tmLast = JGetDword(hContact, "LastCollection", 0);
+ tmLast = getDword(hContact, "LastCollection", 0);
}
int iqId = SerialNext();
@@ -91,7 +91,7 @@ void CJabberProto::OnIqResultGetCollectionList(HXML iqNode)
time_t tmThis = str2time(start);
if ( tmThis > tmLast) {
tmLast = tmThis;
- JSetDword(hContact, "LastCollection", tmLast+1);
+ setDword(hContact, "LastCollection", tmLast+1);
}
}
}
diff --git a/protocols/JabberG/src/jabber_bookmarks.cpp b/protocols/JabberG/src/jabber_bookmarks.cpp
index 9441426bf8..f2ceae6965 100644
--- a/protocols/JabberG/src/jabber_bookmarks.cpp
+++ b/protocols/JabberG/src/jabber_bookmarks.cpp
@@ -293,9 +293,9 @@ void CJabberDlgBookmarks::OnInitDialog()
ImageList_AddIcon_Icolib(hIml, m_proto->LoadIconEx("group"));
ImageList_AddIcon_Icolib(hIml, LoadSkinnedIcon(SKINICON_EVENT_URL));
- m_lvBookmarks.AddColumn(0, TranslateT("Bookmark Name"), m_proto->JGetWord(NULL, "bookmarksWnd_cx0", 120));
- m_lvBookmarks.AddColumn(1, TranslateT("Address (JID or URL)"), m_proto->JGetWord(NULL, "bookmarksWnd_cx1", 210));
- m_lvBookmarks.AddColumn(2, TranslateT("Nickname"), m_proto->JGetWord(NULL, "bookmarksWnd_cx2", 90));
+ m_lvBookmarks.AddColumn(0, TranslateT("Bookmark Name"), m_proto->getWord("bookmarksWnd_cx0", 120));
+ m_lvBookmarks.AddColumn(1, TranslateT("Address (JID or URL)"), m_proto->getWord("bookmarksWnd_cx1", 210));
+ m_lvBookmarks.AddColumn(2, TranslateT("Nickname"), m_proto->getWord("bookmarksWnd_cx2", 90));
m_lvBookmarks.EnableGroupView(TRUE);
m_lvBookmarks.AddGroup(0, TranslateT("Conferences"));
@@ -309,11 +309,11 @@ void CJabberDlgBookmarks::OnClose()
LVCOLUMN lvc = {0};
lvc.mask = LVCF_WIDTH;
m_lvBookmarks.GetColumn(0, &lvc);
- m_proto->JSetWord(NULL, "bookmarksWnd_cx0", lvc.cx);
+ m_proto->setWord("bookmarksWnd_cx0", lvc.cx);
m_lvBookmarks.GetColumn(1, &lvc);
- m_proto->JSetWord(NULL, "bookmarksWnd_cx1", lvc.cx);
+ m_proto->setWord("bookmarksWnd_cx1", lvc.cx);
m_lvBookmarks.GetColumn(2, &lvc);
- m_proto->JSetWord(NULL, "bookmarksWnd_cx2", lvc.cx);
+ m_proto->setWord("bookmarksWnd_cx2", lvc.cx);
Utils_SaveWindowPosition(m_hwnd, NULL, m_proto->m_szModuleName, "bookmarksWnd_");
diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp
index 450e34bb5c..e725096391 100644
--- a/protocols/JabberG/src/jabber_chat.cpp
+++ b/protocols/JabberG/src/jabber_chat.cpp
@@ -151,14 +151,14 @@ int CJabberProto::GcInit(JABBER_LIST_ITEM* item)
db_set_ts(hContact, "CList", "MyHandle", bookmark->name);
}
- if ( !JGetStringT(hContact, "MyNick", &dbv)) {
+ if ( !getTString(hContact, "MyNick", &dbv)) {
if ( !lstrcmp(dbv.ptszVal, szNick))
JDeleteSetting(hContact, "MyNick");
else
- JSetStringT(hContact, "MyNick", item->nick);
+ setTString(hContact, "MyNick", item->nick);
db_free(&dbv);
}
- else JSetStringT(hContact, "MyNick", item->nick);
+ else setTString(hContact, "MyNick", item->nick);
TCHAR *passw = JGetStringCrypt(hContact, "LoginPassword");
if (lstrcmp_null(passw, item->password)) {
@@ -820,7 +820,7 @@ public:
if (int hItem = SendMessage(hwndList, CLM_FINDCONTACT, (WPARAM)hContact, 0)) {
if (SendMessage(hwndList, CLM_GETCHECKMARK, (WPARAM)hItem, 0)) {
DBVARIANT dbv={0};
- m_proto->JGetStringT(hContact, "jid", &dbv);
+ m_proto->getTString(hContact, "jid", &dbv);
if (dbv.ptszVal && (dbv.type == DBVT_ASCIIZ || dbv.type == DBVT_WCHAR))
InviteUser(dbv.ptszVal, text);
db_free(&dbv);
@@ -1477,12 +1477,12 @@ static void sttSendPrivateMessage(CJabberProto* ppro, JABBER_LIST_ITEM* item, co
if (hContact != NULL) {
for (int i=0; i < item->resourceCount; i++) {
if (_tcsicmp(item->resource[i].resourceName, nick) == 0) {
- ppro->JSetWord(hContact, "Status", item->resource[i].status);
+ ppro->setWord(hContact, "Status", item->resource[i].status);
break;
} }
db_set_b(hContact, "CList", "Hidden", 1);
- ppro->JSetStringT(hContact, "Nick", nick);
+ ppro->setTString(hContact, "Nick", nick);
db_set_dw(hContact, "Ignore", "Mask1", 0);
CallService(MS_MSG_SENDMESSAGE, (WPARAM)hContact, 0);
} }
diff --git a/protocols/JabberG/src/jabber_console.cpp b/protocols/JabberG/src/jabber_console.cpp
index 75b650b068..b7dcadb11b 100644
--- a/protocols/JabberG/src/jabber_console.cpp
+++ b/protocols/JabberG/src/jabber_console.cpp
@@ -381,7 +381,7 @@ void CJabberDlgConsole::OnInitDialog()
DBVARIANT dbv;
*m_proto->m_filterInfo.pattern = 0;
- if ( !m_proto->JGetStringT(NULL, "consoleWnd_fpattern", &dbv)) {
+ if ( !m_proto->getTString(NULL, "consoleWnd_fpattern", &dbv)) {
lstrcpyn(m_proto->m_filterInfo.pattern, dbv.ptszVal, SIZEOF(m_proto->m_filterInfo.pattern));
db_free(&dbv);
}
@@ -433,7 +433,7 @@ void CJabberDlgConsole::OnClose()
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->JSetStringT(NULL, "consoleWnd_fpattern", m_proto->m_filterInfo.pattern);
+ m_proto->setTString(NULL, "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 2aff62d257..c45f8172f6 100644
--- a/protocols/JabberG/src/jabber_disco.cpp
+++ b/protocols/JabberG/src/jabber_disco.cpp
@@ -407,7 +407,7 @@ void CJabberProto::PerformBrowse(HWND hwndDlg)
if (_tcschr(item->jid, '@')==NULL && _tcschr(item->jid, '/')==NULL && item->subscription!=SUB_NONE) {
HANDLE hContact = HContactFromJID(item->jid);
if (hContact != NULL)
- JSetByte(hContact, "IsTransport", TRUE);
+ setByte(hContact, "IsTransport", TRUE);
if (m_lstTransports.getIndex(item->jid) == -1)
m_lstTransports.insert(mir_tstrdup(item->jid));
@@ -440,18 +440,18 @@ void CJabberProto::PerformBrowse(HWND hwndDlg)
}
else if ( !lstrcmp(szJid, _T(SD_FAKEJID_FAVORITES))) {
sttBrowseMode = SD_BROWSE_FAVORITES;
- int count = JGetDword(NULL, "discoWnd_favCount", 0);
+ int count = getDword(NULL, "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 ( !JGetStringT(NULL, setting, &dbv)) {
+ if ( !getTString(NULL, setting, &dbv)) {
DBVARIANT dbvJid, dbvNode;
mir_snprintf(setting, sizeof(setting), "discoWnd_favJID_%d", i);
- JGetStringT(NULL, setting, &dbvJid);
+ getTString(NULL, setting, &dbvJid);
mir_snprintf(setting, sizeof(setting), "discoWnd_favNode_%d", i);
- JGetStringT(NULL, setting, &dbvNode);
+ getTString(NULL, setting, &dbvNode);
CJabberSDNode* pNode = m_SDManager.AddPrimaryNode(dbvJid.ptszVal, dbvNode.ptszVal, dbv.ptszVal);
SendBothRequests(pNode, NULL);
db_free(&dbv);
@@ -803,13 +803,13 @@ void CJabberDlgDiscovery::btnGoHome_OnClick(CCtrlButton *)
void CJabberDlgDiscovery::btnBookmarks_OnClick(CCtrlButton *)
{
HMENU hMenu = CreatePopupMenu();
- int count = m_proto->JGetDword(NULL, "discoWnd_favCount", 0);
+ int count = m_proto->getDword(NULL, "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 ( !m_proto->JGetStringT(NULL, setting, &dbv))
+ if ( !m_proto->getTString(NULL, setting, &dbv))
{
HMENU hSubMenu = CreatePopupMenu();
AppendMenu(hSubMenu, MF_STRING, 100+i*10+0, TranslateT("Navigate"));
@@ -861,10 +861,10 @@ void CJabberDlgDiscovery::btnBookmarks_OnClick(CCtrlButton *)
DBVARIANT dbv;
char setting[MAXMODULELABELLENGTH];
mir_snprintf(setting, sizeof(setting), "discoWnd_favJID_%d", res);
- if ( !m_proto->JGetStringT(NULL, setting, &dbv)) SetDlgItemText(m_hwnd, IDC_COMBO_JID, dbv.ptszVal);
+ if ( !m_proto->getTString(NULL, 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->JGetStringT(NULL, setting, &dbv)) SetDlgItemText(m_hwnd, IDC_COMBO_NODE, dbv.ptszVal);
+ if ( !m_proto->getTString(NULL, 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,7 +872,7 @@ void CJabberDlgDiscovery::btnBookmarks_OnClick(CCtrlButton *)
} else
if (res == 1)
{
- int count = m_proto->JGetDword(NULL, "discoWnd_favCount", 0);
+ int count = m_proto->getDword(NULL, "discoWnd_favCount", 0);
for (int i = 0; i < count; i++)
{
char setting[MAXMODULELABELLENGTH];
@@ -1368,14 +1368,14 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM
case SD_ACT_FAVORITE:
{
char setting[MAXMODULELABELLENGTH];
- int count = JGetDword(NULL, "discoWnd_favCount", 0);
+ int count = getDword(NULL, "discoWnd_favCount", 0);
mir_snprintf(setting, sizeof(setting), "discoWnd_favName_%d", count);
- JSetStringT(NULL, setting, pNode->GetName() ? pNode->GetName() : pNode->GetJid());
+ setTString(NULL, setting, pNode->GetName() ? pNode->GetName() : pNode->GetJid());
mir_snprintf(setting, sizeof(setting), "discoWnd_favJID_%d", count);
- JSetStringT(NULL, setting, pNode->GetJid());
+ setTString(NULL, setting, pNode->GetJid());
mir_snprintf(setting, sizeof(setting), "discoWnd_favNode_%d", count);
- JSetStringT(NULL, setting, pNode->GetNode() ? pNode->GetNode() : _T(""));
- JSetDword(NULL, "discoWnd_favCount", ++count);
+ setTString(NULL, setting, pNode->GetNode() ? pNode->GetNode() : _T(""));
+ setDword(NULL, "discoWnd_favCount", ++count);
break;
}
@@ -1394,7 +1394,7 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM
case SD_ACT_PROXY:
m_options.BsDirect = FALSE;
m_options.BsProxyManual = TRUE;
- JSetStringT(NULL, "BsProxyServer", pNode->GetJid());
+ setTString(NULL, "BsProxyServer", pNode->GetJid());
break;
case SD_ACT_JOIN:
diff --git a/protocols/JabberG/src/jabber_events.cpp b/protocols/JabberG/src/jabber_events.cpp
index ab100f2ac4..59ac6e0228 100644
--- a/protocols/JabberG/src/jabber_events.cpp
+++ b/protocols/JabberG/src/jabber_events.cpp
@@ -44,7 +44,7 @@ int CJabberProto::OnContactDeleted(WPARAM wParam, LPARAM)
return 0;
DBVARIANT dbv;
- if ( !JGetStringT((HANDLE)wParam, JGetByte((HANDLE) wParam, "ChatRoom", 0)?(char*)"ChatRoomID":(char*)"jid", &dbv)) {
+ if ( !getTString((HANDLE)wParam, getByte((HANDLE) wParam, "ChatRoom", 0)?(char*)"ChatRoomID":(char*)"jid", &dbv)) {
if (ListExist(LIST_ROSTER, dbv.ptszVal)) {
if ( !_tcschr(dbv.ptszVal, _T('@'))) {
TCHAR szStrippedJid[JABBER_MAX_JID_LEN];
@@ -85,7 +85,7 @@ static TCHAR* sttSettingToTchar(DBCONTACTWRITESETTING* cws)
void __cdecl CJabberProto::OnRenameGroup(DBCONTACTWRITESETTING* cws, HANDLE hContact)
{
DBVARIANT jid, dbv;
- if (JGetStringT(hContact, "jid", &jid))
+ if (getTString(hContact, "jid", &jid))
return;
JABBER_LIST_ITEM* item = ListGetItemPtr(LIST_ROSTER, jid.ptszVal);
@@ -98,7 +98,7 @@ void __cdecl CJabberProto::OnRenameGroup(DBCONTACTWRITESETTING* cws, HANDLE hCon
nick = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
}
- else if ( !JGetStringT(hContact, "Nick", &dbv)) {
+ else if ( !getTString(hContact, "Nick", &dbv)) {
nick = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
}
@@ -127,7 +127,7 @@ void __cdecl CJabberProto::OnRenameGroup(DBCONTACTWRITESETTING* cws, HANDLE hCon
void __cdecl CJabberProto::OnRenameContact(DBCONTACTWRITESETTING* cws, HANDLE hContact)
{
DBVARIANT jid;
- if (JGetStringT(hContact, "jid", &jid))
+ if (getTString(hContact, "jid", &jid))
return;
JABBER_LIST_ITEM* item = ListGetItemPtr(LIST_ROSTER, jid.ptszVal);
@@ -157,7 +157,7 @@ void __cdecl CJabberProto::OnAddContactForever(DBCONTACTWRITESETTING* cws, HANDL
return;
DBVARIANT jid, dbv;
- if (JGetStringT(hContact, "jid", &jid))
+ if (getTString(hContact, "jid", &jid))
return;
TCHAR *nick;
@@ -166,7 +166,7 @@ void __cdecl CJabberProto::OnAddContactForever(DBCONTACTWRITESETTING* cws, HANDL
nick = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
}
- else if ( !JGetStringT(hContact, "Nick", &dbv)) {
+ else if ( !getTString(hContact, "Nick", &dbv)) {
nick = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
}
diff --git a/protocols/JabberG/src/jabber_groupchat.cpp b/protocols/JabberG/src/jabber_groupchat.cpp
index beea8f4e69..f4e5ee0d0c 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->JGetStringT(NULL, setting, &dbv)) {
+ if ( !ppro->getTString(NULL, setting, &dbv)) {
server = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
}
mir_snprintf(setting, sizeof(setting), "rcMuc_%d_room", iRecent);
- if ( !ppro->JGetStringT(NULL, setting, &dbv)) {
+ if ( !ppro->getTString(NULL, setting, &dbv)) {
room = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
}
mir_snprintf(setting, sizeof(setting), "rcMuc_%d_nick", iRecent);
- if ( !ppro->JGetStringT(NULL, setting, &dbv)) {
+ if ( !ppro->getTString(NULL, setting, &dbv)) {
nick = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
}
@@ -163,19 +163,19 @@ struct JabberGcRecentInfo
mir_snprintf(setting, sizeof(setting), "rcMuc_%d_server", iRecent);
if (server)
- ppro->JSetStringT(NULL, setting, server);
+ ppro->setTString(NULL, setting, server);
else
ppro->JDeleteSetting(NULL, setting);
mir_snprintf(setting, sizeof(setting), "rcMuc_%d_room", iRecent);
if (room)
- ppro->JSetStringT(NULL, setting, room);
+ ppro->setTString(NULL, setting, room);
else
ppro->JDeleteSetting(NULL, setting);
mir_snprintf(setting, sizeof(setting), "rcMuc_%d_nick", iRecent);
if (nick)
- ppro->JSetStringT(NULL, setting, nick);
+ ppro->setTString(NULL, setting, nick);
else
ppro->JDeleteSetting(NULL, setting);
@@ -230,18 +230,18 @@ INT_PTR __cdecl CJabberProto::OnJoinChat(WPARAM wParam, LPARAM)
{
DBVARIANT nick, jid;
HANDLE hContact = (HANDLE)wParam;
- if (JGetStringT(hContact, "ChatRoomID", &jid))
+ if (getTString(hContact, "ChatRoomID", &jid))
return 0;
- if (JGetStringT(hContact, "MyNick", &nick))
- if (JGetStringT(NULL, "Nick", &nick)) {
+ if (getTString(hContact, "MyNick", &nick))
+ if (getTString(NULL, "Nick", &nick)) {
db_free(&jid);
return 0;
}
TCHAR *password = JGetStringCrypt(hContact, "LoginPassword");
- if (JGetWord(hContact, "Status", 0) != ID_STATUS_ONLINE) {
+ if (getWord(hContact, "Status", 0) != ID_STATUS_ONLINE) {
if ( !jabberChatDllPresent)
JabberChatDllError();
else {
@@ -261,10 +261,10 @@ INT_PTR __cdecl CJabberProto::OnLeaveChat(WPARAM wParam, LPARAM)
{
DBVARIANT jid;
HANDLE hContact = (HANDLE)wParam;
- if (JGetStringT(hContact, "ChatRoomID", &jid))
+ if (getTString(hContact, "ChatRoomID", &jid))
return 0;
- if (JGetWord(hContact, "Status", 0) != ID_STATUS_OFFLINE) {
+ if (getWord(hContact, "Status", 0) != ID_STATUS_OFFLINE) {
JABBER_LIST_ITEM* item = ListGetItemPtr(LIST_CHATROOM, jid.ptszVal);
if (item != NULL)
GcQuit(item, 0, NULL);
@@ -501,7 +501,7 @@ void CJabberDlgGcJoin::OnInitDialog()
}
DBVARIANT dbv;
- if ( !m_proto->JGetStringT(NULL, "Nick", &dbv)) {
+ if ( !m_proto->getTString(NULL, "Nick", &dbv)) {
SetDlgItemText(m_hwnd, IDC_NICK, dbv.ptszVal);
db_free(&dbv);
}
@@ -891,7 +891,7 @@ void CJabberProto::RenameParticipantNick(JABBER_LIST_ITEM* item, const TCHAR *ol
HANDLE hContact = HContactFromJID(item->jid);
if (hContact != NULL)
- JSetStringT(hContact, "MyNick", newNick);
+ setTString(hContact, "MyNick", newNick);
}
GCDEST gcd = { m_szModuleName, NULL, GC_EVENT_CHUID };
@@ -1056,12 +1056,12 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
// update clist status
HANDLE hContact = HContactFromJID(from);
if (hContact != NULL)
- JSetWord(hContact, "Status", status);
+ setWord(hContact, "Status", status);
// Update room status
//if (item->status != ID_STATUS_ONLINE) {
// item->status = ID_STATUS_ONLINE;
- // JSetWord(hContact, "Status", (WORD)ID_STATUS_ONLINE);
+ // setWord(hContact, "Status", (WORD)ID_STATUS_ONLINE);
// JabberLog("Room %s online", from);
//}
@@ -1122,7 +1122,7 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
HANDLE hContact = HContactFromJID(from);
if (hContact != NULL)
- JSetWord(hContact, "Status", ID_STATUS_OFFLINE);
+ setWord(hContact, "Status", ID_STATUS_OFFLINE);
}
// processing room errors
diff --git a/protocols/JabberG/src/jabber_icolib.cpp b/protocols/JabberG/src/jabber_icolib.cpp
index ed7f03efab..c30a57cfe4 100644
--- a/protocols/JabberG/src/jabber_icolib.cpp
+++ b/protocols/JabberG/src/jabber_icolib.cpp
@@ -396,18 +396,18 @@ INT_PTR __cdecl CJabberProto::JGetAdvancedStatusIcon(WPARAM wParam, LPARAM)
if ( !hContact)
return -1;
- if ( !JGetByte(hContact, "IsTransported", 0))
+ if ( !getByte(hContact, "IsTransported", 0))
return -1;
DBVARIANT dbv;
- if (JGetStringT(hContact, "Transport", &dbv))
+ if (getTString(hContact, "Transport", &dbv))
return -1;
int iID = GetTransportProtoID(dbv.ptszVal);
db_free(&dbv);
if (iID >= 0) {
WORD Status = ID_STATUS_OFFLINE;
- Status = JGetWord(hContact, "Status", ID_STATUS_OFFLINE);
+ Status = getWord(hContact, "Status", ID_STATUS_OFFLINE);
if (Status < ID_STATUS_OFFLINE)
Status = ID_STATUS_OFFLINE;
else if (Status > ID_STATUS_INVISIBLE)
@@ -449,12 +449,12 @@ BOOL CJabberProto::DBCheckIsTransportedContact(const TCHAR *jid, HANDLE hContact
if (m_lstTransports.getIndex(domain) == -1) {
if (isAgent) {
m_lstTransports.insert(mir_tstrdup(domain));
- JSetByte(hContact, "IsTransport", 1);
+ setByte(hContact, "IsTransport", 1);
} }
if (isTransported) {
- JSetStringT(hContact, "Transport", domain);
- JSetByte(hContact, "IsTransported", 1);
+ setTString(hContact, "Transport", domain);
+ setByte(hContact, "IsTransported", 1);
}
return isTransported;
}
@@ -463,7 +463,7 @@ void CJabberProto::CheckAllContactsAreTransported()
{
for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
DBVARIANT dbv;
- if ( !JGetStringT(hContact, "jid", &dbv)) {
+ if ( !getTString(hContact, "jid", &dbv)) {
DBCheckIsTransportedContact(dbv.ptszVal, hContact);
db_free(&dbv);
}
diff --git a/protocols/JabberG/src/jabber_iq_handlers.cpp b/protocols/JabberG/src/jabber_iq_handlers.cpp
index 5868e93f82..cfbb8be86a 100644
--- a/protocols/JabberG/src/jabber_iq_handlers.cpp
+++ b/protocols/JabberG/src/jabber_iq_handlers.cpp
@@ -597,11 +597,11 @@ BOOL CJabberProto::OnRosterPushRequest(HXML, CJabberIqInfo *pInfo)
// Add the jid (with empty resource) to Miranda contact list.
hContact = DBCreateContact(jid, nick, FALSE, FALSE);
}
- else JSetStringT(hContact, "jid", jid);
+ else setTString(hContact, "jid", jid);
if (name != NULL) {
DBVARIANT dbnick;
- if ( !JGetStringT(hContact, "Nick", &dbnick)) {
+ if ( !getTString(hContact, "Nick", &dbnick)) {
if (_tcscmp(nick, dbnick.ptszVal) != 0)
db_set_ts(hContact, "CList", "MyHandle", nick);
else
@@ -640,7 +640,7 @@ BOOL CJabberProto::OnRosterPushRequest(HXML, CJabberIqInfo *pInfo)
SetContactOfflineStatus(hContact);
ListRemove(LIST_ROSTER, jid);
} }
- else if (JGetByte(hContact, "ChatRoom", 0))
+ else if (getByte(hContact, "ChatRoom", 0))
db_unset(hContact, "CList", "Hidden");
else
UpdateSubscriptionInfo(hContact, item);
diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp
index e81d74ea2a..120109c9ad 100644
--- a/protocols/JabberG/src/jabber_iqid.cpp
+++ b/protocols/JabberG/src/jabber_iqid.cpp
@@ -214,7 +214,7 @@ void CJabberProto::OnLoggedIn()
SendGetVcard(m_szJabberJID);
else if (strcmp(m_ThreadInfo->server, szServerName))
SendGetVcard(m_szJabberJID);
- JSetString(NULL, "LastLoggedServer", m_ThreadInfo->server);
+ setString("LastLoggedServer", m_ThreadInfo->server);
m_pepServices.ResetPublishAll();
}
@@ -282,8 +282,8 @@ void CJabberProto::OnIqResultSetAuth(HXML iqNode)
if ( !lstrcmp(type, _T("result"))) {
DBVARIANT dbv;
- if (JGetStringT(NULL, "Nick", &dbv))
- JSetStringT(NULL, "Nick", m_ThreadInfo->username);
+ if (getTString(NULL, "Nick", &dbv))
+ setTString(NULL, "Nick", m_ThreadInfo->username);
else
db_free(&dbv);
@@ -463,7 +463,7 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo* pInfo)
if (name != NULL) {
DBVARIANT dbNick;
- if ( !JGetStringT(hContact, "Nick", &dbNick)) {
+ if ( !getTString(hContact, "Nick", &dbNick)) {
if (lstrcmp(nick, dbNick.ptszVal) != 0)
db_set_ts(hContact, "CList", "MyHandle", nick);
else
@@ -475,7 +475,7 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo* pInfo)
}
else db_unset(hContact, "CList", "MyHandle");
- if (JGetByte(hContact, "ChatRoom", 0)) {
+ if (getByte(hContact, "ChatRoom", 0)) {
GCSESSION gcw = {0};
gcw.cbSize = sizeof(GCSESSION);
gcw.iType = GCW_CHATROOM;
@@ -514,9 +514,9 @@ void CJabberProto::OnIqResultGetRoster(HXML iqNode, CJabberIqInfo* pInfo)
if (hContact != NULL) {
if (bIsTransport)
- JSetByte(hContact, "IsTransport", TRUE);
+ setByte(hContact, "IsTransport", TRUE);
else
- JSetByte(hContact, "IsTransport", FALSE);
+ setByte(hContact, "IsTransport", FALSE);
}
const TCHAR *imagepath = xmlGetAttrValue(itemNode, _T("vz:img"));
@@ -604,7 +604,7 @@ void CJabberProto::OnIqResultSetRegister(HXML iqNode)
if ( !lstrcmp(type, _T("result"))) {
HANDLE hContact = HContactFromJID(from);
if (hContact != NULL)
- JSetByte(hContact, "IsTransport", TRUE);
+ setByte(hContact, "IsTransport", TRUE);
if (m_hwndRegProgress)
SendMessage(m_hwndRegProgress, WM_JABBER_REGDLG_UPDATE, 100, (LPARAM)TranslateT("Registration successful"));
@@ -685,7 +685,7 @@ LBL_Ret:
}
else {
DBVARIANT dbv;
- if ( !JGetStringT(hContact, "jid", &dbv)) {
+ if ( !getTString(hContact, "jid", &dbv)) {
JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, jid);
if (item == NULL) {
item = ListAdd(LIST_VCARD_TEMP, jid); // adding to the temp list to store information about photo
@@ -792,13 +792,13 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode)
if ( !_tcscmp(xmlGetName(n), _T("FN"))) {
if (xmlGetText(n) != NULL) {
hasFn = TRUE;
- JSetStringT(hContact, "FullName", xmlGetText(n));
+ setTString(hContact, "FullName", xmlGetText(n));
}
}
else if ( !lstrcmp(xmlGetName(n), _T("NICKNAME"))) {
if (xmlGetText(n) != NULL) {
hasNick = TRUE;
- JSetStringT(hContact, "Nick", xmlGetText(n));
+ setTString(hContact, "Nick", xmlGetText(n));
}
}
else if ( !lstrcmp(xmlGetName(n), _T("N"))) {
@@ -806,15 +806,15 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode)
if ( !hasGiven && !hasFamily && !hasMiddle) {
if ((m=xmlGetChild(n , "GIVEN")) != NULL && xmlGetText(m)!=NULL) {
hasGiven = TRUE;
- JSetStringT(hContact, "FirstName", xmlGetText(m));
+ setTString(hContact, "FirstName", xmlGetText(m));
}
if ((m=xmlGetChild(n , "FAMILY")) != NULL && xmlGetText(m)!=NULL) {
hasFamily = TRUE;
- JSetStringT(hContact, "LastName", xmlGetText(m));
+ setTString(hContact, "LastName", xmlGetText(m));
}
if ((m=xmlGetChild(n , "MIDDLE")) != NULL && xmlGetText(m) != NULL) {
hasMiddle = TRUE;
- JSetStringT(hContact, "MiddleName", xmlGetText(m));
+ setTString(hContact, "MiddleName", xmlGetText(m));
} }
}
else if ( !lstrcmp(xmlGetName(n), _T("EMAIL"))) {
@@ -830,7 +830,7 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode)
sprintf(text, "e-mail%d", nEmail-1);
}
else sprintf(text, "e-mail%d", nEmail);
- JSetStringT(hContact, text, xmlGetText(m));
+ setTString(hContact, text, xmlGetText(m));
if (hContact == NULL) {
sprintf(text, "e-mailFlag%d", nEmail);
@@ -839,7 +839,7 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode)
if (xmlGetChild(n , "WORK") != NULL) nFlag |= JABBER_VCEMAIL_WORK;
if (xmlGetChild(n , "INTERNET") != NULL) nFlag |= JABBER_VCEMAIL_INTERNET;
if (xmlGetChild(n , "X400") != NULL) nFlag |= JABBER_VCEMAIL_X400;
- JSetWord(NULL, text, nFlag);
+ setWord(text, nFlag);
}
nEmail++;
}
@@ -850,9 +850,9 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode)
if (hContact != NULL) {
if (_stscanf(xmlGetText(n), _T("%d-%d-%d"), &nYear, &nMonth, &nDay) == 3) {
hasBday = TRUE;
- JSetWord(hContact, "BirthYear", (WORD)nYear);
- JSetByte(hContact, "BirthMonth", (BYTE) nMonth);
- JSetByte(hContact, "BirthDay", (BYTE) nDay);
+ setWord(hContact, "BirthYear", (WORD)nYear);
+ setByte(hContact, "BirthMonth", (BYTE) nMonth);
+ setByte(hContact, "BirthDay", (BYTE) nDay);
SYSTEMTIME sToday = {0};
GetLocalTime(&sToday);
@@ -860,12 +860,12 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode)
if (sToday.wMonth < nMonth || (sToday.wMonth == nMonth && sToday.wDay < nDay))
nAge--;
if (nAge)
- JSetWord(hContact, "Age", (WORD)nAge);
+ setWord(hContact, "Age", (WORD)nAge);
}
}
else {
hasBday = TRUE;
- JSetStringT(NULL, "BirthDate", xmlGetText(n));
+ setTString(NULL, "BirthDate", xmlGetText(n));
} }
}
else if ( !lstrcmp(xmlGetName(n), _T("GENDER"))) {
@@ -874,12 +874,12 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode)
if (hContact != NULL) {
if (xmlGetText(n)[0] && strchr("mMfF", xmlGetText(n)[0])!=NULL) {
hasGender = TRUE;
- JSetByte(hContact, "Gender", (BYTE) toupper(xmlGetText(n)[0]));
+ setByte(hContact, "Gender", (BYTE) toupper(xmlGetText(n)[0]));
}
}
else {
hasGender = TRUE;
- JSetStringT(NULL, "GenderString", xmlGetText(n));
+ setTString(NULL, "GenderString", xmlGetText(n));
} }
}
else if ( !lstrcmp(xmlGetName(n), _T("ADR"))) {
@@ -896,34 +896,34 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode)
else
_tcsncpy(text, xmlGetText(m), SIZEOF(text));
text[SIZEOF(text)-1] = '\0';
- JSetStringT(hContact, "Street", text);
+ setTString(hContact, "Street", text);
}
else {
- JSetStringT(hContact, "Street", xmlGetText(m));
+ setTString(hContact, "Street", xmlGetText(m));
if ((m=xmlGetChild(n , "EXTADR")) == NULL)
m = xmlGetChild(n , "EXTADD");
if (m!=NULL && xmlGetText(m)!=NULL) {
hasHomeStreet2 = TRUE;
- JSetStringT(hContact, "Street2", xmlGetText(m));
+ setTString(hContact, "Street2", xmlGetText(m));
} } }
if ((m=xmlGetChild(n , "LOCALITY"))!=NULL && xmlGetText(m)!=NULL) {
hasHomeLocality = TRUE;
- JSetStringT(hContact, "City", xmlGetText(m));
+ setTString(hContact, "City", xmlGetText(m));
}
if ((m=xmlGetChild(n , "REGION"))!=NULL && xmlGetText(m)!=NULL) {
hasHomeRegion = TRUE;
- JSetStringT(hContact, "State", xmlGetText(m));
+ setTString(hContact, "State", xmlGetText(m));
}
if ((m=xmlGetChild(n , "PCODE"))!=NULL && xmlGetText(m)!=NULL) {
hasHomePcode = TRUE;
- JSetStringT(hContact, "ZIP", xmlGetText(m));
+ setTString(hContact, "ZIP", xmlGetText(m));
}
if ((m=xmlGetChild(n , "CTRY"))==NULL || xmlGetText(m)==NULL) // Some bad client use <COUNTRY/> instead of <CTRY/>
m = xmlGetChild(n , "COUNTRY");
if (m!=NULL && xmlGetText(m)!=NULL) {
hasHomeCtry = TRUE;
- JSetStringT(hContact, "Country", xmlGetText(m));
+ setTString(hContact, "Country", xmlGetText(m));
} }
if ( !hasWork && xmlGetChild(n , "WORK")!=NULL) {
@@ -939,34 +939,34 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode)
else
_tcsncpy(text, xmlGetText(m), SIZEOF(text));
text[SIZEOF(text)-1] = '\0';
- JSetStringT(hContact, "CompanyStreet", text);
+ setTString(hContact, "CompanyStreet", text);
}
else {
- JSetStringT(hContact, "CompanyStreet", xmlGetText(m));
+ setTString(hContact, "CompanyStreet", xmlGetText(m));
if ((m=xmlGetChild(n , "EXTADR")) == NULL)
m = xmlGetChild(n , "EXTADD");
if (m!=NULL && xmlGetText(m)!=NULL) {
hasWorkStreet2 = TRUE;
- JSetStringT(hContact, "CompanyStreet2", xmlGetText(m));
+ setTString(hContact, "CompanyStreet2", xmlGetText(m));
} } }
if ((m=xmlGetChild(n , "LOCALITY"))!=NULL && xmlGetText(m)!=NULL) {
hasWorkLocality = TRUE;
- JSetStringT(hContact, "CompanyCity", xmlGetText(m));
+ setTString(hContact, "CompanyCity", xmlGetText(m));
}
if ((m=xmlGetChild(n , "REGION"))!=NULL && xmlGetText(m)!=NULL) {
hasWorkRegion = TRUE;
- JSetStringT(hContact, "CompanyState", xmlGetText(m));
+ setTString(hContact, "CompanyState", xmlGetText(m));
}
if ((m=xmlGetChild(n , "PCODE"))!=NULL && xmlGetText(m)!=NULL) {
hasWorkPcode = TRUE;
- JSetStringT(hContact, "CompanyZIP", xmlGetText(m));
+ setTString(hContact, "CompanyZIP", xmlGetText(m));
}
if ((m=xmlGetChild(n , "CTRY"))==NULL || xmlGetText(m)==NULL) // Some bad client use <COUNTRY/> instead of <CTRY/>
m = xmlGetChild(n , "COUNTRY");
if (m!=NULL && xmlGetText(m)!=NULL) {
hasWorkCtry = TRUE;
- JSetStringT(hContact, "CompanyCountry", xmlGetText(m));
+ setTString(hContact, "CompanyCountry", xmlGetText(m));
} }
}
else if ( !lstrcmp(xmlGetName(n), _T("TEL"))) {
@@ -975,11 +975,11 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode)
if (hContact != NULL) {
if ( !hasFax && xmlGetChild(n , "FAX")!=NULL) {
hasFax = TRUE;
- JSetStringT(hContact, "Fax", xmlGetText(m));
+ setTString(hContact, "Fax", xmlGetText(m));
}
else if ( !hasCell && xmlGetChild(n , "CELL")!=NULL) {
hasCell = TRUE;
- JSetStringT(hContact, "Cellular", xmlGetText(m));
+ setTString(hContact, "Cellular", xmlGetText(m));
}
else if ( !hasPhone &&
(xmlGetChild(n , "HOME")!=NULL ||
@@ -995,13 +995,13 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode)
xmlGetChild(n , "ISDN")==NULL &&
xmlGetChild(n , "PCS")==NULL))) {
hasPhone = TRUE;
- JSetStringT(hContact, "Phone", xmlGetText(m));
+ setTString(hContact, "Phone", xmlGetText(m));
}
}
else {
char text[ 100 ];
sprintf(text, "Phone%d", nPhone);
- JSetStringT(NULL, text, xmlGetText(m));
+ setTString(NULL, text, xmlGetText(m));
sprintf(text, "PhoneFlag%d", nPhone);
int nFlag = 0;
@@ -1017,7 +1017,7 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode)
if (xmlGetChild(n ,"MODEM") != NULL) nFlag |= JABBER_VCTEL_MODEM;
if (xmlGetChild(n ,"ISDN") != NULL) nFlag |= JABBER_VCTEL_ISDN;
if (xmlGetChild(n ,"PCS") != NULL) nFlag |= JABBER_VCTEL_PCS;
- JSetWord(NULL, text, nFlag);
+ setWord(text, nFlag);
nPhone++;
} }
}
@@ -1025,37 +1025,37 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode)
// Homepage
if ( !hasUrl && xmlGetText(n)!=NULL) {
hasUrl = TRUE;
- JSetStringT(hContact, "Homepage", xmlGetText(n));
+ setTString(hContact, "Homepage", xmlGetText(n));
}
}
else if ( !lstrcmp(xmlGetName(n), _T("ORG"))) {
if ( !hasOrgname && !hasOrgunit) {
if ((m=xmlGetChild(n ,"ORGNAME"))!=NULL && xmlGetText(m)!=NULL) {
hasOrgname = TRUE;
- JSetStringT(hContact, "Company", xmlGetText(m));
+ setTString(hContact, "Company", xmlGetText(m));
}
if ((m=xmlGetChild(n ,"ORGUNIT"))!=NULL && xmlGetText(m)!=NULL) { // The real vCard can have multiple <ORGUNIT/> but we will only display the first one
hasOrgunit = TRUE;
- JSetStringT(hContact, "CompanyDepartment", xmlGetText(m));
+ setTString(hContact, "CompanyDepartment", xmlGetText(m));
} }
}
else if ( !lstrcmp(xmlGetName(n), _T("ROLE"))) {
if ( !hasRole && xmlGetText(n)!=NULL) {
hasRole = TRUE;
- JSetStringT(hContact, "Role", xmlGetText(n));
+ setTString(hContact, "Role", xmlGetText(n));
}
}
else if ( !lstrcmp(xmlGetName(n), _T("TITLE"))) {
if ( !hasTitle && xmlGetText(n)!=NULL) {
hasTitle = TRUE;
- JSetStringT(hContact, "CompanyPosition", xmlGetText(n));
+ setTString(hContact, "CompanyPosition", xmlGetText(n));
}
}
else if ( !lstrcmp(xmlGetName(n), _T("DESC"))) {
if ( !hasDesc && xmlGetText(n)!=NULL) {
hasDesc = TRUE;
TCHAR* szMemo = JabberUnixToDosT(xmlGetText(n));
- JSetStringT(hContact, "About", szMemo);
+ setTString(hContact, "About", szMemo);
mir_free(szMemo);
}
}
@@ -1068,7 +1068,7 @@ void CJabberProto::OnIqResultGetVcard(HXML iqNode)
TCHAR *nick = JGetStringT(hContact, "Nick");
TCHAR *jidNick = JabberNickFromJID(jid);
if ( !nick || (jidNick && !_tcsicmp(nick, jidNick)))
- JSetStringT(hContact, "Nick", name);
+ setTString(hContact, "Nick", name);
mir_free(jidNick);
mir_free(nick);
@@ -1370,7 +1370,7 @@ void CJabberProto::OnIqResultGetVCardAvatar(HXML iqNode)
if (xmlGetChildCount(vCard) == 0) {
JDeleteSetting(hContact, "AvatarHash");
DBVARIANT dbv = {0};
- if ( !JGetStringT(hContact, "AvatarSaved", &dbv)) {
+ if ( !getTString(hContact, "AvatarSaved", &dbv)) {
db_free(&dbv);
JDeleteSetting(hContact, "AvatarSaved");
ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, NULL, NULL);
@@ -1386,7 +1386,7 @@ void CJabberProto::OnIqResultGetVCardAvatar(HXML iqNode)
if (n == NULL)
return;
- JSetByte(hContact, "AvatarXVcard", 1);
+ setByte(hContact, "AvatarXVcard", 1);
OnIqResultGotAvatar(hContact, n, mimeType);
}
@@ -1513,12 +1513,12 @@ LBL_ErrFormat:
AI.format = pictureType;
AI.hContact = hContact;
- if (JGetByte(hContact, "AvatarType", PA_FORMAT_UNKNOWN) != (unsigned char)pictureType) {
+ if (getByte(hContact, "AvatarType", PA_FORMAT_UNKNOWN) != (unsigned char)pictureType) {
GetAvatarFileName(hContact, tszFileName, SIZEOF(tszFileName));
DeleteFile(tszFileName);
}
- JSetByte(hContact, "AvatarType", pictureType);
+ setByte(hContact, "AvatarType", pictureType);
char buffer[ 41 ];
mir_sha1_byte_t digest[20];
@@ -1536,7 +1536,7 @@ LBL_ErrFormat:
if (out != NULL) {
fwrite(body, resultLen, 1, out);
fclose(out);
- JSetString(hContact, "AvatarSaved", buffer);
+ setString(hContact, "AvatarSaved", buffer);
ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, HANDLE(&AI), NULL);
Log("Broadcast new avatar: %s",AI.filename);
}
@@ -1702,11 +1702,11 @@ void CJabberProto::OnIqResultEntityTime(HXML pIqNode, CJabberIqInfo* pInfo)
if (GetTimeZoneInformation(&tzinfo) == TIME_ZONE_ID_DAYLIGHT)
nTz -= tzinfo.DaylightBias / 30;
- JSetByte(pInfo->m_hContact, "Timezone", (signed char)nTz);
+ setByte(pInfo->m_hContact, "Timezone", (signed char)nTz);
LPCTSTR szTz = XPathFmt(pIqNode, _T("time[@xmlns='%s']/tz"), _T(JABBER_FEAT_ENTITY_TIME));
if (szTz)
- JSetStringT(pInfo->m_hContact, "TzName", szTz);
+ setTString(pInfo->m_hContact, "TzName", szTz);
else
JDeleteSetting(pInfo->m_hContact, "TzName");
return;
@@ -1714,7 +1714,7 @@ void CJabberProto::OnIqResultEntityTime(HXML pIqNode, CJabberIqInfo* pInfo)
}
else if (pInfo->m_nIqType == JABBER_IQ_TYPE_ERROR)
{
- if (JGetWord(pInfo->m_hContact, "Status", ID_STATUS_OFFLINE) == ID_STATUS_OFFLINE)
+ if (getWord(pInfo->m_hContact, "Status", ID_STATUS_OFFLINE) == ID_STATUS_OFFLINE)
return;
}
diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp
index 5f4cb29764..4c145e1cfc 100644
--- a/protocols/JabberG/src/jabber_menu.cpp
+++ b/protocols/JabberG/src/jabber_menu.cpp
@@ -355,11 +355,11 @@ int CJabberProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM)
if ((hContact=(HANDLE)wParam) == NULL)
return 0;
- BYTE bIsChatRoom = (BYTE)JGetByte(hContact, "ChatRoom", 0);
- BYTE bIsTransport = (BYTE)JGetByte(hContact, "IsTransport", 0);
+ BYTE bIsChatRoom = (BYTE)getByte(hContact, "ChatRoom", 0);
+ BYTE bIsTransport = (BYTE)getByte(hContact, "IsTransport", 0);
if ((bIsChatRoom == GCW_CHATROOM) || bIsChatRoom == 0) {
- if ( !JGetStringT(hContact, bIsChatRoom?(char*)"ChatRoomID":(char*)"jid", &dbv)) {
+ if ( !getTString(hContact, bIsChatRoom?(char*)"ChatRoomID":(char*)"jid", &dbv)) {
db_free(&dbv);
Menu_ShowItem(g_hMenuConvert, TRUE);
@@ -382,7 +382,7 @@ int CJabberProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM)
}
if (bIsChatRoom) {
- if ( !JGetStringT(hContact, "ChatRoomID", &dbv)) {
+ if ( !getTString(hContact, "ChatRoomID", &dbv)) {
Menu_ShowItem(g_hMenuRosterAdd, FALSE);
if (ListGetItemPtr(LIST_BOOKMARK, dbv.ptszVal) == NULL)
@@ -401,7 +401,7 @@ int CJabberProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM)
Menu_ShowItem(g_hMenuRefresh, TRUE);
}
- if ( !JGetStringT(hContact, "jid", &dbv)) {
+ if ( !getTString(hContact, "jid", &dbv)) {
JabberCapsBits jcb = GetTotalJidCapabilites(dbv.ptszVal);
JABBER_LIST_ITEM* item = ListGetItemPtr(LIST_ROSTER, dbv.ptszVal);
db_free(&dbv);
@@ -486,14 +486,14 @@ int CJabberProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM)
INT_PTR __cdecl CJabberProto::OnMenuConvertChatContact(WPARAM wParam, LPARAM)
{
- BYTE bIsChatRoom = (BYTE)JGetByte((HANDLE) wParam, "ChatRoom", 0);
+ BYTE bIsChatRoom = (BYTE)getByte((HANDLE) wParam, "ChatRoom", 0);
if ((bIsChatRoom == GCW_CHATROOM) || bIsChatRoom == 0) {
DBVARIANT dbv;
- if ( !JGetStringT((HANDLE) wParam, (bIsChatRoom == GCW_CHATROOM)?(char*)"ChatRoomID":(char*)"jid", &dbv)) {
+ if ( !getTString((HANDLE) wParam, (bIsChatRoom == GCW_CHATROOM)?(char*)"ChatRoomID":(char*)"jid", &dbv)) {
JDeleteSetting((HANDLE) wParam, (bIsChatRoom == GCW_CHATROOM)?"ChatRoomID":"jid");
- JSetStringT((HANDLE) wParam, (bIsChatRoom != GCW_CHATROOM)?"ChatRoomID":"jid", dbv.ptszVal);
+ setTString((HANDLE) wParam, (bIsChatRoom != GCW_CHATROOM)?"ChatRoomID":"jid", dbv.ptszVal);
db_free(&dbv);
- JSetByte((HANDLE) wParam, "ChatRoom", (bIsChatRoom == GCW_CHATROOM)?0:GCW_CHATROOM);
+ setByte((HANDLE) wParam, "ChatRoom", (bIsChatRoom == GCW_CHATROOM)?0:GCW_CHATROOM);
} }
return 0;
}
@@ -502,7 +502,7 @@ INT_PTR __cdecl CJabberProto::OnMenuRosterAdd(WPARAM wParam, LPARAM)
{
DBVARIANT dbv;
if ( !wParam) return 0; // we do not add ourself to the roster. (buggy situation - should not happen)
- if ( JGetStringT((HANDLE)wParam, "ChatRoomID", &dbv)) return 0;
+ if ( getTString((HANDLE)wParam, "ChatRoomID", &dbv)) return 0;
TCHAR *roomID = NEWTSTR_ALLOCA(dbv.ptszVal);
db_free(&dbv);
@@ -514,7 +514,7 @@ INT_PTR __cdecl CJabberProto::OnMenuRosterAdd(WPARAM wParam, LPARAM)
group = NEWTSTR_ALLOCA(dbv.ptszVal);
db_free(&dbv);
}
- if ( !JGetStringT((HANDLE)wParam, "Nick", &dbv)) {
+ if ( !getTString((HANDLE)wParam, "Nick", &dbv)) {
nick = NEWTSTR_ALLOCA(dbv.ptszVal);
db_free(&dbv);
}
@@ -525,7 +525,7 @@ INT_PTR __cdecl CJabberProto::OnMenuRosterAdd(WPARAM wParam, LPARAM)
item = (JABBER_LIST_ITEM*)mir_calloc(sizeof(JABBER_LIST_ITEM));
item->jid = mir_tstrdup(roomID);
item->name = mir_tstrdup(nick);
- if ( !JGetStringT((HANDLE)wParam, "MyNick", &dbv)) {
+ if ( !getTString((HANDLE)wParam, "MyNick", &dbv)) {
item->nick = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
}
@@ -545,7 +545,7 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleRequestAuth(WPARAM wParam, LPARAM)
DBVARIANT dbv;
if ((hContact=(HANDLE)wParam)!=NULL && m_bJabberOnline) {
- if ( !JGetStringT(hContact, "jid", &dbv)) {
+ if ( !getTString(hContact, "jid", &dbv)) {
m_ThreadInfo->send(XmlNode(_T("presence")) << XATTR(_T("to"), dbv.ptszVal) << XATTR(_T("type"), _T("subscribe")));
db_free(&dbv);
} }
@@ -559,7 +559,7 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleGrantAuth(WPARAM wParam, LPARAM)
DBVARIANT dbv;
if ((hContact=(HANDLE)wParam)!=NULL && m_bJabberOnline) {
- if ( !JGetStringT(hContact, "jid", &dbv)) {
+ if ( !getTString(hContact, "jid", &dbv)) {
m_ThreadInfo->send(XmlNode(_T("presence")) << XATTR(_T("to"), dbv.ptszVal) << XATTR(_T("type"), _T("subscribed")));
db_free(&dbv);
} }
@@ -573,7 +573,7 @@ INT_PTR __cdecl CJabberProto::OnMenuRevokeAuth(WPARAM wParam, LPARAM)
DBVARIANT dbv;
if ((hContact=(HANDLE)wParam) != NULL && m_bJabberOnline) {
- if ( !JGetStringT(hContact, "jid", &dbv)) {
+ if ( !getTString(hContact, "jid", &dbv)) {
m_ThreadInfo->send(XmlNode(_T("presence")) << XATTR(_T("to"), dbv.ptszVal) << XATTR(_T("type"), _T("unsubscribed")));
db_free(&dbv);
} }
@@ -584,11 +584,11 @@ INT_PTR __cdecl CJabberProto::OnMenuRevokeAuth(WPARAM wParam, LPARAM)
INT_PTR __cdecl CJabberProto::OnMenuTransportLogin(WPARAM wParam, LPARAM)
{
HANDLE hContact = (HANDLE)wParam;
- if ( !JGetByte(hContact, "IsTransport", 0))
+ if ( !getByte(hContact, "IsTransport", 0))
return 0;
DBVARIANT jid;
- if (JGetStringT(hContact, "jid", &jid))
+ if (getTString(hContact, "jid", &jid))
return 0;
JABBER_LIST_ITEM* item = ListGetItemPtr(LIST_ROSTER, jid.ptszVal);
@@ -606,11 +606,11 @@ INT_PTR __cdecl CJabberProto::OnMenuTransportLogin(WPARAM wParam, LPARAM)
INT_PTR __cdecl CJabberProto::OnMenuTransportResolve(WPARAM wParam, LPARAM)
{
HANDLE hContact = (HANDLE)wParam;
- if ( !JGetByte(hContact, "IsTransport", 0))
+ if ( !getByte(hContact, "IsTransport", 0))
return 0;
DBVARIANT jid;
- if ( !JGetStringT(hContact, "jid", &jid)) {
+ if ( !getTString(hContact, "jid", &jid)) {
ResolveTransportNicks(jid.ptszVal);
db_free(&jid);
}
@@ -624,12 +624,12 @@ INT_PTR __cdecl CJabberProto::OnMenuBookmarkAdd(WPARAM wParam, LPARAM)
return 0; // we do not add ourself to the roster. (buggy situation - should not happen)
DBVARIANT dbv;
- if ( !JGetStringT(hContact, "ChatRoomID", &dbv)) {
+ if ( !getTString(hContact, "ChatRoomID", &dbv)) {
TCHAR *roomID = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
if (ListGetItemPtr(LIST_BOOKMARK, roomID) == NULL) {
TCHAR *nick = 0;
- if ( !JGetStringT(hContact, "Nick", &dbv)) {
+ if ( !getTString(hContact, "Nick", &dbv)) {
nick = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
}
@@ -638,7 +638,7 @@ INT_PTR __cdecl CJabberProto::OnMenuBookmarkAdd(WPARAM wParam, LPARAM)
item->jid = mir_tstrdup(roomID);
item->name = pcli->pfnGetContactDisplayName(hContact, 0);
item->type = _T("conference");
- if ( !JGetStringT(hContact, "MyNick", &dbv)) {
+ if ( !getTString(hContact, "MyNick", &dbv)) {
item->nick = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
}
@@ -821,7 +821,7 @@ void CJabberProto::MenuInit()
Menu_AddProtoMenuItem(&mi);
}
- UpdatePriorityMenu((short)JGetWord(NULL, "Priority", 0));
+ UpdatePriorityMenu((short)getWord("Priority", 0));
//////////////////////////////////////////////////////////////////////////////////////
// finalize status menu
@@ -839,10 +839,10 @@ INT_PTR CJabberProto::OnMenuSetPriority(WPARAM, LPARAM, LPARAM dwDelta)
{
int iDelta = (int)dwDelta;
short priority = 0;
- priority = (short)JGetWord(NULL, "Priority", 0) + iDelta;
+ priority = (short)getWord("Priority", 0) + iDelta;
if (priority > 127) priority = 127;
else if (priority < -128) priority = -128;
- JSetWord(NULL, "Priority", priority);
+ setWord("Priority", priority);
SendPresence(m_iStatus, true);
return 0;
}
@@ -1055,7 +1055,7 @@ int CJabberProto::OnProcessSrmmEvent(WPARAM, LPARAM lParam)
bSupportTyping = dbv.bVal == 1;
db_free(&dbv);
}
- if (bSupportTyping && !JGetStringT(event->hContact, "jid", &dbv)) {
+ if (bSupportTyping && !getTString(event->hContact, "jid", &dbv)) {
TCHAR jid[ JABBER_MAX_JID_LEN ];
GetClientJID(dbv.ptszVal, jid, SIZEOF(jid));
db_free(&dbv);
@@ -1086,7 +1086,7 @@ int CJabberProto::OnProcessSrmmIconClick(WPARAM wParam, LPARAM lParam)
return 0;
DBVARIANT dbv;
- if (JGetStringT(hContact, "jid", &dbv))
+ if (getTString(hContact, "jid", &dbv))
return 0;
JABBER_LIST_ITEM *LI = ListGetItemPtr(LIST_ROSTER, dbv.ptszVal);
@@ -1145,7 +1145,7 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleResource(WPARAM wParam, LPARAM, LPARAM
HANDLE hContact = (HANDLE)wParam;
DBVARIANT dbv;
- if (JGetStringT(hContact, "jid", &dbv))
+ if (getTString(hContact, "jid", &dbv))
return 0;
JABBER_LIST_ITEM *LI = ListGetItemPtr(LIST_ROSTER, dbv.ptszVal);
@@ -1182,10 +1182,10 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleDirectPresence(WPARAM wParam, LPARAM l
TCHAR *jid, text[ 1024 ];
DBVARIANT dbv;
- int result = JGetStringT(hContact, "jid", &dbv);
+ int result = getTString(hContact, "jid", &dbv);
if (result)
{
- result = JGetStringT(hContact, "ChatRoomID", &dbv);
+ result = getTString(hContact, "ChatRoomID", &dbv);
if (result) return 0;
JABBER_LIST_ITEM* item = ListGetItemPtr(LIST_CHATROOM, dbv.ptszVal);
diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp
index 1829f58653..dbe400af80 100644
--- a/protocols/JabberG/src/jabber_misc.cpp
+++ b/protocols/JabberG/src/jabber_misc.cpp
@@ -120,7 +120,7 @@ void CJabberProto::DBAddAuthRequest(const TCHAR *jid, const TCHAR *nick)
{
HANDLE hContact = DBCreateContact(jid, NULL, TRUE, TRUE);
JDeleteSetting(hContact, "Hidden");
- //JSetStringT(hContact, "Nick", nick);
+ //setTString(hContact, "Nick", nick);
char* szJid = mir_utf8encodeT(jid);
char* szNick = mir_utf8encodeT(nick);
@@ -175,7 +175,7 @@ HANDLE CJabberProto::DBCreateContact(const TCHAR *jid, const TCHAR *nick, BOOL t
// We can't use JabberHContactFromJID() here because of the stripResource option
for (hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
DBVARIANT dbv;
- if ( !JGetStringT(hContact, "jid", &dbv)) {
+ if ( !getTString(hContact, "jid", &dbv)) {
p = dbv.ptszVal;
if (p && _tcslen(p) >= len && (p[len]=='\0'||p[len]=='/') && !_tcsnicmp(p, s, len)) {
db_free(&dbv);
@@ -188,9 +188,9 @@ HANDLE CJabberProto::DBCreateContact(const TCHAR *jid, const TCHAR *nick, BOOL t
if (hContact == NULL) {
hContact = (HANDLE)CallService(MS_DB_CONTACT_ADD, 0, 0);
CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)m_szModuleName);
- JSetStringT(hContact, "jid", s);
+ setTString(hContact, "jid", s);
if (nick != NULL && *nick != '\0')
- JSetStringT(hContact, "Nick", nick);
+ setTString(hContact, "Nick", nick);
if (temporary)
db_set_b(hContact, "CList", "NotOnList", 1);
else
@@ -268,7 +268,7 @@ void CJabberProto::GetAvatarFileName(HANDLE hContact, TCHAR* pszDest, size_t cbL
pszDest[ tPathLen++ ] = '\\';
char* szFileType = NULL;
- switch(JGetByte(hContact, "AvatarType", PA_FORMAT_PNG)) {
+ switch(getByte(hContact, "AvatarType", PA_FORMAT_PNG)) {
case PA_FORMAT_JPEG: szFileType = "jpg"; break;
case PA_FORMAT_PNG: szFileType = "png"; break;
case PA_FORMAT_GIF: szFileType = "gif"; break;
@@ -317,13 +317,13 @@ void CJabberProto::ResolveTransportNicks(const TCHAR *jid)
hContact = (HANDLE)db_find_first(m_szModuleName);
for (; hContact != NULL; hContact = db_find_next(hContact, m_szModuleName)) {
- if ( !JGetByte(hContact, "IsTransported", 0))
+ if ( !getByte(hContact, "IsTransported", 0))
continue;
DBVARIANT dbv, nick;
- if (JGetStringT(hContact, "jid", &dbv))
+ if (getTString(hContact, "jid", &dbv))
continue;
- if (JGetStringT(hContact, "Nick", &nick)) {
+ if (getTString(hContact, "Nick", &nick)) {
db_free(&dbv);
continue;
}
@@ -545,18 +545,18 @@ void CJabberProto::UpdateMirVer(HANDLE hContact, JABBER_RESOURCE_STATUS *resourc
TCHAR szMirVer[ 512 ];
FormatMirVer(resource, szMirVer, SIZEOF(szMirVer));
if (szMirVer[0])
- JSetStringT(hContact, "MirVer", szMirVer);
+ setTString(hContact, "MirVer", szMirVer);
// else
// JDeleteSetting(hContact, "MirVer");
DBVARIANT dbv;
- if ( !JGetStringT(hContact, "jid", &dbv)) {
+ if ( !getTString(hContact, "jid", &dbv)) {
TCHAR szFullJid[ JABBER_MAX_JID_LEN ];
if (resource->resourceName)
mir_sntprintf(szFullJid, SIZEOF(szFullJid), _T("%s/%s"), dbv.ptszVal, resource->resourceName);
else
lstrcpyn(szFullJid, dbv.ptszVal, SIZEOF(szFullJid));
- JSetStringT(hContact, DBSETTING_DISPLAY_UID, szFullJid);
+ setTString(hContact, DBSETTING_DISPLAY_UID, szFullJid);
db_free(&dbv);
}
}
@@ -566,36 +566,36 @@ void CJabberProto::UpdateSubscriptionInfo(HANDLE hContact, JABBER_LIST_ITEM *ite
switch (item->subscription)
{
case SUB_TO:
- JSetStringT(hContact, "SubscriptionText", TranslateT("To"));
- JSetString(hContact, "Subscription", "to");
- JSetByte(hContact, "Auth", 0);
- JSetByte(hContact, "Grant", 1);
+ setTString(hContact, "SubscriptionText", TranslateT("To"));
+ setString(hContact, "Subscription", "to");
+ setByte(hContact, "Auth", 0);
+ setByte(hContact, "Grant", 1);
break;
case SUB_FROM:
- JSetStringT(hContact, "SubscriptionText", TranslateT("From"));
- JSetString(hContact, "Subscription", "from");
- JSetByte(hContact, "Auth", 1);
- JSetByte(hContact, "Grant", 0);
+ setTString(hContact, "SubscriptionText", TranslateT("From"));
+ setString(hContact, "Subscription", "from");
+ setByte(hContact, "Auth", 1);
+ setByte(hContact, "Grant", 0);
break;
case SUB_BOTH:
- JSetStringT(hContact, "SubscriptionText", TranslateT("Both"));
- JSetString(hContact, "Subscription", "both");
- JSetByte(hContact, "Auth", 0);
- JSetByte(hContact, "Grant", 0);
+ setTString(hContact, "SubscriptionText", TranslateT("Both"));
+ setString(hContact, "Subscription", "both");
+ setByte(hContact, "Auth", 0);
+ setByte(hContact, "Grant", 0);
break;
case SUB_NONE:
- JSetStringT(hContact, "SubscriptionText", TranslateT("None"));
- JSetString(hContact, "Subscription", "none");
- JSetByte(hContact, "Auth", 1);
- JSetByte(hContact, "Grant", 1);
+ setTString(hContact, "SubscriptionText", TranslateT("None"));
+ setString(hContact, "Subscription", "none");
+ setByte(hContact, "Auth", 1);
+ setByte(hContact, "Grant", 1);
break;
}
}
void CJabberProto::SetContactOfflineStatus(HANDLE hContact)
{
- if (JGetWord(hContact, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE)
- JSetWord(hContact, "Status", ID_STATUS_OFFLINE);
+ if (getWord(hContact, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE)
+ setWord(hContact, "Status", ID_STATUS_OFFLINE);
JDeleteSetting(hContact, DBSETTING_XSTATUSID);
JDeleteSetting(hContact, DBSETTING_XSTATUSNAME);
diff --git a/protocols/JabberG/src/jabber_notes.cpp b/protocols/JabberG/src/jabber_notes.cpp
index 0a0ac98132..435eb17903 100644
--- a/protocols/JabberG/src/jabber_notes.cpp
+++ b/protocols/JabberG/src/jabber_notes.cpp
@@ -856,7 +856,7 @@ INT_PTR __cdecl CJabberProto::OnMenuSendNote(WPARAM wParam, LPARAM)
if ( !wParam) return 0;
TCHAR szClientJid[ JABBER_MAX_JID_LEN ];
- GetClientJID(JGetStringT((HANDLE)wParam, "jid"), szClientJid, SIZEOF(szClientJid));
+ GetClientJID( JGetStringT((HANDLE)wParam, "jid"), szClientJid, SIZEOF(szClientJid));
CNoteItem *pItem = new CNoteItem(NULL, szClientJid);
CJabberDlgBase *pDlg = new CJabberDlgNoteItem(this, pItem, &CJabberProto::ProcessOutgoingNote);
diff --git a/protocols/JabberG/src/jabber_opt.cpp b/protocols/JabberG/src/jabber_opt.cpp
index df48e8c672..0cc72adcdd 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->JSetStringT(NULL, "jid", jid);
+ ppro->setTString(NULL, "jid", jid);
mir_free(jid);
mir_free(server);
mir_free(user);
@@ -526,7 +526,7 @@ protected:
{
TCHAR *szLanguageCode = (TCHAR *)m_cbLocale.GetItemData(index);
if (szLanguageCode) {
- m_proto->JSetStringT(NULL, "XmlLang", szLanguageCode);
+ m_proto->setTString(NULL, "XmlLang", szLanguageCode);
mir_free(m_proto->m_tszSelectedLang);
m_proto->m_tszSelectedLang = mir_tstrdup(szLanguageCode);
@@ -871,11 +871,11 @@ public:
HANDLE hContact = m_proto->HContactFromJID(item->jid);
if (hContact != NULL) {
if (bChecked) {
- if (item->itemResource.status != m_proto->JGetWord(hContact, "Status", ID_STATUS_OFFLINE)) {
- m_proto->JSetWord(hContact, "Status", (WORD)item->itemResource.status);
+ if (item->itemResource.status != m_proto->getWord(hContact, "Status", ID_STATUS_OFFLINE)) {
+ m_proto->setWord(hContact, "Status", (WORD)item->itemResource.status);
} }
- else if (m_proto->JGetWord(hContact, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE)
- m_proto->JSetWord(hContact, "Status", ID_STATUS_OFFLINE);
+ else if (m_proto->getWord(hContact, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE)
+ m_proto->setWord(hContact, "Status", ID_STATUS_OFFLINE);
} } }
}
@@ -1059,7 +1059,7 @@ void CJabberProto::_RosterHandleGetRequest(HXML node)
// now it is require to process whole contact list to add not in roster contacts
for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
DBVARIANT dbv;
- if ( !JGetStringT(hContact, "jid", &dbv)) {
+ if ( !getTString(hContact, "jid", &dbv)) {
LVFINDINFO lvfi={0};
lvfi.flags = LVFI_STRING;
lvfi.psz = dbv.ptszVal;
@@ -1777,11 +1777,11 @@ protected:
db_free(&dbv);
}
- m_txtPort.SetInt(m_proto->JGetWord(NULL, "ManualPort", m_txtPort.GetInt()));
+ m_txtPort.SetInt(m_proto->getWord("ManualPort", m_txtPort.GetInt()));
} else
{
int defPort = m_txtPort.GetInt();
- int port = m_proto->JGetWord(NULL, "Port", defPort);
+ int port = m_proto->getWord("Port", defPort);
if (port != defPort)
{
@@ -1844,7 +1844,7 @@ protected:
break;
case ACC_GTALK:
- m_proto->JSetWord(NULL, "Priority", 24);
+ m_proto->setWord("Priority", 24);
{
int port = m_txtPort.GetInt();
if (port == 443 || port == 5223)
@@ -1882,15 +1882,15 @@ protected:
if ((m_chkManualHost.GetState() == BST_CHECKED) && lstrcmpA(server, manualServer))
{
m_proto->m_options.ManualConnect = TRUE;
- m_proto->JSetString(NULL, "ManualHost", manualServer);
- m_proto->JSetWord(NULL, "ManualPort", m_txtPort.GetInt());
- m_proto->JSetWord(NULL, "Port", m_txtPort.GetInt());
+ m_proto->setString("ManualHost", manualServer);
+ m_proto->setWord("ManualPort", m_txtPort.GetInt());
+ m_proto->setWord("Port", m_txtPort.GetInt());
} else
{
m_proto->m_options.ManualConnect = FALSE;
m_proto->JDeleteSetting(NULL, "ManualHost");
m_proto->JDeleteSetting(NULL, "ManualPort");
- m_proto->JSetWord(NULL, "Port", m_txtPort.GetInt());
+ m_proto->setWord("Port", m_txtPort.GetInt());
}
sttStoreJidFromUI(m_proto, m_txtUsername, m_cbServer);
diff --git a/protocols/JabberG/src/jabber_privacy.cpp b/protocols/JabberG/src/jabber_privacy.cpp
index 465d1a87ea..3dca46515f 100644
--- a/protocols/JabberG/src/jabber_privacy.cpp
+++ b/protocols/JabberG/src/jabber_privacy.cpp
@@ -434,7 +434,7 @@ public:
for (HANDLE hContact = db_find_first(m_proto->m_szModuleName); hContact; hContact = db_find_next(hContact, m_proto->m_szModuleName)) {
DBVARIANT dbv;
- if ( !m_proto->JGetStringT(hContact, "jid", &dbv)) {
+ if ( !m_proto->getTString(hContact, "jid", &dbv)) {
SendDlgItemMessage(m_hwnd, IDC_COMBO_VALUES, CB_ADDSTRING, 0, (LPARAM)dbv.ptszVal);
db_free(&dbv);
}
@@ -1569,8 +1569,8 @@ void CJabberDlgPrivacyLists::CListBuildList(HWND hwndList, CPrivacyList *pList)
hItem = m_clcClist.FindContact(hContact);
DBVARIANT dbv = {0};
- if (m_proto->JGetStringT(hContact, "jid", &dbv))
- if (m_proto->JGetStringT(hContact, "ChatRoomID", &dbv))
+ if (m_proto->getTString(hContact, "jid", &dbv))
+ if (m_proto->getTString(hContact, "ChatRoomID", &dbv))
continue;
szJid = dbv.ptszVal;
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp
index b6ca54517c..3a67f25fe6 100644
--- a/protocols/JabberG/src/jabber_proto.cpp
+++ b/protocols/JabberG/src/jabber_proto.cpp
@@ -179,7 +179,7 @@ CJabberProto::CJabberProto(const char* aProtoName, const TCHAR *aUserName) :
db_set_resident(m_szModuleName, "Grant");
DBVARIANT dbv;
- if ( !JGetStringT(NULL, "XmlLang", &dbv)) {
+ if ( !getTString(NULL, "XmlLang", &dbv)) {
m_tszSelectedLang = mir_tstrdup(dbv.ptszVal);
db_free(&dbv);
}
@@ -312,11 +312,11 @@ int CJabberProto::OnModulesLoadedEx(WPARAM, LPARAM)
for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
SetContactOfflineStatus(hContact);
- if ( !JGetByte(hContact, "IsTransport", 0))
+ if ( !getByte(hContact, "IsTransport", 0))
continue;
DBVARIANT dbv;
- if ( !JGetStringT(hContact, "jid", &dbv)) {
+ if ( !getTString(hContact, "jid", &dbv)) {
TCHAR* domain = NEWTSTR_ALLOCA(dbv.ptszVal);
TCHAR* resourcepos = _tcschr(domain, '/');
if (resourcepos != NULL)
@@ -382,10 +382,10 @@ HANDLE CJabberProto::AddToListByJID(const TCHAR *newJid, DWORD flags)
Log("Add new jid to contact jid = %S", jid);
hContact = (HANDLE)CallService(MS_DB_CONTACT_ADD, 0, 0);
CallService(MS_PROTO_ADDTOCONTACT, (WPARAM)hContact, (LPARAM)m_szModuleName);
- JSetStringT(hContact, "jid", jid);
+ setTString(hContact, "jid", jid);
if ((nick=JabberNickFromJID(newJid)) == NULL)
nick = mir_tstrdup(newJid);
-// JSetStringT(hContact, "Nick", nick);
+// setTString(hContact, "Nick", nick);
mir_free(nick);
mir_free(jid);
@@ -695,7 +695,7 @@ DWORD_PTR __cdecl CJabberProto::GetCaps(int type, HANDLE hContact)
case PFLAG_MAXCONTACTSPERPACKET:
{
DBVARIANT dbv;
- if (JGetStringT(hContact, "jid", &dbv))
+ if (getTString(hContact, "jid", &dbv))
return 0;
TCHAR szClientJid[ JABBER_MAX_JID_LEN ];
GetClientJID(dbv.ptszVal, szClientJid, SIZEOF(szClientJid));
@@ -717,10 +717,10 @@ int __cdecl CJabberProto::GetInfo(HANDLE hContact, int /*infoType*/)
int result = 1;
DBVARIANT dbv;
- if (JGetByte(hContact, "ChatRoom", 0))
+ if (getByte(hContact, "ChatRoom", 0))
return 1;
- if ( !JGetStringT(hContact, "jid", &dbv)) {
+ if ( !getTString(hContact, "jid", &dbv)) {
if (m_ThreadInfo) {
TCHAR jid[ JABBER_MAX_JID_LEN ];
GetClientJID(dbv.ptszVal, jid, SIZEOF(jid));
@@ -988,7 +988,7 @@ int __cdecl CJabberProto::RecvUrl(HANDLE /*hContact*/, PROTORECVEVENT*)
int __cdecl CJabberProto::SendContacts(HANDLE hContact, int flags, int nContacts, HANDLE* hContactsList)
{
DBVARIANT dbv;
- if ( !m_bJabberOnline || JGetStringT(hContact, "jid", &dbv))
+ if ( !m_bJabberOnline || getTString(hContact, "jid", &dbv))
return 0;
TCHAR szClientJid[ JABBER_MAX_JID_LEN ];
@@ -1004,7 +1004,7 @@ int __cdecl CJabberProto::SendContacts(HANDLE hContact, int flags, int nContacts
HXML x = m << XCHILDNS(_T("x"), _T(JABBER_FEAT_ROSTER_EXCHANGE));
for (int i = 0; i < nContacts; i++) {
- if ( !JGetStringT(hContactsList[i], "jid", &dbv)) {
+ if ( !getTString(hContactsList[i], "jid", &dbv)) {
x << XCHILD(_T("item")) << XATTR(_T("action"), _T("add")) <<
XATTR(_T("jid"), dbv.ptszVal);
db_free(&dbv);
@@ -1025,11 +1025,11 @@ HANDLE __cdecl CJabberProto::SendFile(HANDLE hContact, const TCHAR *szDescriptio
{
if ( !m_bJabberOnline) return 0;
- if (JGetWord(hContact, "Status", ID_STATUS_OFFLINE) == ID_STATUS_OFFLINE)
+ if (getWord(hContact, "Status", ID_STATUS_OFFLINE) == ID_STATUS_OFFLINE)
return 0;
DBVARIANT dbv;
- if (JGetStringT(hContact, "jid", &dbv))
+ if (getTString(hContact, "jid", &dbv))
return 0;
int i, j;
@@ -1210,7 +1210,7 @@ int __cdecl CJabberProto::SendMsg(HANDLE hContact, int flags, const char* pszSrc
// if message sent to groupchat
!lstrcmp(msgType, _T("groupchat")) ||
// if message delivery check disabled in settings
- !m_options.MsgAck || !JGetByte(hContact, "MsgAck", TRUE))
+ !m_options.MsgAck || !getByte(hContact, "MsgAck", TRUE))
{
if ( !lstrcmp(msgType, _T("groupchat")))
xmlAddAttr(m, _T("to"), (TCHAR*)ptszJid);
@@ -1254,16 +1254,16 @@ int __cdecl CJabberProto::SetApparentMode(HANDLE hContact, int mode)
if (mode != 0 && mode != ID_STATUS_ONLINE && mode != ID_STATUS_OFFLINE)
return 1;
- int oldMode = JGetWord(hContact, "ApparentMode", 0);
+ int oldMode = getWord(hContact, "ApparentMode", 0);
if (mode == oldMode)
return 1;
- JSetWord(hContact, "ApparentMode", (WORD)mode);
+ setWord(hContact, "ApparentMode", (WORD)mode);
if ( !m_bJabberOnline)
return 0;
DBVARIANT dbv;
- if ( !JGetStringT(hContact, "jid", &dbv)) {
+ if ( !getTString(hContact, "jid", &dbv)) {
TCHAR* jid = dbv.ptszVal;
switch (mode) {
case ID_STATUS_ONLINE:
@@ -1346,7 +1346,7 @@ void __cdecl CJabberProto::GetAwayMsgThread(void* hContact)
int i, msgCount;
size_t len;
- if ( !JGetStringT(hContact, "jid", &dbv)) {
+ if ( !getTString(hContact, "jid", &dbv)) {
if ((item = ListGetItemPtr(LIST_ROSTER, dbv.ptszVal)) != NULL) {
db_free(&dbv);
if (item->resourceCount > 0) {
@@ -1483,7 +1483,7 @@ int __cdecl CJabberProto::UserIsTyping(HANDLE hContact, int type)
if ( !m_bJabberOnline) return 0;
DBVARIANT dbv;
- if (JGetStringT(hContact, "jid", &dbv))
+ if (getTString(hContact, "jid", &dbv))
return 0;
JABBER_LIST_ITEM *item;
diff --git a/protocols/JabberG/src/jabber_proto.h b/protocols/JabberG/src/jabber_proto.h
index 848381579d..81e0f8a3a7 100644
--- a/protocols/JabberG/src/jabber_proto.h
+++ b/protocols/JabberG/src/jabber_proto.h
@@ -784,22 +784,13 @@ struct CJabberProto : public PROTO<CJabberProto>
//---- jabber_std.cpp ----------------------------------------------
void JDeleteSetting(HANDLE hContact, const char* valueName);
- DWORD JGetByte(HANDLE hContact, const char* valueName, int parDefltValue);
- DWORD JGetDword(HANDLE hContact, const char* valueName, DWORD parDefltValue);
int JGetStaticString(const char* valueName, HANDLE hContact, char* dest, int dest_len);
int JGetStringUtf(HANDLE hContact, char* valueName, DBVARIANT* dbv);
- int JGetStringT(HANDLE hContact, char* valueName, DBVARIANT* dbv);
TCHAR *JGetStringT(HANDLE hContact, char* valueName);
TCHAR *JGetStringT(HANDLE hContact, char* valueName, TCHAR *&out);
TCHAR *JGetStringT(HANDLE hContact, char* valueName, TCHAR *buf, int size);
- WORD JGetWord(HANDLE hContact, const char* valueName, int parDefltValue);
void JLoginFailed(int errorCode);
- DWORD JSetByte(HANDLE hContact, const char* valueName, int parValue);
- DWORD JSetDword(HANDLE hContact, const char* valueName, DWORD parValue);
- DWORD JSetString(HANDLE hContact, const char* valueName, const char* parValue);
- DWORD JSetStringT(HANDLE hContact, const char* valueName, const TCHAR *parValue);
DWORD JSetStringUtf(HANDLE hContact, const char* valueName, const char* parValue);
- DWORD JSetWord(HANDLE hContact, const char* valueName, int parValue);
TCHAR* JGetStringCrypt(HANDLE hContact, char* valueName);
DWORD JSetStringCrypt(HANDLE hContact, char* valueName, const TCHAR *parValue);
diff --git a/protocols/JabberG/src/jabber_rc.cpp b/protocols/JabberG/src/jabber_rc.cpp
index 05adbeb2e6..dbe490c9c1 100644
--- a/protocols/JabberG/src/jabber_rc.cpp
+++ b/protocols/JabberG/src/jabber_rc.cpp
@@ -312,7 +312,7 @@ int CJabberProto::AdhocSetStatusHandler(HXML, CJabberIqInfo* pInfo, CJabberAdhoc
// priority
TCHAR szPriority[ 256 ];
- mir_sntprintf(szPriority, SIZEOF(szPriority), _T("%d"), (short)JGetWord(NULL, "Priority", 5));
+ mir_sntprintf(szPriority, SIZEOF(szPriority), _T("%d"), (short)getWord("Priority", 5));
xNode << XCHILD(_T("field")) << XATTR(_T("label"), TranslateT("Priority")) << XATTR(_T("type"), _T("text-single"))
<< XATTR(_T("var"), _T("status-priority")) << XCHILD(_T("value"), szPriority);
@@ -370,7 +370,7 @@ int CJabberProto::AdhocSetStatusHandler(HXML, CJabberIqInfo* pInfo, CJabberAdhoc
}
if (priority >= -128 && priority <= 127)
- JSetWord(NULL, "Priority", (WORD)priority);
+ setWord("Priority", (WORD)priority);
const TCHAR *szStatusMessage = NULL;
fieldNode = xmlGetChildByTag(xNode, "field", "var", _T("status-message"));
@@ -479,7 +479,7 @@ int CJabberProto::RcGetUnreadEventsCount()
int nEventsSent = 0;
for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
DBVARIANT dbv;
- if ( !JGetStringT(hContact, "jid", &dbv)) {
+ if ( !getTString(hContact, "jid", &dbv)) {
HANDLE hDbEvent = db_event_firstUnread(hContact);
while (hDbEvent) {
DBEVENTINFO dbei = { sizeof(dbei) };
@@ -570,7 +570,7 @@ int CJabberProto::AdhocForwardHandler(HXML, CJabberIqInfo* pInfo, CJabberAdhocSe
int nEventsSent = 0;
for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
DBVARIANT dbv;
- if ( JGetStringT(hContact, "jid", &dbv))
+ if ( getTString(hContact, "jid", &dbv))
continue;
HANDLE hDbEvent = db_event_firstUnread(hContact);
diff --git a/protocols/JabberG/src/jabber_search.cpp b/protocols/JabberG/src/jabber_search.cpp
index a3fb0ec390..a02630dca3 100644
--- a/protocols/JabberG/src/jabber_search.cpp
+++ b/protocols/JabberG/src/jabber_search.cpp
@@ -486,14 +486,14 @@ void CJabberProto::SearchDeleteFromRecent(const TCHAR *szAddr, BOOL deleteLastFr
//search in recent
for (int i=0; i<10; i++) {
sprintf(key,"RecentlySearched_%d",i);
- if ( !JGetStringT(NULL, key, &dbv)) {
+ if ( !getTString(NULL, key, &dbv)) {
if ( !_tcsicmp(szAddr, dbv.ptszVal)) {
db_free(&dbv);
for (int j=i; j<10; j++) {
sprintf(key, "RecentlySearched_%d", j+1);
- if ( !JGetStringT(NULL, key, &dbv)) {
+ if ( !getTString(NULL, key, &dbv)) {
sprintf(key,"RecentlySearched_%d",j);
- JSetStringT(NULL,key,dbv.ptszVal);
+ setTString(NULL,key,dbv.ptszVal);
db_free(&dbv);
}
else {
@@ -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 ( !JGetStringT(NULL, key, &dbv)) {
+ if ( !getTString(NULL, key, &dbv)) {
sprintf(key,"RecentlySearched_%d",j);
- JSetStringT(NULL,key,dbv.ptszVal);
+ setTString(NULL,key,dbv.ptszVal);
db_free(&dbv);
} }
sprintf(key, "RecentlySearched_%d", 0);
- JSetStringT(NULL, key, szAddr);
+ setTString(NULL, key, szAddr);
if (hwndDialog)
JabberSearchAddUrlToRecentCombo(hwndDialog, szAddr);
}
@@ -557,7 +557,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->JGetStringT(NULL, key, &dbv)) {
+ if ( !dat->ppro->getTString(NULL, 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 4eff7b90c9..df45146891 100644
--- a/protocols/JabberG/src/jabber_std.cpp
+++ b/protocols/JabberG/src/jabber_std.cpp
@@ -30,16 +30,6 @@ void CJabberProto::JDeleteSetting(HANDLE hContact, const char* valueName)
db_unset(hContact, m_szModuleName, valueName);
}
-DWORD CJabberProto::JGetByte(HANDLE hContact, const char* valueName, int parDefltValue)
-{
- return db_get_b(hContact, m_szModuleName, valueName, parDefltValue);
-}
-
-DWORD CJabberProto::JGetDword(HANDLE hContact, const char* valueName, DWORD parDefltValue)
-{
- return db_get_dw(hContact, m_szModuleName, valueName, parDefltValue);
-}
-
int CJabberProto::JGetStaticString(const char* valueName, HANDLE hContact, char* dest, int dest_len)
{
DBVARIANT dbv;
@@ -62,15 +52,10 @@ int CJabberProto::JGetStringUtf(HANDLE hContact, char* valueName, DBVARIANT* dbv
return db_get_utf(hContact, m_szModuleName, valueName, dbv);
}
-int CJabberProto::JGetStringT(HANDLE hContact, char* valueName, DBVARIANT* dbv)
-{
- return db_get_ts(hContact, m_szModuleName, valueName, dbv);
-}
-
TCHAR *CJabberProto::JGetStringT(HANDLE hContact, char* valueName)
{
DBVARIANT dbv = {0};
- if (JGetStringT(hContact, valueName, &dbv))
+ if (getTString(hContact, valueName, &dbv))
return NULL;
TCHAR *res = mir_tstrdup(dbv.ptszVal);
@@ -86,7 +71,7 @@ TCHAR *CJabberProto::JGetStringT(HANDLE hContact, char* valueName, TCHAR *&out)
TCHAR *CJabberProto::JGetStringT(HANDLE hContact, char* valueName, TCHAR *buf, int size)
{
DBVARIANT dbv = {0};
- if (JGetStringT(hContact, valueName, &dbv))
+ if (getTString(hContact, valueName, &dbv))
return NULL;
lstrcpyn(buf, dbv.ptszVal, size);
@@ -94,53 +79,17 @@ TCHAR *CJabberProto::JGetStringT(HANDLE hContact, char* valueName, TCHAR *buf, i
return buf;
}
-WORD CJabberProto::JGetWord(HANDLE hContact, const char* valueName, int parDefltValue)
-{
- return db_get_w(hContact, m_szModuleName, valueName, parDefltValue);
-}
-
void CJabberProto::JLoginFailed(int errorCode)
{
*m_savedPassword = 0;
ProtoBroadcastAck(NULL, ACKTYPE_LOGIN, ACKRESULT_FAILED, NULL, errorCode);
}
-/*
-DWORD CJabberProto::JSetByte(const char* valueName, int parValue)
-{
- return db_set_b(NULL, m_szModuleName, valueName, parValue);
-}
-*/
-DWORD CJabberProto::JSetByte(HANDLE hContact, const char* valueName, int parValue)
-{
- return db_set_b(hContact, m_szModuleName, valueName, parValue);
-}
-
-DWORD CJabberProto::JSetDword(HANDLE hContact, const char* valueName, DWORD parValue)
-{
- return db_set_dw(hContact, m_szModuleName, valueName, parValue);
-}
-
-DWORD CJabberProto::JSetString(HANDLE hContact, const char* valueName, const char* parValue)
-{
- return db_set_s(hContact, m_szModuleName, valueName, parValue);
-}
-
-DWORD CJabberProto::JSetStringT(HANDLE hContact, const char* valueName, const TCHAR *parValue)
-{
- return db_set_ts(hContact, m_szModuleName, valueName, parValue);
-}
-
DWORD CJabberProto::JSetStringUtf(HANDLE hContact, const char* valueName, const char* parValue)
{
return db_set_utf(hContact, m_szModuleName, valueName, parValue);
}
-DWORD CJabberProto::JSetWord(HANDLE hContact, const char* valueName, int parValue)
-{
- return db_set_w(hContact, m_szModuleName, valueName, parValue);
-}
-
// save/load crypted strings
void __forceinline sttCryptString(char *str)
{
@@ -166,7 +115,7 @@ DWORD CJabberProto::JSetStringCrypt(HANDLE hContact, char *valueName, const TCHA
{
char *tmp = mir_utf8encodeT(parValue);
sttCryptString(tmp);
- DWORD res = JSetString(hContact, valueName, tmp);
+ setString(hContact, valueName, tmp);
mir_free(tmp);
- return res;
+ return 0;
}
diff --git a/protocols/JabberG/src/jabber_svc.cpp b/protocols/JabberG/src/jabber_svc.cpp
index 46753f4a74..bb43eb2406 100644
--- a/protocols/JabberG/src/jabber_svc.cpp
+++ b/protocols/JabberG/src/jabber_svc.cpp
@@ -139,7 +139,7 @@ INT_PTR __cdecl CJabberProto::JabberGetAvatarInfo(WPARAM wParam, LPARAM lParam)
GetAvatarFileName(AI->hContact, tszFileName, SIZEOF(tszFileName));
_tcsncpy(AI->filename, tszFileName, SIZEOF(AI->filename));
- AI->format = (AI->hContact == NULL) ? PA_FORMAT_PNG : JGetByte(AI->hContact, "AvatarType", 0);
+ AI->format = (AI->hContact == NULL) ? PA_FORMAT_PNG : getByte(AI->hContact, "AvatarType", 0);
if (::_taccess(AI->filename, 0) == 0) {
char szSavedHash[ 256 ];
@@ -151,10 +151,10 @@ INT_PTR __cdecl CJabberProto::JabberGetAvatarInfo(WPARAM wParam, LPARAM lParam)
if ((wParam & GAIF_FORCE) != 0 && AI->hContact != NULL && m_bJabberOnline) {
DBVARIANT dbv;
- if ( !JGetStringT(AI->hContact, "jid", &dbv)) {
+ if ( !getTString(AI->hContact, "jid", &dbv)) {
JABBER_LIST_ITEM* item = ListGetItemPtr(LIST_ROSTER, dbv.ptszVal);
if (item != NULL) {
- BOOL isXVcard = JGetByte(AI->hContact, "AvatarXVcard", 0);
+ BOOL isXVcard = getByte(AI->hContact, "AvatarXVcard", 0);
TCHAR szJid[ JABBER_MAX_JID_LEN ];
if (item->resourceCount != NULL && !isXVcard) {
@@ -338,7 +338,7 @@ INT_PTR __cdecl CJabberProto::JabberSetAvatar(WPARAM, LPARAM lParam)
}
delete[] pResult;
- JSetString(NULL, "AvatarSaved", buf);
+ setString("AvatarSaved", buf);
}
return 0;
@@ -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);
- JSetStringT(NULL, "Nick", nickname);
+ setTString(NULL, "Nick", nickname);
SetServerVcard(FALSE, _T(""));
return 0;
}
@@ -590,7 +590,7 @@ INT_PTR __cdecl CJabberProto::JabberSendNudge(WPARAM wParam, LPARAM)
HANDLE hContact = (HANDLE)wParam;
DBVARIANT dbv;
- if ( !JGetStringT(hContact, "jid", &dbv)) {
+ if ( !getTString(hContact, "jid", &dbv)) {
TCHAR tszJid[ JABBER_MAX_JID_LEN ];
TCHAR *szResource = ListGetBestClientResourceNamePtr(dbv.ptszVal);
if (szResource)
@@ -788,7 +788,7 @@ HANDLE CJabberSysInterface::ContactFromJID(LPCTSTR jid)
LPTSTR CJabberSysInterface::ContactToJID(HANDLE hContact)
{
- return m_psProto->JGetStringT(hContact, m_psProto->JGetByte(hContact, "ChatRoom", 0) ? "ChatRoomID" : "jid");
+ return m_psProto->JGetStringT(hContact, m_psProto->getByte(hContact, "ChatRoom", 0) ? "ChatRoomID" : "jid");
}
LPTSTR CJabberSysInterface::GetBestResourceName(LPCTSTR jid)
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp
index 49b4e045e4..6168589863 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->JGetByte(NULL, "SaveSessionPassword", 0);
+ int bSavePassword = param->pro->getByte(NULL, "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->JSetByte(NULL, "SaveSessionPassword", param->saveOnlinePassword);
+ param->pro->setByte(NULL, "SaveSessionPassword", param->saveOnlinePassword);
GetDlgItemText(hwndDlg, IDC_PASSWORD, param->onlinePassword, SIZEOF(param->onlinePassword));
{
BOOL savePassword = IsDlgButtonChecked(hwndDlg, IDC_SAVE_PERM);
- param->pro->JSetByte(NULL, "SavePassword", savePassword);
+ param->pro->setByte(NULL, "SavePassword", savePassword);
if (savePassword) {
param->pro->JSetStringCrypt(NULL,"LoginPassword",param->onlinePassword);
param->saveOnlinePassword = TRUE;
@@ -264,9 +264,9 @@ void CJabberProto::ServerThread(ThreadData* info)
info->manualHost[SIZEOF(info->manualHost)-1] = '\0';
db_free(&dbv);
}
- info->port = JGetWord(NULL, "ManualPort", JABBER_DEFAULT_PORT);
+ info->port = getWord("ManualPort", JABBER_DEFAULT_PORT);
}
- else info->port = JGetWord(NULL, "Port", JABBER_DEFAULT_PORT);
+ else info->port = getWord("Port", JABBER_DEFAULT_PORT);
info->useSSL = m_options.UseSSL;
@@ -291,7 +291,7 @@ LBL_Exit:
if (m_szStreamId) mir_free(m_szStreamId);
m_szStreamId = NULL;
- if ( !JGetStringT(NULL, "LoginName", &dbv)) {
+ if ( !getTString(NULL, "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))
- JSetStringT(NULL, "LoginName", info->username);
+ setTString(NULL, "LoginName", info->username);
else
info->username[0] = 0;
}
@@ -326,7 +326,7 @@ LBL_FatalError:
}
if (m_options.HostNameAsResource == FALSE) {
- if ( !JGetStringT(NULL, "Resource", &dbv)) {
+ if ( !getTString(NULL, "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;
- JSetStringT(NULL, "jid", m_szJabberJID); // store jid in database
+ setTString(NULL, "jid", m_szJabberJID); // store jid in database
}
xmlStreamInitializeNow(info);
@@ -914,7 +914,7 @@ void CJabberProto::OnProcessSuccess(HXML node, ThreadData* info)
Log("Success: Logged-in.");
if ( db_get_s(NULL, m_szModuleName, "Nick", &dbv))
- JSetStringT(NULL, "Nick", info->username);
+ setTString(NULL, "Nick", info->username);
else
db_free(&dbv);
xmlStreamInitialize("after successful sasl");
@@ -1099,7 +1099,7 @@ HANDLE CJabberProto::CreateTemporaryContact(const TCHAR *szJid, JABBER_LIST_ITEM
for (int i=0; i < chatItem->resourceCount; i++) {
if ( !lstrcmp(chatItem->resource[i].resourceName, p)) {
- JSetWord(hContact, "Status", chatItem->resource[i].status);
+ setWord(hContact, "Status", chatItem->resource[i].status);
break;
}
}
@@ -1578,8 +1578,8 @@ void CJabberProto::UpdateJidDbSettings(const TCHAR *jid)
else JDeleteSetting(hContact, DBSETTING_DISPLAY_UID);
if (_tcschr(jid, '@') != NULL || m_options.ShowTransport == TRUE)
- if (JGetWord(hContact, "Status", ID_STATUS_OFFLINE) != status)
- JSetWord(hContact, "Status", (WORD)status);
+ if (getWord(hContact, "Status", ID_STATUS_OFFLINE) != status)
+ setWord(hContact, "Status", (WORD)status);
if (status == ID_STATUS_OFFLINE)
{ // remove x-status icon
@@ -1680,10 +1680,10 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData* info)
if ((xNode = xmlGetChild(xNode , "hash")) != NULL && xmlGetText(xNode) != NULL) {
JDeleteSetting(hContact,"AvatarXVcard");
Log("AvatarXVcard deleted");
- JSetStringT(hContact, "AvatarHash", xmlGetText(xNode));
+ setTString(hContact, "AvatarHash", xmlGetText(xNode));
hasAvatar = true;
DBVARIANT dbv;
- int result = JGetStringT(hContact, "AvatarSaved", &dbv);
+ int result = getTString(hContact, "AvatarSaved", &dbv);
if (result || lstrcmp(dbv.ptszVal, xmlGetText(xNode))) {
Log("Avatar was changed");
ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_STATUS, NULL, NULL);
@@ -1700,12 +1700,12 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData* info)
if ((xNode = xmlGetChild(xNode , "photo")) != NULL) {
LPCTSTR txt = xmlGetText(xNode);
if (txt != NULL && txt[0] != 0) {
- JSetByte(hContact, "AvatarXVcard", 1);
+ setByte(hContact, "AvatarXVcard", 1);
Log("AvatarXVcard set");
- JSetStringT(hContact, "AvatarHash", txt);
+ setTString(hContact, "AvatarHash", txt);
hasAvatar = true;
DBVARIANT dbv;
- int result = JGetStringT(hContact, "AvatarSaved", &dbv);
+ int result = getTString(hContact, "AvatarSaved", &dbv);
if (result || lstrcmp(dbv.ptszVal, txt)) {
Log("Avatar was changed. Using vcard-temp:x:update");
ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_STATUS, NULL, NULL);
@@ -1720,7 +1720,7 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData* info)
Log("Has no avatar");
JDeleteSetting(hContact, "AvatarHash");
DBVARIANT dbv = {0};
- if ( !JGetStringT(hContact, "AvatarSaved", &dbv)) {
+ if ( !getTString(hContact, "AvatarSaved", &dbv)) {
db_free(&dbv);
JDeleteSetting(hContact, "AvatarSaved");
ProtoBroadcastAck(hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, NULL, NULL);
diff --git a/protocols/JabberG/src/jabber_userinfo.cpp b/protocols/JabberG/src/jabber_userinfo.cpp
index ac7a4e0e79..14a39aea14 100644
--- a/protocols/JabberG/src/jabber_userinfo.cpp
+++ b/protocols/JabberG/src/jabber_userinfo.cpp
@@ -474,7 +474,7 @@ static INT_PTR CALLBACK JabberUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa
if ( !dat->item) {
DBVARIANT dbv = {0};
- if (dat->ppro->JGetStringT(dat->hContact, "jid", &dbv))
+ if (dat->ppro->getTString(dat->hContact, "jid", &dbv))
break;
if ( !(dat->item = dat->ppro->ListGetItemPtr(LIST_VCARD_TEMP, dbv.ptszVal)))
@@ -569,7 +569,7 @@ static INT_PTR CALLBACK JabberUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa
dat->ppro = (CJabberProto*)(CJabberProto*)((PSHNOTIFY*)lParam)->lParam;
if (dat->hContact != NULL) {
DBVARIANT dbv = {0};
- if (dat->ppro->JGetStringT(dat->hContact, "jid", &dbv))
+ if (dat->ppro->getTString(dat->hContact, "jid", &dbv))
break;
if ( !(dat->item = dat->ppro->ListGetItemPtr(LIST_VCARD_TEMP, dbv.ptszVal)))
@@ -654,7 +654,7 @@ static INT_PTR CALLBACK JabberUserPhotoDlgProc(HWND hwndDlg, UINT msg, WPARAM wP
photoInfo->hBitmap = NULL;
}
ShowWindow(GetDlgItem(hwndDlg, IDC_SAVE), SW_HIDE);
- if ( !photoInfo->ppro->JGetStringT(photoInfo->hContact, "jid", &dbv)) {
+ if ( !photoInfo->ppro->getTString(photoInfo->hContact, "jid", &dbv)) {
TCHAR* jid = dbv.ptszVal;
if ((item = photoInfo->ppro->ListGetItemPtr(LIST_VCARD_TEMP, jid)) == NULL)
item = photoInfo->ppro->ListGetItemPtr(LIST_ROSTER, jid);
@@ -687,7 +687,7 @@ static INT_PTR CALLBACK JabberUserPhotoDlgProc(HWND hwndDlg, UINT msg, WPARAM wP
TCHAR szFileName[MAX_PATH];
DWORD n;
- if (photoInfo->ppro->JGetStringT(photoInfo->hContact, "jid", &dbv))
+ if (photoInfo->ppro->getTString(photoInfo->hContact, "jid", &dbv))
break;
TCHAR* jid = dbv.ptszVal;
diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp
index d6895cc6cb..4fe35b0694 100644
--- a/protocols/JabberG/src/jabber_util.cpp
+++ b/protocols/JabberG/src/jabber_util.cpp
@@ -76,15 +76,15 @@ HANDLE CJabberProto::ChatRoomHContactFromJID(const TCHAR *jid)
for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
DBVARIANT dbv;
- int result = JGetStringT(hContact, "ChatRoomID", &dbv);
+ int result = getTString(hContact, "ChatRoomID", &dbv);
if (result)
- result = JGetStringT(hContact, "jid", &dbv);
+ result = getTString(hContact, "jid", &dbv);
if ( !result) {
int result;
result = lstrcmpi(jid, dbv.ptszVal);
db_free(&dbv);
- if ( !result && JGetByte(hContact, "ChatRoom", 0) != 0)
+ if ( !result && getByte(hContact, "ChatRoom", 0) != 0)
return hContact;
} }
@@ -106,9 +106,9 @@ HANDLE CJabberProto::HContactFromJID(const TCHAR *jid , BOOL bStripResource)
int result;
//safer way to check UID (coz some contact have both setting from convert to chat)
if (db_get_b(hContact, m_szModuleName, "ChatRoom",0))
- result = JGetStringT(hContact, "ChatRoomID", &dbv);
+ result = getTString(hContact, "ChatRoomID", &dbv);
else
- result = JGetStringT(hContact, "jid", &dbv);
+ result = getTString(hContact, "jid", &dbv);
if ( !result) {
int result;
@@ -116,7 +116,7 @@ HANDLE CJabberProto::HContactFromJID(const TCHAR *jid , BOOL bStripResource)
result = lstrcmpi(jid, dbv.ptszVal);
else {
if (bStripResource == 3) {
- if (JGetByte(hContact, "ChatRoom", 0))
+ if (getByte(hContact, "ChatRoom", 0))
result = lstrcmpi(jid, dbv.ptszVal); // for chat room we have to have full contact matched
else if (TRUE)
result = _tcsnicmp(jid, dbv.ptszVal, _tcslen(dbv.ptszVal));
@@ -186,7 +186,7 @@ JABBER_RESOURCE_STATUS* CJabberProto::ResourceInfoFromJID(const TCHAR *jid)
JABBER_LIST_ITEM* CJabberProto::GetItemFromContact(HANDLE hContact)
{
DBVARIANT dbv;
- if (JGetStringT(hContact, "jid", &dbv))
+ if (getTString(hContact, "jid", &dbv))
return NULL;
JABBER_LIST_ITEM *pItem = ListGetItemPtr(LIST_ROSTER, dbv.ptszVal);
@@ -611,7 +611,7 @@ void CJabberProto::SendVisibleInvisiblePresence(BOOL invisible)
if (hContact == NULL)
continue;
- WORD apparentMode = JGetWord(hContact, "ApparentMode", 0);
+ WORD apparentMode = getWord(hContact, "ApparentMode", 0);
if (invisible==TRUE && apparentMode==ID_STATUS_OFFLINE)
m_ThreadInfo->send(XmlNode(_T("presence")) << XATTR(_T("to"), item->jid) << XATTR(_T("type"), _T("invisible")));
else if (invisible==FALSE && apparentMode==ID_STATUS_ONLINE)
@@ -791,7 +791,7 @@ void CJabberProto::SendPresenceTo(int status, TCHAR* to, HXML extra, const TCHAR
if ( !m_bJabberOnline) return;
// Send <presence/> update for status (we won't handle ID_STATUS_OFFLINE here)
- short iPriority = (short)JGetWord(NULL, "Priority", 0);
+ short iPriority = (short)getWord("Priority", 0);
UpdatePriorityMenu(iPriority);
TCHAR szPriority[40];
@@ -1181,7 +1181,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 ( !JGetStringT(NULL, setting, &dbv)) {
+ if ( !getTString(NULL, setting, &dbv)) {
SendDlgItemMessage(hwndDlg, idcCombo, CB_ADDSTRING, 0, (LPARAM)dbv.ptszVal);
db_free(&dbv);
} }
@@ -1201,11 +1201,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 = JGetByte(NULL, param, 0);
+ id = getByte(NULL, param, 0);
char setting[MAXMODULELABELLENGTH];
mir_snprintf(setting, sizeof(setting), "%s%d", param, id);
- JSetStringT(NULL, setting, string);
- JSetByte(NULL, param, (id+1)%recentCount);
+ setTString(NULL, setting, string);
+ setByte(NULL, param, (id+1)%recentCount);
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -1775,12 +1775,12 @@ void __cdecl CJabberProto::LoadHttpAvatars(void* param)
AI.format = pictureType;
AI.hContact = avs[i].hContact;
- if (JGetByte(AI.hContact, "AvatarType", PA_FORMAT_UNKNOWN) != (unsigned char)pictureType) {
+ if (getByte(AI.hContact, "AvatarType", PA_FORMAT_UNKNOWN) != (unsigned char)pictureType) {
GetAvatarFileName(AI.hContact, tszFileName, SIZEOF(tszFileName));
DeleteFile(tszFileName);
}
- JSetByte(AI.hContact, "AvatarType", pictureType);
+ setByte(AI.hContact, "AvatarType", pictureType);
char cmpsha[ 41 ];
char buffer[ 41 ];
@@ -1800,7 +1800,7 @@ void __cdecl CJabberProto::LoadHttpAvatars(void* param)
if (out != NULL) {
fwrite(res->pData, res->dataLength, 1, out);
fclose(out);
- JSetString(AI.hContact, "AvatarSaved", buffer);
+ setString(AI.hContact, "AvatarSaved", buffer);
ProtoBroadcastAck(AI.hContact, ACKTYPE_AVATAR, ACKRESULT_SUCCESS, &AI, 0);
Log("Broadcast new avatar: %s",AI.filename);
}
diff --git a/protocols/JabberG/src/jabber_vcard.cpp b/protocols/JabberG/src/jabber_vcard.cpp
index fd036db767..be168868ce 100644
--- a/protocols/JabberG/src/jabber_vcard.cpp
+++ b/protocols/JabberG/src/jabber_vcard.cpp
@@ -595,7 +595,7 @@ static INT_PTR CALLBACK EditEmailDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
} }
GetDlgItemText(hwndDlg, IDC_EMAIL, text, SIZEOF(text));
mir_snprintf(idstr, SIZEOF(idstr), "e-mail%d", dat->id);
- dat->ppro->JSetStringT(NULL, idstr, text);
+ dat->ppro->setTString(NULL, idstr, text);
nFlag = 0;
if (IsDlgButtonChecked(hwndDlg, IDC_HOME)) nFlag |= JABBER_VCEMAIL_HOME;
@@ -603,7 +603,7 @@ static INT_PTR CALLBACK EditEmailDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
if (IsDlgButtonChecked(hwndDlg, IDC_INTERNET)) nFlag |= JABBER_VCEMAIL_INTERNET;
if (IsDlgButtonChecked(hwndDlg, IDC_X400)) nFlag |= JABBER_VCEMAIL_X400;
mir_snprintf(idstr, SIZEOF(idstr), "e-mailFlag%d", dat->id);
- dat->ppro->JSetWord(NULL, idstr, nFlag);
+ dat->ppro->setWord(idstr, nFlag);
}
// fall through
case IDCANCEL:
@@ -636,7 +636,7 @@ static INT_PTR CALLBACK EditPhoneDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
SetDlgItemTextA(hwndDlg, IDC_PHONE, dbv.pszVal);
db_free(&dbv);
wsprintfA(idstr, "PhoneFlag%d", dat->id);
- nFlag = dat->ppro->JGetWord(NULL, idstr, 0);
+ nFlag = dat->ppro->getWord(idstr, 0);
if (nFlag & JABBER_VCTEL_HOME) CheckDlgButton(hwndDlg, IDC_HOME, TRUE);
if (nFlag & JABBER_VCTEL_WORK) CheckDlgButton(hwndDlg, IDC_WORK, TRUE);
if (nFlag & JABBER_VCTEL_VOICE) CheckDlgButton(hwndDlg, IDC_VOICE, TRUE);
@@ -670,7 +670,7 @@ static INT_PTR CALLBACK EditPhoneDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
}
GetDlgItemTextA(hwndDlg, IDC_PHONE, text, SIZEOF(text));
wsprintfA(idstr, "Phone%d", dat->id);
- dat->ppro->JSetString(NULL, idstr, text);
+ dat->ppro->setString(idstr, text);
nFlag = 0;
if (IsDlgButtonChecked(hwndDlg, IDC_HOME)) nFlag |= JABBER_VCTEL_HOME;
if (IsDlgButtonChecked(hwndDlg, IDC_WORK)) nFlag |= JABBER_VCTEL_WORK;
@@ -685,7 +685,7 @@ static INT_PTR CALLBACK EditPhoneDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam,
if (IsDlgButtonChecked(hwndDlg, IDC_ISDN)) nFlag |= JABBER_VCTEL_ISDN;
if (IsDlgButtonChecked(hwndDlg, IDC_PCS)) nFlag |= JABBER_VCTEL_PCS;
wsprintfA(idstr, "PhoneFlag%d", dat->id);
- dat->ppro->JSetWord(NULL, idstr, nFlag);
+ dat->ppro->setWord(idstr, nFlag);
}
// fall through
case IDCANCEL:
@@ -875,12 +875,12 @@ static INT_PTR CALLBACK ContactDlgProc(HWND hwndDlg, UINT msg, WPARAM, LPARAM lP
wsprintfA(idstr, szIdTemplate, i+1);
if ( db_get_s(NULL, ppro->m_szModuleName, idstr, &dbv)) break;
wsprintfA(idstr,szIdTemplate,i);
- ppro->JSetString(NULL, idstr, dbv.pszVal);
+ ppro->setString(idstr, dbv.pszVal);
wsprintfA(idstr, szFlagTemplate, i+1);
db_free(&dbv);
- nFlag = ppro->JGetWord(NULL, idstr, 0);
+ nFlag = ppro->getWord(idstr, 0);
wsprintfA(idstr, szFlagTemplate, i);
- ppro->JSetWord(NULL, idstr, nFlag);
+ ppro->setWord(idstr, nFlag);
}
wsprintfA(idstr, szIdTemplate, i);
ppro->JDeleteSetting(NULL, idstr);
@@ -934,44 +934,44 @@ void CJabberProto::SaveVcardToDB(HWND hwndPage, int iPage)
switch (iPage) {
case 0:
GetDlgItemText(hwndPage, IDC_FULLNAME, text, SIZEOF(text));
- JSetStringT(NULL, "FullName", text);
+ setTString(NULL, "FullName", text);
GetDlgItemText(hwndPage, IDC_NICKNAME, text, SIZEOF(text));
- JSetStringT(NULL, "Nick", text);
+ setTString(NULL, "Nick", text);
GetDlgItemText(hwndPage, IDC_FIRSTNAME, text, SIZEOF(text));
- JSetStringT(NULL, "FirstName", text);
+ setTString(NULL, "FirstName", text);
GetDlgItemText(hwndPage, IDC_MIDDLE, text, SIZEOF(text));
- JSetStringT(NULL, "MiddleName", text);
+ setTString(NULL, "MiddleName", text);
GetDlgItemText(hwndPage, IDC_LASTNAME, text, SIZEOF(text));
- JSetStringT(NULL, "LastName", text);
+ setTString(NULL, "LastName", text);
GetDlgItemText(hwndPage, IDC_BIRTH, text, SIZEOF(text));
- JSetStringT(NULL, "BirthDate", text);
+ setTString(NULL, "BirthDate", text);
switch(SendMessage(GetDlgItem(hwndPage, IDC_GENDER), CB_GETCURSEL, 0, 0)) {
- case 0: JSetString(NULL, "GenderString", "Male"); break;
- case 1: JSetString(NULL, "GenderString", "Female"); break;
- default: JSetString(NULL, "GenderString", ""); break;
+ case 0: setString("GenderString", "Male"); break;
+ case 1: setString("GenderString", "Female"); break;
+ default: setString("GenderString", ""); break;
}
GetDlgItemText(hwndPage, IDC_OCCUPATION, text, SIZEOF(text));
- JSetStringT(NULL, "Role", text);
+ setTString(NULL, "Role", text);
GetDlgItemText(hwndPage, IDC_HOMEPAGE, text, SIZEOF(text));
- JSetStringT(NULL, "Homepage", text);
+ setTString(NULL, "Homepage", text);
break;
// Page 1: Home
case 1:
GetDlgItemText(hwndPage, IDC_ADDRESS1, text, SIZEOF(text));
- JSetStringT(NULL, "Street", text);
+ setTString(NULL, "Street", text);
GetDlgItemText(hwndPage, IDC_ADDRESS2, text, SIZEOF(text));
- JSetStringT(NULL, "Street2", text);
+ setTString(NULL, "Street2", text);
GetDlgItemText(hwndPage, IDC_CITY, text, SIZEOF(text));
- JSetStringT(NULL, "City", text);
+ setTString(NULL, "City", text);
GetDlgItemText(hwndPage, IDC_STATE, text, SIZEOF(text));
- JSetStringT(NULL, "State", text);
+ setTString(NULL, "State", text);
GetDlgItemText(hwndPage, IDC_ZIP, text, SIZEOF(text));
- JSetStringT(NULL, "ZIP", text);
+ setTString(NULL, "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);
- JSetStringT(NULL, "Country", country);
+ setTString(NULL, "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));
- JSetStringT(NULL, "Company", text);
+ setTString(NULL, "Company", text);
GetDlgItemText(hwndPage, IDC_DEPARTMENT, text, SIZEOF(text));
- JSetStringT(NULL, "CompanyDepartment", text);
+ setTString(NULL, "CompanyDepartment", text);
GetDlgItemText(hwndPage, IDC_TITLE, text, SIZEOF(text));
- JSetStringT(NULL, "CompanyPosition", text);
+ setTString(NULL, "CompanyPosition", text);
GetDlgItemText(hwndPage, IDC_ADDRESS1, text, SIZEOF(text));
- JSetStringT(NULL, "CompanyStreet", text);
+ setTString(NULL, "CompanyStreet", text);
GetDlgItemText(hwndPage, IDC_ADDRESS2, text, SIZEOF(text));
- JSetStringT(NULL, "CompanyStreet2", text);
+ setTString(NULL, "CompanyStreet2", text);
GetDlgItemText(hwndPage, IDC_CITY, text, SIZEOF(text));
- JSetStringT(NULL, "CompanyCity", text);
+ setTString(NULL, "CompanyCity", text);
GetDlgItemText(hwndPage, IDC_STATE, text, SIZEOF(text));
- JSetStringT(NULL, "CompanyState", text);
+ setTString(NULL, "CompanyState", text);
GetDlgItemText(hwndPage, IDC_ZIP, text, SIZEOF(text));
- JSetStringT(NULL, "CompanyZIP", text);
+ setTString(NULL, "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);
- JSetStringT(NULL, "CompanyCountry", country);
+ setTString(NULL, "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));
- JSetStringT(NULL, "About", text);
+ setTString(NULL, "About", text);
break;
// Page 5: Contacts
@@ -1113,7 +1113,7 @@ void CJabberProto::SetServerVcard(BOOL bPhotoChanged, TCHAR* szPhotoFileName)
AppendVcardFromDB(n, "NUMBER", idstr);
wsprintfA(idstr, "PhoneFlag%d", i);
- nFlag = JGetWord(NULL, idstr, 0);
+ nFlag = getWord(idstr, 0);
if (nFlag & JABBER_VCTEL_HOME) n << XCHILD(_T("HOME"));
if (nFlag & JABBER_VCTEL_WORK) n << XCHILD(_T("WORK"));
if (nFlag & JABBER_VCTEL_VOICE) n << XCHILD(_T("VOICE"));
@@ -1191,8 +1191,8 @@ void CJabberProto::SetServerVcard(BOOL bPhotoChanged, TCHAR* szPhotoFileName)
CopyFile(szFileName, szAvatarName, FALSE);
}
- JSetString(NULL, "AvatarHash", buf);
- JSetString(NULL, "AvatarSaved", buf);
+ setString("AvatarHash", buf);
+ setString("AvatarSaved", buf);
} }
mir_free(buffer);
}
diff --git a/protocols/JabberG/src/jabber_xstatus.cpp b/protocols/JabberG/src/jabber_xstatus.cpp
index 6cbedb9267..922030b6dd 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->JSetStringT(NULL, szSetting, txt);
+ m_proto->setTString(NULL, 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->JGetStringT(NULL, szSetting, &dbv)) {
+ if ( !m_proto->getTString(NULL, szSetting, &dbv)) {
m_txtDescription.SetText(dbv.ptszVal);
db_free(&dbv);
}
@@ -726,10 +726,10 @@ void CPepMood::SetMood(HANDLE hContact, const TCHAR *szMood, const TCHAR *szText
else SetExtraIcon(hContact, mood < 0 ? NULL : g_arrMoods[mood].szTag);
if (szMood) {
- m_proto->JSetByte(hContact, DBSETTING_XSTATUSID, mood);
- m_proto->JSetStringT(hContact, DBSETTING_XSTATUSNAME, TranslateTS(g_arrMoods[mood].szName));
+ m_proto->setByte(hContact, DBSETTING_XSTATUSID, mood);
+ m_proto->setTString(hContact, DBSETTING_XSTATUSNAME, TranslateTS(g_arrMoods[mood].szName));
if (szText)
- m_proto->JSetStringT(hContact, DBSETTING_XSTATUSMSG, szText);
+ m_proto->setTString(hContact, DBSETTING_XSTATUSMSG, szText);
else
m_proto->JDeleteSetting(hContact, DBSETTING_XSTATUSMSG);
@@ -1234,7 +1234,7 @@ void CJabberProto::SetContactTune(HANDLE hContact, LPCTSTR szArtist, LPCTSTR szL
mir_sntprintf(szListeningTo, 2047, _T("%s - %s"), szTitle ? szTitle : _T(""), szArtist ? szArtist : _T(""));
}
- JSetStringT(hContact, "ListeningTo", szListeningTo);
+ setTString(hContact, "ListeningTo", szListeningTo);
char tuneIcon[128];
mir_snprintf(tuneIcon, SIZEOF(tuneIcon), "%s_%s", m_szModuleName, "main");