summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-09-21 17:21:32 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-09-21 17:21:32 +0000
commit01d131efd5d40016f07d51c0a0e9451204aa6dc8 (patch)
treead15f7aac7273bfc36f03703b5922005425d295c /protocols/JabberG/src
parentd8850660bcbec0677f4b550f716b9d2632e4d970 (diff)
"two for the price of one" variables' schema removed
git-svn-id: http://svn.miranda-ng.org/main/trunk@6163 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/JabberG/src')
-rw-r--r--protocols/JabberG/src/jabber_caps.cpp54
-rw-r--r--protocols/JabberG/src/jabber_list.cpp2
-rw-r--r--protocols/JabberG/src/jabber_list.h16
-rw-r--r--protocols/JabberG/src/jabber_misc.cpp4
-rw-r--r--protocols/JabberG/src/jabber_proto.cpp14
-rw-r--r--protocols/JabberG/src/jabber_thread.cpp8
-rw-r--r--protocols/JabberG/src/jabber_userinfo.cpp59
7 files changed, 71 insertions, 86 deletions
diff --git a/protocols/JabberG/src/jabber_caps.cpp b/protocols/JabberG/src/jabber_caps.cpp
index 3c3bf79449..252042966a 100644
--- a/protocols/JabberG/src/jabber_caps.cpp
+++ b/protocols/JabberG/src/jabber_caps.cpp
@@ -110,26 +110,22 @@ void CJabberProto::OnIqResultCapsDiscoInfoSI(HXML, CJabberIqInfo* pInfo)
for (int i = 1; (xform = xmlGetNthChild(query, _T("x"), i)) != NULL; i++) {
TCHAR *szFormTypeValue = XPath(xform, _T("field[@var='FORM_TYPE']/value"));
if (szFormTypeValue && !_tcscmp(szFormTypeValue, _T("urn:xmpp:dataforms:softwareinfo"))) {
- if (r->m_pSoftwareInfo)
- delete r->m_pSoftwareInfo;
- r->m_pSoftwareInfo = new JABBER_XEP0232_SOFTWARE_INFO;
- if (r->m_pSoftwareInfo) {
- TCHAR *szTmp = XPath(xform, _T("field[@var='os']/value"));
- if (szTmp)
- r->m_pSoftwareInfo->tszOs = mir_tstrdup(szTmp);
- szTmp = XPath(xform, _T("field[@var='os_version']/value"));
- if (szTmp)
- r->m_pSoftwareInfo->tszOsVersion = mir_tstrdup(szTmp);
- szTmp = XPath(xform, _T("field[@var='software']/value"));
- if (szTmp)
- r->m_pSoftwareInfo->tszSoftware = mir_tstrdup(szTmp);
- szTmp = XPath(xform, _T("field[@var='software_version']/value"));
- if (szTmp)
- r->m_pSoftwareInfo->tszSoftwareVersion = mir_tstrdup(szTmp);
- szTmp = XPath(xform, _T("field[@var='x-miranda-core-version']/value"));
- if (szTmp)
- r->m_pSoftwareInfo->tszXMirandaCoreVersion = mir_tstrdup(szTmp);
- }
+ TCHAR *szTmp = XPath(xform, _T("field[@var='os']/value"));
+ if (szTmp)
+ r->m_tszOs = mir_tstrdup(szTmp);
+ szTmp = XPath(xform, _T("field[@var='os_version']/value"));
+ if (szTmp)
+ r->m_tszOsVersion = mir_tstrdup(szTmp);
+ szTmp = XPath(xform, _T("field[@var='software']/value"));
+ if (szTmp)
+ r->m_tszSoftware = mir_tstrdup(szTmp);
+ szTmp = XPath(xform, _T("field[@var='software_version']/value"));
+ if (szTmp)
+ r->m_tszSoftwareVersion = mir_tstrdup(szTmp);
+ szTmp = XPath(xform, _T("field[@var='x-miranda-core-version']/value"));
+ if (szTmp)
+ r->m_tszXMirandaCoreVersion = mir_tstrdup(szTmp);
+
JabberUserInfoUpdate(pInfo->GetHContact());
}
}
@@ -158,7 +154,7 @@ void CJabberProto::OnIqResultCapsDiscoInfo(HXML, CJabberIqInfo* pInfo)
}
// no version info support and no XEP-0115 support?
- if (r && r->m_dwVersionRequestTime == -1 && !r->m_tszVersion && !r->m_tszSoftware && !r->m_tszCapsNode) {
+ if (r && r->m_dwVersionRequestTime == -1 && !r->m_tszSoftwareVersion && !r->m_tszSoftware && !r->m_tszCapsNode) {
r->m_jcbCachedCaps = jcbCaps;
r->m_dwDiscoInfoRequestTime = -1;
return;
@@ -172,7 +168,7 @@ void CJabberProto::OnIqResultCapsDiscoInfo(HXML, CJabberIqInfo* pInfo)
}
else {
// no version info support and no XEP-0115 support?
- if (r && r->m_dwVersionRequestTime == -1 && !r->m_tszVersion && !r->m_tszSoftware && !r->m_tszCapsNode) {
+ if (r && r->m_dwVersionRequestTime == -1 && !r->m_tszSoftwareVersion && !r->m_tszSoftware && !r->m_tszCapsNode) {
r->m_jcbCachedCaps = JABBER_RESOURCE_CAPS_NONE;
r->m_dwDiscoInfoRequestTime = -1;
return;
@@ -302,7 +298,7 @@ JabberCapsBits CJabberProto::GetResourceCapabilites(const TCHAR *jid, BOOL appen
// capability mode (version request + service discovery)
// no version info:
- if ( !r->m_tszVersion && !r->m_tszSoftware) {
+ if ( !r->m_tszSoftwareVersion && !r->m_tszSoftware) {
// version request not sent:
if ( !r->m_dwVersionRequestTime) {
// send version query
@@ -350,23 +346,23 @@ JabberCapsBits CJabberProto::GetResourceCapabilites(const TCHAR *jid, BOOL appen
}
// version info available:
- if (r->m_tszSoftware && r->m_tszVersion) {
- JabberCapsBits jcbMainCaps = m_clientCapsManager.GetClientCaps(r->m_tszSoftware, r->m_tszVersion);
+ if (r->m_tszSoftware && r->m_tszSoftwareVersion) {
+ JabberCapsBits jcbMainCaps = m_clientCapsManager.GetClientCaps(r->m_tszSoftware, r->m_tszSoftwareVersion);
if (jcbMainCaps == JABBER_RESOURCE_CAPS_ERROR) {
// Bombus hack:
if ( !_tcscmp(r->m_tszSoftware, _T("Bombus")) || !_tcscmp(r->m_tszSoftware, _T("BombusMod"))) {
jcbMainCaps = JABBER_CAPS_SI|JABBER_CAPS_SI_FT|JABBER_CAPS_IBB|JABBER_CAPS_MESSAGE_EVENTS|JABBER_CAPS_MESSAGE_EVENTS_NO_DELIVERY|JABBER_CAPS_DATA_FORMS|JABBER_CAPS_LAST_ACTIVITY|JABBER_CAPS_VERSION|JABBER_CAPS_COMMANDS|JABBER_CAPS_VCARD_TEMP;
- m_clientCapsManager.SetClientCaps(r->m_tszSoftware, r->m_tszVersion, jcbMainCaps);
+ m_clientCapsManager.SetClientCaps(r->m_tszSoftware, r->m_tszSoftwareVersion, jcbMainCaps);
}
// Neos hack:
else if ( !_tcscmp(r->m_tszSoftware, _T("neos"))) {
jcbMainCaps = JABBER_CAPS_OOB|JABBER_CAPS_MESSAGE_EVENTS|JABBER_CAPS_MESSAGE_EVENTS_NO_DELIVERY|JABBER_CAPS_LAST_ACTIVITY|JABBER_CAPS_VERSION;
- m_clientCapsManager.SetClientCaps(r->m_tszSoftware, r->m_tszVersion, jcbMainCaps);
+ m_clientCapsManager.SetClientCaps(r->m_tszSoftware, r->m_tszSoftwareVersion, jcbMainCaps);
}
// sim hack:
else if ( !_tcscmp(r->m_tszSoftware, _T("sim"))) {
jcbMainCaps = JABBER_CAPS_OOB|JABBER_CAPS_VERSION|JABBER_CAPS_MESSAGE_EVENTS|JABBER_CAPS_MESSAGE_EVENTS_NO_DELIVERY;
- m_clientCapsManager.SetClientCaps(r->m_tszSoftware, r->m_tszVersion, jcbMainCaps);
+ m_clientCapsManager.SetClientCaps(r->m_tszSoftware, r->m_tszSoftwareVersion, jcbMainCaps);
} }
else if (jcbMainCaps == JABBER_RESOURCE_CAPS_UNINIT) {
@@ -374,7 +370,7 @@ JabberCapsBits CJabberProto::GetResourceCapabilites(const TCHAR *jid, BOOL appen
CJabberIqInfo *pInfo = m_iqManager.AddHandler(&CJabberProto::OnIqResultCapsDiscoInfo, JABBER_IQ_TYPE_GET, fullJid, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_CHILD_TAG_NODE);
pInfo->SetTimeout(JABBER_RESOURCE_CAPS_QUERY_TIMEOUT);
- m_clientCapsManager.SetClientCaps(r->m_tszSoftware, r->m_tszVersion, JABBER_RESOURCE_CAPS_IN_PROGRESS, pInfo->GetIqId());
+ m_clientCapsManager.SetClientCaps(r->m_tszSoftware, r->m_tszSoftwareVersion, JABBER_RESOURCE_CAPS_IN_PROGRESS, pInfo->GetIqId());
r->m_dwDiscoInfoRequestTime = pInfo->GetRequestTime();
XmlNodeIq iq(pInfo);
diff --git a/protocols/JabberG/src/jabber_list.cpp b/protocols/JabberG/src/jabber_list.cpp
index dc0539869b..a6f8e6ffb1 100644
--- a/protocols/JabberG/src/jabber_list.cpp
+++ b/protocols/JabberG/src/jabber_list.cpp
@@ -71,8 +71,6 @@ JABBER_RESOURCE_STATUS::JABBER_RESOURCE_STATUS() :
JABBER_RESOURCE_STATUS::~JABBER_RESOURCE_STATUS()
{
- if (m_pSoftwareInfo)
- delete m_pSoftwareInfo;
}
void JABBER_RESOURCE_STATUS::AddRef()
diff --git a/protocols/JabberG/src/jabber_list.h b/protocols/JabberG/src/jabber_list.h
index 38f22a79ef..08c82bbc1b 100644
--- a/protocols/JabberG/src/jabber_list.h
+++ b/protocols/JabberG/src/jabber_list.h
@@ -67,12 +67,6 @@ typedef enum { // initial default to RSMODE_LASTSEEN
RSMODE_MANUAL // specify resource manually (see the defaultResource field - must not be NULL)
} JABBER_RESOURCE_MODE;
-
-struct JABBER_XEP0232_SOFTWARE_INFO : public MZeroedObject
-{
- ptrT tszOs, tszOsVersion, tszSoftware, tszSoftwareVersion, tszXMirandaCoreVersion;
-};
-
class JABBER_RESOURCE_STATUS : public MZeroedObject
{
LONG m_refCount;
@@ -100,17 +94,17 @@ public:
ptrT m_tszCapsNode;
ptrT m_tszCapsVer;
ptrT m_tszCapsExt;
- ptrT m_tszSoftware;
- ptrT m_tszVersion;
- ptrT m_tszSystem;
DWORD m_dwVersionRequestTime, m_dwDiscoInfoRequestTime;
+
JabberCapsBits m_jcbCachedCaps;
JabberCapsBits m_jcbManualDiscoveredCaps;
+ // XEP-232 support
+ ptrT m_tszOs, m_tszOsVersion;
+ ptrT m_tszSoftware, m_tszSoftwareVersion, m_tszXMirandaCoreVersion;
+
// XEP-0085 gone event support
BOOL m_bMessageSessionActive;
-
- JABBER_XEP0232_SOFTWARE_INFO *m_pSoftwareInfo;
};
class pResourceStatus
diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp
index 781d0ebe7f..162c173d18 100644
--- a/protocols/JabberG/src/jabber_misc.cpp
+++ b/protocols/JabberG/src/jabber_misc.cpp
@@ -403,10 +403,10 @@ void CJabberProto::FormatMirVer(pResourceStatus &resource, TCHAR *buf, int bufSi
// jabber:iq:version info requested and exists?
if (resource->m_dwVersionRequestTime && resource->m_tszSoftware) {
Log("JabberUpdateMirVer: for iq:version rc %S: %S", resource->m_tszResourceName, resource->m_tszSoftware);
- if ( !resource->m_tszVersion || _tcsstr(resource->m_tszSoftware, resource->m_tszVersion))
+ if ( !resource->m_tszSoftwareVersion || _tcsstr(resource->m_tszSoftware, resource->m_tszSoftwareVersion))
lstrcpyn(buf, resource->m_tszSoftware, bufSize);
else
- mir_sntprintf(buf, bufSize, _T("%s %s"), resource->m_tszSoftware, resource->m_tszVersion);
+ mir_sntprintf(buf, bufSize, _T("%s %s"), resource->m_tszSoftware, resource->m_tszSoftwareVersion);
}
// no version info and no caps info? set MirVer = resource name
else if ( !resource->m_tszCapsNode || !resource->m_tszCapsVer) {
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp
index 521d68781e..9f7afeab88 100644
--- a/protocols/JabberG/src/jabber_proto.cpp
+++ b/protocols/JabberG/src/jabber_proto.cpp
@@ -739,7 +739,7 @@ int __cdecl CJabberProto::GetInfo(HANDLE hContact, int /*infoType*/)
if (item && item->arResources.getCount()) {
for (int i = 0; i < item->arResources.getCount(); i++) {
- JABBER_RESOURCE_STATUS *r = item->arResources[i];
+ pResourceStatus r(item->arResources[i]);
TCHAR szp1[JABBER_MAX_JID_LEN], tmp[JABBER_MAX_JID_LEN];
JabberStripJid(jid, szp1, SIZEOF(szp1));
mir_sntprintf(tmp, SIZEOF(tmp), _T("%s/%s"), szp1, r->m_tszResourceName);
@@ -748,17 +748,17 @@ int __cdecl CJabberProto::GetInfo(HANDLE hContact, int /*infoType*/)
iq3 << XQUERY(JABBER_FEAT_LAST_ACTIVITY);
m_ThreadInfo->send(iq3);
+ if (r->m_jcbCachedCaps & JABBER_CAPS_DISCO_INFO) {
+ XmlNodeIq iq5(m_iqManager.AddHandler(&CJabberProto::OnIqResultCapsDiscoInfoSI, JABBER_IQ_TYPE_GET, tmp, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_CHILD_TAG_NODE | JABBER_IQ_PARSE_HCONTACT));
+ iq5 << XQUERY(JABBER_FEAT_DISCO_INFO);
+ m_ThreadInfo->send(iq5);
+ }
+
if ( !r->m_dwVersionRequestTime) {
XmlNodeIq iq4(m_iqManager.AddHandler(&CJabberProto::OnIqResultVersion, JABBER_IQ_TYPE_GET, tmp, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_HCONTACT | JABBER_IQ_PARSE_CHILD_TAG_NODE));
iq4 << XQUERY(JABBER_FEAT_VERSION);
m_ThreadInfo->send(iq4);
}
-
- if ( !r->m_pSoftwareInfo) {
- XmlNodeIq iq5(m_iqManager.AddHandler(&CJabberProto::OnIqResultCapsDiscoInfoSI, JABBER_IQ_TYPE_GET, tmp, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_CHILD_TAG_NODE | JABBER_IQ_PARSE_HCONTACT));
- iq5 << XQUERY(JABBER_FEAT_DISCO_INFO);
- m_ThreadInfo->send(iq5);
- }
}
}
else if ( !item->m_pItemResource->m_dwVersionRequestTime) {
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp
index 7c880d01c9..1f68a2eee7 100644
--- a/protocols/JabberG/src/jabber_thread.cpp
+++ b/protocols/JabberG/src/jabber_thread.cpp
@@ -1813,8 +1813,8 @@ void CJabberProto::OnIqResultVersion(HXML /*node*/, CJabberIqInfo *pInfo)
r->m_dwVersionRequestTime = -1;
r->m_tszSoftware = NULL;
- r->m_tszVersion = NULL;
- r->m_tszSystem = NULL;
+ r->m_tszSoftwareVersion = NULL;
+ r->m_tszOs = NULL;
HXML queryNode = pInfo->GetChildNode();
@@ -1823,9 +1823,9 @@ void CJabberProto::OnIqResultVersion(HXML /*node*/, CJabberIqInfo *pInfo)
if ((n = xmlGetChild(queryNode , "name")) != NULL && xmlGetText(n))
r->m_tszSoftware = mir_tstrdup(xmlGetText(n));
if ((n = xmlGetChild(queryNode , "version")) != NULL && xmlGetText(n))
- r->m_tszVersion = mir_tstrdup(xmlGetText(n));
+ r->m_tszSoftwareVersion = mir_tstrdup(xmlGetText(n));
if ((n = xmlGetChild(queryNode , "os")) != NULL && xmlGetText(n))
- r->m_tszSystem = mir_tstrdup(xmlGetText(n));
+ r->m_tszOs = mir_tstrdup(xmlGetText(n));
}
GetResourceCapabilites(pInfo->GetFrom(), TRUE);
diff --git a/protocols/JabberG/src/jabber_userinfo.cpp b/protocols/JabberG/src/jabber_userinfo.cpp
index c79e6e31b9..d5fbce60c3 100644
--- a/protocols/JabberG/src/jabber_userinfo.cpp
+++ b/protocols/JabberG/src/jabber_userinfo.cpp
@@ -212,28 +212,28 @@ static void sttFillResourceInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM hti
{
TCHAR buf[256];
HTREEITEM htiResource = htiRoot;
- JABBER_RESOURCE_STATUS *res = resource ? item->arResources[resource-1] : item->m_pItemResource;
+ pResourceStatus r = resource ? item->arResources[resource-1] : item->m_pItemResource;
- if (res->m_tszResourceName && *res->m_tszResourceName)
- htiResource = sttFillInfoLine(hwndTree, htiRoot, LoadSkinnedProtoIcon(ppro->m_szModuleName, res->m_iStatus),
- TranslateT("Resource"), res->m_tszResourceName, sttInfoLineId(resource, INFOLINE_NAME), true);
+ if (r->m_tszResourceName && *r->m_tszResourceName)
+ htiResource = sttFillInfoLine(hwndTree, htiRoot, LoadSkinnedProtoIcon(ppro->m_szModuleName, r->m_iStatus),
+ TranslateT("Resource"), r->m_tszResourceName, sttInfoLineId(resource, INFOLINE_NAME), true);
// StatusMsg
sttFillInfoLine(hwndTree, htiResource, NULL /*LoadSkinnedIcon(SKINICON_EVENT_MESSAGE)*/,
- TranslateT("Message"), res->m_tszStatusMessage ? res->m_tszStatusMessage : TranslateT("<not specified>"),
+ TranslateT("Message"), r->m_tszStatusMessage ? r->m_tszStatusMessage : TranslateT("<not specified>"),
sttInfoLineId(resource, INFOLINE_MESSAGE));
// Software
HICON hIcon = NULL;
- if (ServiceExists(MS_FP_GETCLIENTICONT)) {
- if (res->m_tszSoftware != NULL) {
- mir_sntprintf(buf, SIZEOF(buf), _T("%s %s"), res->m_tszSoftware, res->m_tszVersion);
+ if ( ServiceExists(MS_FP_GETCLIENTICONT)) {
+ if (r->m_tszSoftware != NULL) {
+ mir_sntprintf(buf, SIZEOF(buf), _T("%s %s"), r->m_tszSoftware, r->m_tszSoftwareVersion);
hIcon = Finger_GetClientIcon(buf, 0);
}
}
sttFillInfoLine(hwndTree, htiResource, hIcon, TranslateT("Software"),
- res->m_tszSoftware ? res->m_tszSoftware : TranslateT("<not specified>"),
+ r->m_tszSoftware ? r->m_tszSoftware : TranslateT("<not specified>"),
sttInfoLineId(resource, INFOLINE_SOFTWARE));
if (hIcon)
@@ -241,26 +241,26 @@ static void sttFillResourceInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM hti
// Version
sttFillInfoLine(hwndTree, htiResource, NULL, TranslateT("Version"),
- res->m_tszVersion ? res->m_tszVersion : TranslateT("<not specified>"),
+ r->m_tszSoftwareVersion ? r->m_tszSoftwareVersion : TranslateT("<not specified>"),
sttInfoLineId(resource, INFOLINE_VERSION));
// System
sttFillInfoLine(hwndTree, htiResource, NULL, TranslateT("System"),
- res->m_tszSystem ? res->m_tszSystem : TranslateT("<not specified>"),
+ r->m_tszOs ? r->m_tszOs : TranslateT("<not specified>"),
sttInfoLineId(resource, INFOLINE_SYSTEM));
// Resource priority
TCHAR szPriority[128];
- mir_sntprintf(szPriority, SIZEOF(szPriority), _T("%d"), (int)res->m_iPriority);
+ mir_sntprintf(szPriority, SIZEOF(szPriority), _T("%d"), (int)r->m_iPriority);
sttFillInfoLine(hwndTree, htiResource, NULL, TranslateT("Resource priority"), szPriority, sttInfoLineId(resource, INFOLINE_PRIORITY));
// Idle
- if (res->m_dwIdleStartTime > 0) {
- lstrcpyn(buf, _tctime(&res->m_dwIdleStartTime), SIZEOF(buf));
+ if (r->m_dwIdleStartTime > 0) {
+ lstrcpyn(buf, _tctime(&r->m_dwIdleStartTime), SIZEOF(buf));
int len = lstrlen(buf);
if (len > 0) buf[len-1] = 0;
}
- else if ( !res->m_dwIdleStartTime)
+ else if ( !r->m_dwIdleStartTime)
lstrcpyn(buf, TranslateT("unknown"), SIZEOF(buf));
else
lstrcpyn(buf, TranslateT("<not specified>"), SIZEOF(buf));
@@ -268,7 +268,7 @@ static void sttFillResourceInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM hti
sttFillInfoLine(hwndTree, htiResource, NULL, TranslateT("Idle since"), buf, sttInfoLineId(resource, INFOLINE_IDLE));
// caps
- mir_sntprintf(buf, SIZEOF(buf), _T("%s/%s"), item->jid, res->m_tszResourceName);
+ mir_sntprintf(buf, SIZEOF(buf), _T("%s/%s"), item->jid, r->m_tszResourceName);
JabberCapsBits jcb = ppro->GetResourceCapabilites(buf, TRUE);
if ( !(jcb & JABBER_RESOURCE_CAPS_ERROR)) {
@@ -296,21 +296,18 @@ static void sttFillResourceInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM hti
}
// Software info
- if (res->m_pSoftwareInfo) {
- HTREEITEM htiSoftwareInfo = sttFillInfoLine(hwndTree, htiResource, ppro->LoadIconEx("main"), NULL, TranslateT("Software information"), sttInfoLineId(resource, INFOLINE_SOFTWARE_INFORMATION));
- int nLineId = 0;
- JABBER_XEP0232_SOFTWARE_INFO *p = res->m_pSoftwareInfo;
- if (p->tszOs)
- sttFillInfoLine(hwndTree, htiSoftwareInfo, NULL, TranslateT("Operating system"), p->tszOs, sttInfoLineId(resource, INFOLINE_SOFTWARE_INFORMATION, nLineId++));
- if (p->tszOsVersion)
- sttFillInfoLine(hwndTree, htiSoftwareInfo, NULL, TranslateT("Operating system version"), p->tszOsVersion, sttInfoLineId(resource, INFOLINE_SOFTWARE_INFORMATION, nLineId++));
- if (p->tszSoftware)
- sttFillInfoLine(hwndTree, htiSoftwareInfo, NULL, TranslateT("Software"), p->tszSoftware, sttInfoLineId(resource, INFOLINE_SOFTWARE_INFORMATION, nLineId++));
- if (p->tszSoftwareVersion)
- sttFillInfoLine(hwndTree, htiSoftwareInfo, NULL, TranslateT("Software version"), p->tszSoftwareVersion, sttInfoLineId(resource, INFOLINE_SOFTWARE_INFORMATION, nLineId++));
- if (p->tszXMirandaCoreVersion)
- sttFillInfoLine(hwndTree, htiSoftwareInfo, NULL, TranslateT("Miranda core version"), p->tszXMirandaCoreVersion, sttInfoLineId(resource, INFOLINE_SOFTWARE_INFORMATION, nLineId++));
- }
+ HTREEITEM htiSoftwareInfo = sttFillInfoLine(hwndTree, htiResource, ppro->LoadIconEx("main"), NULL, TranslateT("Software information"), sttInfoLineId(resource, INFOLINE_SOFTWARE_INFORMATION));
+ int nLineId = 0;
+ if (r->m_tszOs)
+ sttFillInfoLine(hwndTree, htiSoftwareInfo, NULL, TranslateT("Operating system"), r->m_tszOs, sttInfoLineId(resource, INFOLINE_SOFTWARE_INFORMATION, nLineId++));
+ if (r->m_tszOsVersion)
+ sttFillInfoLine(hwndTree, htiSoftwareInfo, NULL, TranslateT("Operating system version"), r->m_tszOsVersion, sttInfoLineId(resource, INFOLINE_SOFTWARE_INFORMATION, nLineId++));
+ if (r->m_tszSoftware)
+ sttFillInfoLine(hwndTree, htiSoftwareInfo, NULL, TranslateT("Software"), r->m_tszSoftware, sttInfoLineId(resource, INFOLINE_SOFTWARE_INFORMATION, nLineId++));
+ if (r->m_tszSoftwareVersion)
+ sttFillInfoLine(hwndTree, htiSoftwareInfo, NULL, TranslateT("Software version"), r->m_tszSoftwareVersion, sttInfoLineId(resource, INFOLINE_SOFTWARE_INFORMATION, nLineId++));
+ if (r->m_tszXMirandaCoreVersion)
+ sttFillInfoLine(hwndTree, htiSoftwareInfo, NULL, TranslateT("Miranda core version"), r->m_tszXMirandaCoreVersion, sttInfoLineId(resource, INFOLINE_SOFTWARE_INFORMATION, nLineId++));
}
static void sttFillAdvStatusInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM htiRoot, DWORD dwInfoLine, HANDLE hContact, TCHAR *szTitle, char *pszSlot)