diff options
author | George Hazan <george.hazan@gmail.com> | 2013-07-20 18:37:03 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2013-07-20 18:37:03 +0000 |
commit | 4ad5767f652e0ffd3ebf7df8d8f62a682277faa1 (patch) | |
tree | 009f4d4267d0d4e451b74140125b5816701860fb /protocols/JabberG/src/jabber_opt.cpp | |
parent | 8761e793032de3e266a0cb9582327367c6172467 (diff) |
- numerous fixes for ineffective xmlGetText() calls;
- common picture type detection code extracted to the separate function;
- code cleanup
git-svn-id: http://svn.miranda-ng.org/main/trunk@5431 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/JabberG/src/jabber_opt.cpp')
-rw-r--r-- | protocols/JabberG/src/jabber_opt.cpp | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/protocols/JabberG/src/jabber_opt.cpp b/protocols/JabberG/src/jabber_opt.cpp index a929050869..74a5551725 100644 --- a/protocols/JabberG/src/jabber_opt.cpp +++ b/protocols/JabberG/src/jabber_opt.cpp @@ -459,7 +459,7 @@ protected: m_cbServer.AddString(TranslateT("Loading..."));
// fill predefined resources
- TCHAR* szResources[] = { _T("Home"), _T("Work"), _T("Office"), _T("Miranda") };
+ TCHAR *szResources[] = { _T("Home"), _T("Work"), _T("Office"), _T("Miranda") };
for (i = 0; i < SIZEOF(szResources); i++)
m_cbResource.AddString(szResources[i]);
@@ -769,7 +769,7 @@ private: NETLIBHTTPREQUEST *result = (NETLIBHTTPREQUEST *)CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM)wnd->GetProto()->m_hNetlibUser, (LPARAM)&request);
if (result) {
if (result->resultCode == 200 && result->dataLength && result->pData) {
- TCHAR* buf = mir_a2t(result->pData);
+ TCHAR *buf = mir_a2t(result->pData);
XmlNode node(buf, NULL, NULL);
if (node) {
HXML queryNode = xmlGetChild(node, _T("query"));
@@ -1047,10 +1047,7 @@ void CJabberProto::_RosterHandleGetRequest(HXML node) const TCHAR *name = xmlGetAttrValue(item, _T("name"));
const TCHAR *subscription = xmlGetAttrValue(item, _T("subscription"));
- const TCHAR *group = NULL;
- HXML groupNode = xmlGetChild(item , "group");
- if (groupNode)
- group = xmlGetText(groupNode);
+ const TCHAR *group = xmlGetText( xmlGetChild(item, "group"));
_RosterInsertListItem(hList, jid, name, group, subscription, TRUE);
}
@@ -1135,19 +1132,16 @@ void CJabberProto::_RosterHandleGetRequest(HXML node) BOOL bPushed = itemRoster ? TRUE : FALSE;
if ( !bPushed) {
const TCHAR *rosterName = xmlGetAttrValue(itemRoster, _T("name"));
- if ((rosterName!=NULL || name[0]!=_T('\0')) && lstrcmpi(rosterName,name))
+ if ((rosterName != NULL || name[0]!=_T('\0')) && lstrcmpi(rosterName,name))
bPushed=TRUE;
if ( !bPushed) {
rosterName = xmlGetAttrValue(itemRoster, _T("subscription"));
- if ((rosterName!=NULL || subscr[0]!=_T('\0')) && lstrcmpi(rosterName,subscr))
+ if ((rosterName != NULL || subscr[0]!=_T('\0')) && lstrcmpi(rosterName,subscr))
bPushed=TRUE;
}
if ( !bPushed) {
- HXML groupNode = xmlGetChild(itemRoster , "group");
- const TCHAR *rosterGroup=NULL;
- if (groupNode != NULL)
- rosterGroup = xmlGetText(groupNode);
- if ((rosterGroup!=NULL || group[0]!=_T('\0')) && lstrcmpi(rosterGroup,group))
+ const TCHAR *rosterGroup = xmlGetText( xmlGetChild(itemRoster, "group"));
+ if ((rosterGroup != NULL || group[0]!=_T('\0')) && lstrcmpi(rosterGroup,group))
bPushed=TRUE;
}
}
@@ -1340,7 +1334,7 @@ void CJabberProto::_RosterImportFromFile(HWND hwndDlg) fclose(fp);
_RosterListClear(hwndDlg);
- TCHAR* newBuf = mir_utf8decodeT(buffer);
+ TCHAR *newBuf = mir_utf8decodeT(buffer);
mir_free(buffer);
int nBytesProcessed = 0;
@@ -1681,7 +1675,7 @@ protected: m_cbServer.AddString(TranslateT("Loading..."));
// fill predefined resources
- TCHAR* szResources[] = { _T("Home"), _T("Work"), _T("Office"), _T("Miranda") };
+ TCHAR *szResources[] = { _T("Home"), _T("Work"), _T("Office"), _T("Miranda") };
for (i = 0; i < SIZEOF(szResources); i++)
m_cbResource.AddString(szResources[i]);
@@ -2235,7 +2229,7 @@ void CJabberDlgAccMgrUI::QueryServerListThread(void *arg) NETLIBHTTPREQUEST *result = (NETLIBHTTPREQUEST *)CallService(MS_NETLIB_HTTPTRANSACTION, (WPARAM)wnd->GetProto()->m_hNetlibUser, (LPARAM)&request);
if (result && IsWindow(hwnd)) {
if ((result->resultCode == 200) && result->dataLength && result->pData) {
- TCHAR* ptszText = mir_a2t(result->pData);
+ TCHAR *ptszText = mir_a2t(result->pData);
XmlNode node(ptszText, NULL, NULL);
if (node) {
HXML queryNode = xmlGetChild(node, _T("query"));
|