summaryrefslogtreecommitdiff
path: root/protocols/JabberG/src
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/JabberG/src')
-rw-r--r--protocols/JabberG/src/jabber_adhoc.cpp4
-rw-r--r--protocols/JabberG/src/jabber_caps.cpp106
-rw-r--r--protocols/JabberG/src/jabber_chat.cpp222
-rw-r--r--protocols/JabberG/src/jabber_disco.cpp237
-rw-r--r--protocols/JabberG/src/jabber_groupchat.cpp33
-rw-r--r--protocols/JabberG/src/jabber_iqid.cpp4
-rw-r--r--protocols/JabberG/src/jabber_list.cpp67
-rw-r--r--protocols/JabberG/src/jabber_list.h49
-rw-r--r--protocols/JabberG/src/jabber_menu.cpp30
-rw-r--r--protocols/JabberG/src/jabber_misc.cpp48
-rw-r--r--protocols/JabberG/src/jabber_opt.cpp4
-rw-r--r--protocols/JabberG/src/jabber_proto.cpp26
-rw-r--r--protocols/JabberG/src/jabber_proto.h20
-rw-r--r--protocols/JabberG/src/jabber_svc.cpp22
-rw-r--r--protocols/JabberG/src/jabber_thread.cpp64
-rw-r--r--protocols/JabberG/src/jabber_userinfo.cpp46
-rw-r--r--protocols/JabberG/src/jabber_util.cpp4
17 files changed, 483 insertions, 503 deletions
diff --git a/protocols/JabberG/src/jabber_adhoc.cpp b/protocols/JabberG/src/jabber_adhoc.cpp
index 8d5c743f6d..a7e1d5378d 100644
--- a/protocols/JabberG/src/jabber_adhoc.cpp
+++ b/protocols/JabberG/src/jabber_adhoc.cpp
@@ -550,7 +550,7 @@ int __cdecl CJabberProto::ContactMenuRunCommands(WPARAM wParam, LPARAM lParam)
if (item->arResources.getCount() > 1) {
HMENU hMenu = CreatePopupMenu();
for (int i=0; i < item->arResources.getCount(); i++)
- AppendMenu(hMenu,MF_STRING,i+1, item->arResources[i]->resourceName);
+ AppendMenu(hMenu,MF_STRING,i+1, item->arResources[i]->m_tszResourceName);
HWND hwndTemp = CreateWindowEx(WS_EX_TOOLWINDOW,_T("button"),_T("PopupMenuHost"),0,0,0,10,10,NULL,NULL,hInst,NULL);
SetForegroundWindow(hwndTemp);
RECT rc;
@@ -566,7 +566,7 @@ int __cdecl CJabberProto::ContactMenuRunCommands(WPARAM wParam, LPARAM lParam)
JABBER_RESOURCE_STATUS *r = item->arResources[selected-1];
if (r) {
_tcsncat(jid, _T("/"),SIZEOF(jid));
- _tcsncat(jid, r->resourceName, SIZEOF(jid));
+ _tcsncat(jid, r->m_tszResourceName, SIZEOF(jid));
}
selected = 1;
}
diff --git a/protocols/JabberG/src/jabber_caps.cpp b/protocols/JabberG/src/jabber_caps.cpp
index 4a9c6507a1..3c3bf79449 100644
--- a/protocols/JabberG/src/jabber_caps.cpp
+++ b/protocols/JabberG/src/jabber_caps.cpp
@@ -100,7 +100,7 @@ void CJabberProto::OnIqResultCapsDiscoInfoSI(HXML, CJabberIqInfo* pInfo)
if (r == NULL)
return;
- if (r->szCapsNode == NULL)
+ if (r->m_tszCapsNode == NULL)
OnIqResultCapsDiscoInfo(NULL, pInfo);
HXML query = pInfo->GetChildNode();
@@ -110,25 +110,25 @@ 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->pSoftwareInfo)
- delete r->pSoftwareInfo;
- r->pSoftwareInfo = new JABBER_XEP0232_SOFTWARE_INFO;
- if (r->pSoftwareInfo) {
+ 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->pSoftwareInfo->tszOs = mir_tstrdup(szTmp);
+ r->m_pSoftwareInfo->tszOs = mir_tstrdup(szTmp);
szTmp = XPath(xform, _T("field[@var='os_version']/value"));
if (szTmp)
- r->pSoftwareInfo->tszOsVersion = mir_tstrdup(szTmp);
+ r->m_pSoftwareInfo->tszOsVersion = mir_tstrdup(szTmp);
szTmp = XPath(xform, _T("field[@var='software']/value"));
if (szTmp)
- r->pSoftwareInfo->tszSoftware = mir_tstrdup(szTmp);
+ r->m_pSoftwareInfo->tszSoftware = mir_tstrdup(szTmp);
szTmp = XPath(xform, _T("field[@var='software_version']/value"));
if (szTmp)
- r->pSoftwareInfo->tszSoftwareVersion = mir_tstrdup(szTmp);
+ r->m_pSoftwareInfo->tszSoftwareVersion = mir_tstrdup(szTmp);
szTmp = XPath(xform, _T("field[@var='x-miranda-core-version']/value"));
if (szTmp)
- r->pSoftwareInfo->tszXMirandaCoreVersion = mir_tstrdup(szTmp);
+ r->m_pSoftwareInfo->tszXMirandaCoreVersion = mir_tstrdup(szTmp);
}
JabberUserInfoUpdate(pInfo->GetHContact());
}
@@ -158,23 +158,23 @@ void CJabberProto::OnIqResultCapsDiscoInfo(HXML, CJabberIqInfo* pInfo)
}
// no version info support and no XEP-0115 support?
- if (r && r->dwVersionRequestTime == -1 && !r->version && !r->software && !r->szCapsNode) {
- r->jcbCachedCaps = jcbCaps;
- r->dwDiscoInfoRequestTime = -1;
+ if (r && r->m_dwVersionRequestTime == -1 && !r->m_tszVersion && !r->m_tszSoftware && !r->m_tszCapsNode) {
+ r->m_jcbCachedCaps = jcbCaps;
+ r->m_dwDiscoInfoRequestTime = -1;
return;
}
if ( !m_clientCapsManager.SetClientCaps(pInfo->GetIqId(), jcbCaps))
if (r)
- r->jcbCachedCaps = jcbCaps;
+ r->m_jcbCachedCaps = jcbCaps;
JabberUserInfoUpdate(pInfo->GetHContact());
}
else {
// no version info support and no XEP-0115 support?
- if (r && r->dwVersionRequestTime == -1 && !r->version && !r->software && !r->szCapsNode) {
- r->jcbCachedCaps = JABBER_RESOURCE_CAPS_NONE;
- r->dwDiscoInfoRequestTime = -1;
+ if (r && r->m_dwVersionRequestTime == -1 && !r->m_tszVersion && !r->m_tszSoftware && !r->m_tszCapsNode) {
+ r->m_jcbCachedCaps = JABBER_RESOURCE_CAPS_NONE;
+ r->m_dwDiscoInfoRequestTime = -1;
return;
}
m_clientCapsManager.SetClientCaps(pInfo->GetIqId(), JABBER_RESOURCE_CAPS_ERROR);
@@ -205,7 +205,7 @@ JabberCapsBits CJabberProto::GetTotalJidCapabilites(const TCHAR *jid)
if (item) {
for (int i = 0; i < item->arResources.getCount(); i++) {
TCHAR szFullJid[JABBER_MAX_JID_LEN];
- mir_sntprintf(szFullJid, JABBER_MAX_JID_LEN, _T("%s/%s"), szBareJid, item->arResources[i]->resourceName);
+ mir_sntprintf(szFullJid, JABBER_MAX_JID_LEN, _T("%s/%s"), szBareJid, item->arResources[i]->m_tszResourceName);
JabberCapsBits jcb = GetResourceCapabilites(szFullJid, FALSE);
if ( !(jcb & JABBER_RESOURCE_CAPS_ERROR))
jcbToReturn |= jcb;
@@ -227,12 +227,12 @@ JabberCapsBits CJabberProto::GetResourceCapabilites(const TCHAR *jid, BOOL appen
return JABBER_RESOURCE_CAPS_ERROR;
// XEP-0115 mode
- if (r->szCapsNode && r->szCapsVer) {
+ if (r->m_tszCapsNode && r->m_tszCapsVer) {
JabberCapsBits jcbCaps = 0, jcbExtCaps = 0;
BOOL bRequestSent = FALSE;
- JabberCapsBits jcbMainCaps = m_clientCapsManager.GetClientCaps(r->szCapsNode, r->szCapsVer);
+ JabberCapsBits jcbMainCaps = m_clientCapsManager.GetClientCaps(r->m_tszCapsNode, r->m_tszCapsVer);
- if (jcbMainCaps == JABBER_RESOURCE_CAPS_TIMEOUT && !r->dwDiscoInfoRequestTime)
+ if (jcbMainCaps == JABBER_RESOURCE_CAPS_TIMEOUT && !r->m_dwDiscoInfoRequestTime)
jcbMainCaps = JABBER_RESOURCE_CAPS_ERROR;
if (jcbMainCaps == JABBER_RESOURCE_CAPS_UNINIT) {
@@ -240,11 +240,11 @@ 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->szCapsNode, r->szCapsVer, JABBER_RESOURCE_CAPS_IN_PROGRESS, pInfo->GetIqId());
- r->dwDiscoInfoRequestTime = pInfo->GetRequestTime();
+ m_clientCapsManager.SetClientCaps(r->m_tszCapsNode, r->m_tszCapsVer, JABBER_RESOURCE_CAPS_IN_PROGRESS, pInfo->GetIqId());
+ r->m_dwDiscoInfoRequestTime = pInfo->GetRequestTime();
TCHAR queryNode[512];
- mir_sntprintf(queryNode, SIZEOF(queryNode), _T("%s#%s"), r->szCapsNode, r->szCapsVer);
+ mir_sntprintf(queryNode, SIZEOF(queryNode), _T("%s#%s"), r->m_tszCapsNode, r->m_tszCapsVer);
m_ThreadInfo->send( XmlNodeIq(pInfo) << XQUERY(JABBER_FEAT_DISCO_INFO) << XATTR(_T("node"), queryNode));
bRequestSent = TRUE;
@@ -254,12 +254,12 @@ JabberCapsBits CJabberProto::GetResourceCapabilites(const TCHAR *jid, BOOL appen
else if (jcbMainCaps != JABBER_RESOURCE_CAPS_TIMEOUT)
jcbCaps |= jcbMainCaps;
- if (jcbMainCaps != JABBER_RESOURCE_CAPS_TIMEOUT && r->szCapsExt) {
- TCHAR *caps = mir_tstrdup(r->szCapsExt);
+ if (jcbMainCaps != JABBER_RESOURCE_CAPS_TIMEOUT && r->m_tszCapsExt) {
+ TCHAR *caps = mir_tstrdup(r->m_tszCapsExt);
TCHAR *token = _tcstok(caps, _T(" "));
while (token) {
- switch (jcbExtCaps = m_clientCapsManager.GetClientCaps(r->szCapsNode, token)) {
+ switch (jcbExtCaps = m_clientCapsManager.GetClientCaps(r->m_tszCapsNode, token)) {
case JABBER_RESOURCE_CAPS_ERROR:
break;
@@ -269,10 +269,10 @@ 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->szCapsNode, token, JABBER_RESOURCE_CAPS_IN_PROGRESS, pInfo->GetIqId());
+ m_clientCapsManager.SetClientCaps(r->m_tszCapsNode, token, JABBER_RESOURCE_CAPS_IN_PROGRESS, pInfo->GetIqId());
TCHAR queryNode[512];
- mir_sntprintf(queryNode, SIZEOF(queryNode), _T("%s#%s"), r->szCapsNode, token);
+ mir_sntprintf(queryNode, SIZEOF(queryNode), _T("%s#%s"), r->m_tszCapsNode, token);
m_ThreadInfo->send(
XmlNodeIq(pInfo) << XQUERY(JABBER_FEAT_DISCO_INFO) << XATTR(_T("node"), queryNode));
@@ -296,20 +296,20 @@ JabberCapsBits CJabberProto::GetResourceCapabilites(const TCHAR *jid, BOOL appen
if (bRequestSent)
return JABBER_RESOURCE_CAPS_IN_PROGRESS;
- return jcbCaps | r->jcbManualDiscoveredCaps;
+ return jcbCaps | r->m_jcbManualDiscoveredCaps;
}
// capability mode (version request + service discovery)
// no version info:
- if ( !r->version && !r->software) {
+ if ( !r->m_tszVersion && !r->m_tszSoftware) {
// version request not sent:
- if ( !r->dwVersionRequestTime) {
+ if ( !r->m_dwVersionRequestTime) {
// send version query
CJabberIqInfo *pInfo = m_iqManager.AddHandler(&CJabberProto::OnIqResultVersion, JABBER_IQ_TYPE_GET, fullJid, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_HCONTACT | JABBER_IQ_PARSE_CHILD_TAG_NODE);
pInfo->SetTimeout(JABBER_RESOURCE_CAPS_QUERY_TIMEOUT);
- r->dwVersionRequestTime = pInfo->GetRequestTime();
+ r->m_dwVersionRequestTime = pInfo->GetRequestTime();
XmlNodeIq iq(pInfo);
iq << XQUERY(JABBER_FEAT_VERSION);
@@ -317,21 +317,21 @@ JabberCapsBits CJabberProto::GetResourceCapabilites(const TCHAR *jid, BOOL appen
return JABBER_RESOURCE_CAPS_IN_PROGRESS;
}
// version not received:
- else if (r->dwVersionRequestTime != -1) {
+ else if (r->m_dwVersionRequestTime != -1) {
// no timeout?
- if (GetTickCount() - r->dwVersionRequestTime < JABBER_RESOURCE_CAPS_QUERY_TIMEOUT)
+ if (GetTickCount() - r->m_dwVersionRequestTime < JABBER_RESOURCE_CAPS_QUERY_TIMEOUT)
return JABBER_RESOURCE_CAPS_IN_PROGRESS;
// timeout
- r->dwVersionRequestTime = -1;
+ r->m_dwVersionRequestTime = -1;
}
// no version information, try direct service discovery
- if ( !r->dwDiscoInfoRequestTime) {
+ if ( !r->m_dwDiscoInfoRequestTime) {
// send disco#info query
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);
- r->dwDiscoInfoRequestTime = pInfo->GetRequestTime();
+ r->m_dwDiscoInfoRequestTime = pInfo->GetRequestTime();
XmlNodeIq iq(pInfo);
iq << XQUERY(JABBER_FEAT_DISCO_INFO);
@@ -339,34 +339,34 @@ JabberCapsBits CJabberProto::GetResourceCapabilites(const TCHAR *jid, BOOL appen
return JABBER_RESOURCE_CAPS_IN_PROGRESS;
}
- else if (r->dwDiscoInfoRequestTime == -1)
- return r->jcbCachedCaps | r->jcbManualDiscoveredCaps;
- else if (GetTickCount() - r->dwDiscoInfoRequestTime < JABBER_RESOURCE_CAPS_QUERY_TIMEOUT)
+ else if (r->m_dwDiscoInfoRequestTime == -1)
+ return r->m_jcbCachedCaps | r->m_jcbManualDiscoveredCaps;
+ else if (GetTickCount() - r->m_dwDiscoInfoRequestTime < JABBER_RESOURCE_CAPS_QUERY_TIMEOUT)
return JABBER_RESOURCE_CAPS_IN_PROGRESS;
else
- r->dwDiscoInfoRequestTime = -1;
+ r->m_dwDiscoInfoRequestTime = -1;
// version request timeout:
return JABBER_RESOURCE_CAPS_NONE;
}
// version info available:
- if (r->software && r->version) {
- JabberCapsBits jcbMainCaps = m_clientCapsManager.GetClientCaps(r->software, r->version);
+ if (r->m_tszSoftware && r->m_tszVersion) {
+ JabberCapsBits jcbMainCaps = m_clientCapsManager.GetClientCaps(r->m_tszSoftware, r->m_tszVersion);
if (jcbMainCaps == JABBER_RESOURCE_CAPS_ERROR) {
// Bombus hack:
- if ( !_tcscmp(r->software, _T("Bombus")) || !_tcscmp(r->software, _T("BombusMod"))) {
+ 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->software, r->version, jcbMainCaps);
+ m_clientCapsManager.SetClientCaps(r->m_tszSoftware, r->m_tszVersion, jcbMainCaps);
}
// Neos hack:
- else if ( !_tcscmp(r->software, _T("neos"))) {
+ 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->software, r->version, jcbMainCaps);
+ m_clientCapsManager.SetClientCaps(r->m_tszSoftware, r->m_tszVersion, jcbMainCaps);
}
// sim hack:
- else if ( !_tcscmp(r->software, _T("sim"))) {
+ 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->software, r->version, jcbMainCaps);
+ m_clientCapsManager.SetClientCaps(r->m_tszSoftware, r->m_tszVersion, jcbMainCaps);
} }
else if (jcbMainCaps == JABBER_RESOURCE_CAPS_UNINIT) {
@@ -374,8 +374,8 @@ 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->software, r->version, JABBER_RESOURCE_CAPS_IN_PROGRESS, pInfo->GetIqId());
- r->dwDiscoInfoRequestTime = pInfo->GetRequestTime();
+ m_clientCapsManager.SetClientCaps(r->m_tszSoftware, r->m_tszVersion, JABBER_RESOURCE_CAPS_IN_PROGRESS, pInfo->GetIqId());
+ r->m_dwDiscoInfoRequestTime = pInfo->GetRequestTime();
XmlNodeIq iq(pInfo);
iq << XQUERY(JABBER_FEAT_DISCO_INFO);
@@ -383,7 +383,7 @@ JabberCapsBits CJabberProto::GetResourceCapabilites(const TCHAR *jid, BOOL appen
jcbMainCaps = JABBER_RESOURCE_CAPS_IN_PROGRESS;
}
- return jcbMainCaps | r->jcbManualDiscoveredCaps;
+ return jcbMainCaps | r->m_jcbManualDiscoveredCaps;
}
return JABBER_RESOURCE_CAPS_NONE;
diff --git a/protocols/JabberG/src/jabber_chat.cpp b/protocols/JabberG/src/jabber_chat.cpp
index a7e5e42de8..f5aa8f541d 100644
--- a/protocols/JabberG/src/jabber_chat.cpp
+++ b/protocols/JabberG/src/jabber_chat.cpp
@@ -64,11 +64,11 @@ struct TRoleOrAffiliationInfo
BOOL check(JABBER_RESOURCE_STATUS *me, JABBER_RESOURCE_STATUS *him)
{
- if (me->affiliation == AFFILIATION_OWNER) return TRUE;
+ if (me->m_affiliation == AFFILIATION_OWNER) return TRUE;
if (me == him) return FALSE;
- if (me->affiliation <= him->affiliation) return FALSE;
- if (me->role < this->min_role) return FALSE;
- if (me->affiliation < this->min_affiliation) return FALSE;
+ if (me->m_affiliation <= him->m_affiliation) return FALSE;
+ if (me->m_role < this->min_role) return FALSE;
+ if (me->m_affiliation < this->min_affiliation) return FALSE;
return TRUE;
}
void translate()
@@ -113,7 +113,7 @@ int JabberGcGetStatus(JABBER_GC_AFFILIATION a, JABBER_GC_ROLE r)
int JabberGcGetStatus(JABBER_RESOURCE_STATUS *r)
{
- return JabberGcGetStatus(r->affiliation, r->role);
+ return JabberGcGetStatus(r->m_affiliation, r->m_role);
}
int CJabberProto::GcInit(JABBER_LIST_ITEM *item)
@@ -203,17 +203,17 @@ void CJabberProto::GcLogShowInformation(JABBER_LIST_ITEM *item, pResourceStatus
switch (type) {
case INFO_BAN:
if (m_options.GcLogBans)
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("User %s is now banned."), user->resourceName);
+ mir_sntprintf(buf, SIZEOF(buf), TranslateT("User %s is now banned."), user->m_tszResourceName);
break;
case INFO_STATUS:
if (m_options.GcLogStatuses) {
- TCHAR *ptszDescr = pcli->pfnGetStatusModeDescription(user->status, 0);
- if (user->statusMessage)
+ TCHAR *ptszDescr = pcli->pfnGetStatusModeDescription(user->m_iStatus, 0);
+ if (user->m_tszStatusMessage)
mir_sntprintf(buf, SIZEOF(buf), TranslateT("User %s changed status to %s with message: %s"),
- user->resourceName, ptszDescr, user->statusMessage);
+ user->m_tszResourceName, ptszDescr, user->m_tszStatusMessage);
else
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("User %s changed status to %s"), user->resourceName, ptszDescr);
+ mir_sntprintf(buf, SIZEOF(buf), TranslateT("User %s changed status to %s"), user->m_tszResourceName, ptszDescr);
}
break;
@@ -225,7 +225,7 @@ void CJabberProto::GcLogShowInformation(JABBER_LIST_ITEM *item, pResourceStatus
case INFO_AFFILIATION:
if (m_options.GcLogAffiliations) {
TCHAR *name = NULL;
- switch (user->affiliation) {
+ switch (user->m_affiliation) {
case AFFILIATION_NONE: name = TranslateT("None"); break;
case AFFILIATION_MEMBER: name = TranslateT("Member"); break;
case AFFILIATION_ADMIN: name = TranslateT("Admin"); break;
@@ -233,14 +233,14 @@ void CJabberProto::GcLogShowInformation(JABBER_LIST_ITEM *item, pResourceStatus
case AFFILIATION_OUTCAST: name = TranslateT("Outcast"); break;
}
if (name)
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("Affiliation of %s was changed to '%s'."), user->resourceName, name);
+ mir_sntprintf(buf, SIZEOF(buf), TranslateT("Affiliation of %s was changed to '%s'."), user->m_tszResourceName, name);
}
break;
case INFO_ROLE:
if (m_options.GcLogRoles) {
TCHAR *name = NULL;
- switch (user->role) {
+ switch (user->m_role) {
case ROLE_NONE: name = TranslateT("None"); break;
case ROLE_VISITOR: name = TranslateT("Visitor"); break;
case ROLE_PARTICIPANT: name = TranslateT("Participant"); break;
@@ -248,7 +248,7 @@ void CJabberProto::GcLogShowInformation(JABBER_LIST_ITEM *item, pResourceStatus
}
if (name)
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("Role of %s was changed to '%s'."), user->resourceName, name);
+ mir_sntprintf(buf, SIZEOF(buf), TranslateT("Role of %s was changed to '%s'."), user->m_tszResourceName, name);
}
break;
}
@@ -258,8 +258,8 @@ void CJabberProto::GcLogShowInformation(JABBER_LIST_ITEM *item, pResourceStatus
gcd.ptszID = item->jid;
GCEVENT gce = {0};
gce.cbSize = sizeof(GCEVENT);
- gce.ptszNick = user->resourceName;
- gce.ptszUID = user->resourceName;
+ gce.ptszNick = user->m_tszResourceName;
+ gce.ptszUID = user->m_tszResourceName;
gce.ptszText = EscapeChatTags(buf);
gce.dwFlags = GC_TCHAR | GCEF_ADDTOLOG;
gce.pDest = &gcd;
@@ -312,7 +312,7 @@ void CJabberProto::GcLogUpdateMemberStatus(JABBER_LIST_ITEM *item, const TCHAR *
mir_cslock lck(m_csLists);
for (int i=0; i < item->arResources.getCount(); i++) {
JABBER_RESOURCE_STATUS *JS = item->arResources[i];
- if ( !lstrcmp(resource, JS->resourceName)) {
+ if ( !lstrcmp(resource, JS->m_tszResourceName)) {
if (action != GC_EVENT_JOIN) {
switch(action) {
case 0:
@@ -324,7 +324,7 @@ void CJabberProto::GcLogUpdateMemberStatus(JABBER_LIST_ITEM *item, const TCHAR *
}
gce.ptszStatus = TranslateTS(sttStatuses[JabberGcGetStatus(JS)]);
gce.bIsMe = (lstrcmp(nick, myNick) == 0);
- statusToSet = JS->status;
+ statusToSet = JS->m_iStatus;
break;
} } }
@@ -543,8 +543,8 @@ int CJabberProto::JabberGcMenuHook(WPARAM, LPARAM lParam)
pResourceStatus me(NULL), him(NULL);
for (int i=0; i < item->arResources.getCount(); i++) {
JABBER_RESOURCE_STATUS *p = item->arResources[i];
- if ( !lstrcmp(p->resourceName, item->nick)) me = p;
- if ( !lstrcmp(p->resourceName, gcmi->pszUID)) him = p;
+ if ( !lstrcmp(p->m_tszResourceName, item->nick)) me = p;
+ if ( !lstrcmp(p->m_tszResourceName, gcmi->pszUID)) him = p;
}
if (gcmi->Type == MENU_ON_LOG) {
@@ -560,9 +560,9 @@ int CJabberProto::JabberGcMenuHook(WPARAM, LPARAM lParam)
sttSetupGcMenuItem(gcmi, 0, FALSE);
int idx = IDM_LINK0;
- if (item->m_pItemResource && item->m_pItemResource->statusMessage && *item->m_pItemResource->statusMessage) {
+ if (item->m_pItemResource && item->m_pItemResource->m_tszStatusMessage && *item->m_pItemResource->m_tszStatusMessage) {
TCHAR *bufPtr = url_buf;
- for (TCHAR *p = _tcsstr(item->m_pItemResource->statusMessage, _T("http://")); p && *p; p = _tcsstr(p+1, _T("http://"))) {
+ for (TCHAR *p = _tcsstr(item->m_pItemResource->m_tszStatusMessage, _T("http://")); p && *p; p = _tcsstr(p+1, _T("http://"))) {
lstrcpyn(bufPtr, p, SIZEOF(url_buf) - (bufPtr - url_buf));
gc_item *pItem = sttFindGcMenuItem(gcmi, idx);
pItem->pszDesc = bufPtr;
@@ -578,9 +578,9 @@ int CJabberProto::JabberGcMenuHook(WPARAM, LPARAM lParam)
if ( !GetAsyncKeyState(VK_CONTROL)) {
if (me) {
- sttSetupGcMenuItems(gcmi, sttModeratorItems, (me->role < ROLE_MODERATOR));
- sttSetupGcMenuItems(gcmi, sttAdminItems, (me->affiliation < AFFILIATION_ADMIN));
- sttSetupGcMenuItems(gcmi, sttOwnerItems, (me->affiliation < AFFILIATION_OWNER));
+ sttSetupGcMenuItems(gcmi, sttModeratorItems, (me->m_role < ROLE_MODERATOR));
+ sttSetupGcMenuItems(gcmi, sttAdminItems, (me->m_affiliation < AFFILIATION_ADMIN));
+ sttSetupGcMenuItems(gcmi, sttOwnerItems, (me->m_affiliation < AFFILIATION_OWNER));
}
if (m_ThreadInfo->jabberServerCaps & JABBER_CAPS_PRIVATE_STORAGE)
sttSetupGcMenuItem(gcmi, IDM_BOOKMARKS, FALSE);
@@ -611,21 +611,21 @@ int CJabberProto::JabberGcMenuHook(WPARAM, LPARAM lParam)
for (i = 0; i < SIZEOF(sttAffiliationItems); i++) {
struct gc_item *item = sttFindGcMenuItem(gcmi, sttAffiliationItems[i].id);
- item->uType = (him->affiliation == sttAffiliationItems[i].value) ? MENU_POPUPCHECK : MENU_POPUPITEM;
+ item->uType = (him->m_affiliation == sttAffiliationItems[i].value) ? MENU_POPUPCHECK : MENU_POPUPITEM;
item->bDisabled = !(force || sttAffiliationItems[i].check(me, him));
}
for (i = 0; i < SIZEOF(sttRoleItems); i++) {
struct gc_item *item = sttFindGcMenuItem(gcmi, sttRoleItems[i].id);
- item->uType = (him->role == sttRoleItems[i].value) ? MENU_POPUPCHECK : MENU_POPUPITEM;
+ item->uType = (him->m_role == sttRoleItems[i].value) ? MENU_POPUPCHECK : MENU_POPUPITEM;
item->bDisabled = !(force || sttRoleItems[i].check(me, him));
}
- if (him->szRealJid && *him->szRealJid) {
- mir_sntprintf(sttRJidBuf, SIZEOF(sttRJidBuf), TranslateT("Real &JID: %s"), him->szRealJid);
+ if (him->m_tszRealJid && *him->m_tszRealJid) {
+ mir_sntprintf(sttRJidBuf, SIZEOF(sttRJidBuf), TranslateT("Real &JID: %s"), him->m_tszRealJid);
if (TCHAR *tmp = _tcschr(sttRJidBuf, _T('/'))) *tmp = 0;
- if (HANDLE hContact = HContactFromJID(him->szRealJid)) {
+ if (HANDLE hContact = HContactFromJID(him->m_tszRealJid)) {
gcmi->Item[3].uType = MENU_HMENU;
gcmi->Item[3].dwID = CallService(MS_CLIST_MENUBUILDCONTACT, (WPARAM)hContact, 0);
sttShowGcMenuItems(gcmi, sttRJidItems, 0);
@@ -645,11 +645,11 @@ int CJabberProto::JabberGcMenuHook(WPARAM, LPARAM lParam)
}
if ( !force) {
- if (me->role < ROLE_MODERATOR || (me->affiliation <= him->affiliation))
+ if (me->m_role < ROLE_MODERATOR || (me->m_affiliation <= him->m_affiliation))
sttSetupGcMenuItem(gcmi, IDM_KICK, TRUE);
- if ((me->affiliation < AFFILIATION_ADMIN) ||
- (me->affiliation == AFFILIATION_ADMIN) && (me->affiliation <= him->affiliation))
+ if ((me->m_affiliation < AFFILIATION_ADMIN) ||
+ (me->m_affiliation == AFFILIATION_ADMIN) && (me->m_affiliation <= him->m_affiliation))
sttSetupGcMenuItem(gcmi, IDM_SET_BAN, TRUE);
}
}
@@ -887,37 +887,37 @@ static INT_PTR CALLBACK sttUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam
SendDlgItemMessage(hwndDlg, IDC_BTN_ROLE, BUTTONSETASFLATBTN, TRUE, 0);
SendDlgItemMessage(hwndDlg, IDC_BTN_ROLE, BUTTONADDTOOLTIP, (WPARAM)"Apply", 0);
- SendDlgItemMessage(hwndDlg, IDC_ICO_STATUS, STM_SETICON, (WPARAM)LoadSkinnedProtoIcon(dat->ppro->m_szModuleName, dat->him->status), 0);
+ SendDlgItemMessage(hwndDlg, IDC_ICO_STATUS, STM_SETICON, (WPARAM)LoadSkinnedProtoIcon(dat->ppro->m_szModuleName, dat->him->m_iStatus), 0);
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("Member Info: %s"), dat->him->resourceName);
+ mir_sntprintf(buf, SIZEOF(buf), TranslateT("Member Info: %s"), dat->him->m_tszResourceName);
SetWindowText(hwndDlg, buf);
- mir_sntprintf(buf, SIZEOF(buf), TranslateT("Member Information\n%s from %s"), dat->him->resourceName, dat->item->jid);
+ mir_sntprintf(buf, SIZEOF(buf), TranslateT("Member Information\n%s from %s"), dat->him->m_tszResourceName, dat->item->jid);
SetDlgItemText(hwndDlg, IDC_HEADERBAR, buf);
- SetDlgItemText(hwndDlg, IDC_TXT_NICK, dat->him->resourceName);
- SetDlgItemText(hwndDlg, IDC_TXT_JID, dat->him->szRealJid ? dat->him->szRealJid : TranslateT("Real JID not available"));
- SetDlgItemText(hwndDlg, IDC_TXT_STATUS, dat->him->statusMessage);
+ SetDlgItemText(hwndDlg, IDC_TXT_NICK, dat->him->m_tszResourceName);
+ SetDlgItemText(hwndDlg, IDC_TXT_JID, dat->him->m_tszRealJid ? dat->him->m_tszRealJid : TranslateT("Real JID not available"));
+ SetDlgItemText(hwndDlg, IDC_TXT_STATUS, dat->him->m_tszStatusMessage);
for (i = 0; i < SIZEOF(sttRoleItems); i++)
{
- if ((sttRoleItems[i].value == dat->him->role) || sttRoleItems[i].check(dat->me, dat->him))
+ if ((sttRoleItems[i].value == dat->him->m_role) || sttRoleItems[i].check(dat->me, dat->him))
{
SendDlgItemMessage(hwndDlg, IDC_TXT_ROLE, CB_SETITEMDATA,
idx = SendDlgItemMessage(hwndDlg, IDC_TXT_ROLE, CB_ADDSTRING, 0, (LPARAM)sttRoleItems[i].title),
sttRoleItems[i].value);
- if (sttRoleItems[i].value == dat->him->role)
+ if (sttRoleItems[i].value == dat->him->m_role)
SendDlgItemMessage(hwndDlg, IDC_TXT_ROLE, CB_SETCURSEL, idx, 0);
}
}
for (i = 0; i < SIZEOF(sttAffiliationItems); i++)
{
- if ((sttAffiliationItems[i].value == dat->him->affiliation) || sttAffiliationItems[i].check(dat->me, dat->him))
+ if ((sttAffiliationItems[i].value == dat->him->m_affiliation) || sttAffiliationItems[i].check(dat->me, dat->him))
{
SendDlgItemMessage(hwndDlg, IDC_TXT_AFFILIATION, CB_SETITEMDATA,
idx = SendDlgItemMessage(hwndDlg, IDC_TXT_AFFILIATION, CB_ADDSTRING, 0, (LPARAM)sttAffiliationItems[i].title),
sttAffiliationItems[i].value);
- if (sttAffiliationItems[i].value == dat->him->affiliation)
+ if (sttAffiliationItems[i].value == dat->him->m_affiliation)
SendDlgItemMessage(hwndDlg, IDC_TXT_AFFILIATION, CB_SETCURSEL, idx, 0);
}
}
@@ -940,43 +940,43 @@ static INT_PTR CALLBACK sttUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam
if (HIWORD(wParam) == CBN_SELCHANGE) {
value = SendDlgItemMessage(hwndDlg, IDC_TXT_AFFILIATION, CB_GETITEMDATA,
SendDlgItemMessage(hwndDlg, IDC_TXT_AFFILIATION, CB_GETCURSEL, 0, 0), 0);
- EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_AFFILIATION), dat->him->affiliation != value);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_AFFILIATION), dat->him->m_affiliation != value);
}
break;
case IDC_BTN_AFFILIATION:
value = SendDlgItemMessage(hwndDlg, IDC_TXT_AFFILIATION, CB_GETITEMDATA,
SendDlgItemMessage(hwndDlg, IDC_TXT_AFFILIATION, CB_GETCURSEL, 0, 0), 0);
- if (dat->him->affiliation == value)
+ if (dat->him->m_affiliation == value)
break;
TCHAR szBareJid[JABBER_MAX_JID_LEN];
- JabberStripJid(dat->him->szRealJid, szBareJid, SIZEOF(szBareJid));
+ JabberStripJid(dat->him->m_tszRealJid, szBareJid, SIZEOF(szBareJid));
switch (value) {
case AFFILIATION_NONE:
- if (dat->him->szRealJid)
+ if (dat->him->m_tszRealJid)
dat->ppro->AdminSet(dat->item->jid, JABBER_FEAT_MUC_ADMIN, _T("jid"), szBareJid, _T("affiliation"), _T("none"));
else
- dat->ppro->AdminSet(dat->item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), dat->him->resourceName, _T("affiliation"), _T("none"));
+ dat->ppro->AdminSet(dat->item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), dat->him->m_tszResourceName, _T("affiliation"), _T("none"));
break;
case AFFILIATION_MEMBER:
- if (dat->him->szRealJid)
+ if (dat->him->m_tszRealJid)
dat->ppro->AdminSet(dat->item->jid, JABBER_FEAT_MUC_ADMIN, _T("jid"), szBareJid, _T("affiliation"), _T("member"));
else
- dat->ppro->AdminSet(dat->item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), dat->him->resourceName, _T("affiliation"), _T("member"));
+ dat->ppro->AdminSet(dat->item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), dat->him->m_tszResourceName, _T("affiliation"), _T("member"));
break;
case AFFILIATION_ADMIN:
- if (dat->him->szRealJid)
+ if (dat->him->m_tszRealJid)
dat->ppro->AdminSet(dat->item->jid, JABBER_FEAT_MUC_ADMIN, _T("jid"), szBareJid, _T("affiliation"), _T("admin"));
else
- dat->ppro->AdminSet(dat->item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), dat->him->resourceName, _T("affiliation"), _T("admin"));
+ dat->ppro->AdminSet(dat->item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), dat->him->m_tszResourceName, _T("affiliation"), _T("admin"));
break;
case AFFILIATION_OWNER:
- if (dat->him->szRealJid)
+ if (dat->him->m_tszRealJid)
dat->ppro->AdminSet(dat->item->jid, JABBER_FEAT_MUC_ADMIN, _T("jid"), szBareJid, _T("affiliation"), _T("owner"));
else
- dat->ppro->AdminSet(dat->item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), dat->him->resourceName, _T("affiliation"), _T("owner"));
+ dat->ppro->AdminSet(dat->item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), dat->him->m_tszResourceName, _T("affiliation"), _T("owner"));
}
break;
@@ -984,25 +984,25 @@ static INT_PTR CALLBACK sttUserInfoDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam
if (HIWORD(wParam) == CBN_SELCHANGE) {
value = SendDlgItemMessage(hwndDlg, IDC_TXT_ROLE, CB_GETITEMDATA,
SendDlgItemMessage(hwndDlg, IDC_TXT_ROLE, CB_GETCURSEL, 0, 0), 0);
- EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_ROLE), dat->him->role != value);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BTN_ROLE), dat->him->m_role != value);
}
break;
case IDC_BTN_ROLE:
value = SendDlgItemMessage(hwndDlg, IDC_TXT_ROLE, CB_GETITEMDATA,
SendDlgItemMessage(hwndDlg, IDC_TXT_ROLE, CB_GETCURSEL, 0, 0), 0);
- if (dat->him->role == value)
+ if (dat->him->m_role == value)
break;
switch (value) {
case ROLE_VISITOR:
- dat->ppro->AdminSet(dat->item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), dat->him->resourceName, _T("role"), _T("visitor"));
+ dat->ppro->AdminSet(dat->item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), dat->him->m_tszResourceName, _T("role"), _T("visitor"));
break;
case ROLE_PARTICIPANT:
- dat->ppro->AdminSet(dat->item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), dat->him->resourceName, _T("role"), _T("participant"));
+ dat->ppro->AdminSet(dat->item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), dat->him->m_tszResourceName, _T("role"), _T("participant"));
break;
case ROLE_MODERATOR:
- dat->ppro->AdminSet(dat->item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), dat->him->resourceName, _T("role"), _T("moderator"));
+ dat->ppro->AdminSet(dat->item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), dat->him->m_tszResourceName, _T("role"), _T("moderator"));
break;
}
}
@@ -1040,8 +1040,8 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK*
TCHAR szTitle[256];
if ((gch->dwData >= CLISTMENUIDMIN) && (gch->dwData <= CLISTMENUIDMAX)) {
- if (him->szRealJid && *him->szRealJid)
- if (HANDLE hContact = ppro->HContactFromJID(him->szRealJid))
+ if (him->m_tszRealJid && *him->m_tszRealJid)
+ if (HANDLE hContact = ppro->HContactFromJID(him->m_tszRealJid))
CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(gch->dwData, MPCF_CONTACTMENU), (LPARAM)hContact);
return;
}
@@ -1057,7 +1057,7 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK*
// do not use snprintf to avoid possible problems with % symbol
if (TCHAR *p = _tcsstr(szMessage, _T("%s"))) {
*p = 0;
- mir_sntprintf(buf, SIZEOF(buf), _T("%s%s%s"), szMessage, him->resourceName, p+2);
+ mir_sntprintf(buf, SIZEOF(buf), _T("%s%s%s"), szMessage, him->m_tszResourceName, p+2);
}
else lstrcpyn(buf, szMessage, SIZEOF(buf));
UnEscapeChatTags(buf);
@@ -1074,11 +1074,11 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK*
case IDM_VCARD:
{
JABBER_SEARCH_RESULT jsr = {0};
- mir_sntprintf(jsr.jid, SIZEOF(jsr.jid), _T("%s/%s"), item->jid, him->resourceName);
+ mir_sntprintf(jsr.jid, SIZEOF(jsr.jid), _T("%s/%s"), item->jid, him->m_tszResourceName);
jsr.hdr.cbSize = sizeof(JABBER_SEARCH_RESULT);
JABBER_LIST_ITEM *item = ppro->ListAdd(LIST_VCARD_TEMP, jsr.jid);
- ppro->ListAddResource(LIST_VCARD_TEMP, jsr.jid, him->status, him->statusMessage, him->priority);
+ ppro->ListAddResource(LIST_VCARD_TEMP, jsr.jid, him->m_iStatus, him->m_tszStatusMessage, him->m_iPriority);
HANDLE hContact = (HANDLE)CallProtoService(ppro->m_szModuleName, PS_ADDTOLIST, PALF_TEMPORARY, (LPARAM)&jsr);
CallService(MS_USERINFO_SHOWDIALOG, (WPARAM)hContact, 0);
@@ -1100,9 +1100,9 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK*
case IDM_KICK:
if ((GetTickCount() - dwLastBanKickTime) > BAN_KICK_INTERVAL) {
dwLastBanKickTime = GetTickCount();
- mir_sntprintf(szBuffer, SIZEOF(szBuffer), _T("%s: "), me->resourceName);
- mir_sntprintf(szTitle, SIZEOF(szTitle), TranslateT("Reason to kick %s"), him->resourceName);
- TCHAR *resourceName_copy = mir_tstrdup(him->resourceName); // copy resource name to prevent possible crash if user list rebuilds
+ mir_sntprintf(szBuffer, SIZEOF(szBuffer), _T("%s: "), me->m_tszResourceName);
+ mir_sntprintf(szTitle, SIZEOF(szTitle), TranslateT("Reason to kick %s"), him->m_tszResourceName);
+ TCHAR *resourceName_copy = mir_tstrdup(him->m_tszResourceName); // copy resource name to prevent possible crash if user list rebuilds
if (ppro->EnterString(szBuffer, SIZEOF(szBuffer), szTitle, JES_MULTINE, "gcReason_"))
ppro->m_ThreadInfo->send(
XmlNodeIq(_T("set"), ppro->SerialNext(), item->jid) << XQUERY(JABBER_FEAT_MUC_ADMIN)
@@ -1115,72 +1115,72 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK*
break;
case IDM_SET_VISITOR:
- if (him->role != ROLE_VISITOR)
- ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), him->resourceName, _T("role"), _T("visitor"));
+ if (him->m_role != ROLE_VISITOR)
+ ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), him->m_tszResourceName, _T("role"), _T("visitor"));
break;
case IDM_SET_PARTICIPANT:
- if (him->role != ROLE_PARTICIPANT)
- ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), him->resourceName, _T("role"), _T("participant"));
+ if (him->m_role != ROLE_PARTICIPANT)
+ ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), him->m_tszResourceName, _T("role"), _T("participant"));
break;
case IDM_SET_MODERATOR:
- if (him->role != ROLE_MODERATOR)
- ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), him->resourceName, _T("role"), _T("moderator"));
+ if (him->m_role != ROLE_MODERATOR)
+ ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), him->m_tszResourceName, _T("role"), _T("moderator"));
break;
case IDM_SET_NONE:
- if (him->affiliation != AFFILIATION_NONE) {
- if (him->szRealJid) {
+ if (him->m_affiliation != AFFILIATION_NONE) {
+ if (him->m_tszRealJid) {
TCHAR szBareJid[JABBER_MAX_JID_LEN];
- JabberStripJid(him->szRealJid, szBareJid, SIZEOF(szBareJid));
+ JabberStripJid(him->m_tszRealJid, szBareJid, SIZEOF(szBareJid));
ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, _T("jid"), szBareJid, _T("affiliation"), _T("none"));
}
- else ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), him->resourceName, _T("affiliation"), _T("none"));
+ else ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), him->m_tszResourceName, _T("affiliation"), _T("none"));
}
break;
case IDM_SET_MEMBER:
- if (him->affiliation != AFFILIATION_MEMBER) {
- if (him->szRealJid) {
+ if (him->m_affiliation != AFFILIATION_MEMBER) {
+ if (him->m_tszRealJid) {
TCHAR szBareJid[JABBER_MAX_JID_LEN];
- JabberStripJid(him->szRealJid, szBareJid, SIZEOF(szBareJid));
+ JabberStripJid(him->m_tszRealJid, szBareJid, SIZEOF(szBareJid));
ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, _T("jid"), szBareJid, _T("affiliation"), _T("member"));
}
- else ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), him->resourceName, _T("affiliation"), _T("member"));
+ else ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), him->m_tszResourceName, _T("affiliation"), _T("member"));
}
break;
case IDM_SET_ADMIN:
- if (him->affiliation != AFFILIATION_ADMIN) {
- if (him->szRealJid) {
+ if (him->m_affiliation != AFFILIATION_ADMIN) {
+ if (him->m_tszRealJid) {
TCHAR szBareJid[JABBER_MAX_JID_LEN];
- JabberStripJid(him->szRealJid, szBareJid, SIZEOF(szBareJid));
+ JabberStripJid(him->m_tszRealJid, szBareJid, SIZEOF(szBareJid));
ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, _T("jid"), szBareJid, _T("affiliation"), _T("admin"));
}
- else ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), him->resourceName, _T("affiliation"), _T("admin"));
+ else ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), him->m_tszResourceName, _T("affiliation"), _T("admin"));
}
break;
case IDM_SET_OWNER:
- if (him->affiliation != AFFILIATION_OWNER) {
- if (him->szRealJid) {
+ if (him->m_affiliation != AFFILIATION_OWNER) {
+ if (him->m_tszRealJid) {
TCHAR szBareJid[JABBER_MAX_JID_LEN];
- JabberStripJid(him->szRealJid, szBareJid, SIZEOF(szBareJid));
+ JabberStripJid(him->m_tszRealJid, szBareJid, SIZEOF(szBareJid));
ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, _T("jid"), szBareJid, _T("affiliation"), _T("owner"));
}
- else ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), him->resourceName, _T("affiliation"), _T("owner"));
+ else ppro->AdminSet(item->jid, JABBER_FEAT_MUC_ADMIN, _T("nick"), him->m_tszResourceName, _T("affiliation"), _T("owner"));
}
break;
case IDM_SET_BAN:
if ((GetTickCount() - dwLastBanKickTime) > BAN_KICK_INTERVAL) {
- if (him->szRealJid && *him->szRealJid) {
+ if (him->m_tszRealJid && *him->m_tszRealJid) {
TCHAR szVictimBareJid[JABBER_MAX_JID_LEN];
- JabberStripJid(him->szRealJid, szVictimBareJid, SIZEOF(szVictimBareJid));
+ JabberStripJid(him->m_tszRealJid, szVictimBareJid, SIZEOF(szVictimBareJid));
- mir_sntprintf(szBuffer, SIZEOF(szBuffer), _T("%s: "), me->resourceName);
- mir_sntprintf(szTitle, SIZEOF(szTitle), TranslateT("Reason to ban %s"), him->resourceName);
+ mir_sntprintf(szBuffer, SIZEOF(szBuffer), _T("%s: "), me->m_tszResourceName);
+ mir_sntprintf(szTitle, SIZEOF(szTitle), TranslateT("Reason to ban %s"), him->m_tszResourceName);
if (ppro->EnterString(szBuffer, SIZEOF(szBuffer), szTitle, JES_MULTINE, "gcReason_")) {
ppro->m_ThreadInfo->send(
@@ -1196,7 +1196,7 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK*
case IDM_LINK0: case IDM_LINK1: case IDM_LINK2: case IDM_LINK3: case IDM_LINK4:
case IDM_LINK5: case IDM_LINK6: case IDM_LINK7: case IDM_LINK8: case IDM_LINK9:
if ((GetTickCount() - dwLastBanKickTime) > BAN_KICK_INTERVAL) {
- TCHAR *resourceName_copy = NEWTSTR_ALLOCA(him->resourceName); // copy resource name to prevent possible crash if user list rebuilds
+ TCHAR *resourceName_copy = NEWTSTR_ALLOCA(him->m_tszResourceName); // copy resource name to prevent possible crash if user list rebuilds
TCHAR *szInviteTo = 0;
int idx = gch->dwData - IDM_LINK0;
@@ -1211,7 +1211,7 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK*
if ( !szInviteTo) break;
- mir_sntprintf(szTitle, SIZEOF(szTitle), TranslateT("Invite %s to %s"), him->resourceName, szInviteTo);
+ mir_sntprintf(szTitle, SIZEOF(szTitle), TranslateT("Invite %s to %s"), him->m_tszResourceName, szInviteTo);
*szBuffer = 0;
if ( !ppro->EnterString(szBuffer, SIZEOF(szBuffer), szTitle, JES_MULTINE))
break;
@@ -1230,29 +1230,29 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK*
break;
case IDM_CPY_NICK:
- JabberCopyText((HWND)CallService(MS_CLUI_GETHWND, 0, 0), him->resourceName);
+ JabberCopyText((HWND)CallService(MS_CLUI_GETHWND, 0, 0), him->m_tszResourceName);
break;
case IDM_RJID_COPY:
case IDM_CPY_RJID:
- JabberCopyText((HWND)CallService(MS_CLUI_GETHWND, 0, 0), him->szRealJid);
+ JabberCopyText((HWND)CallService(MS_CLUI_GETHWND, 0, 0), him->m_tszRealJid);
break;
case IDM_CPY_INROOMJID:
- mir_sntprintf(szBuffer, SIZEOF(szBuffer), _T("%s/%s"), item->jid, him->resourceName);
+ mir_sntprintf(szBuffer, SIZEOF(szBuffer), _T("%s/%s"), item->jid, him->m_tszResourceName);
JabberCopyText((HWND)CallService(MS_CLUI_GETHWND, 0, 0), szBuffer);
break;
case IDM_RJID_VCARD:
- if (him->szRealJid && *him->szRealJid) {
+ if (him->m_tszRealJid && *him->m_tszRealJid) {
HANDLE hContact;
JABBER_SEARCH_RESULT jsr ={0};
jsr.hdr.cbSize = sizeof(JABBER_SEARCH_RESULT);
- mir_sntprintf(jsr.jid, SIZEOF(jsr.jid), _T("%s"), him->szRealJid);
+ mir_sntprintf(jsr.jid, SIZEOF(jsr.jid), _T("%s"), him->m_tszRealJid);
if (TCHAR *tmp = _tcschr(jsr.jid, _T('/'))) *tmp = 0;
JABBER_LIST_ITEM *item = ppro->ListAdd(LIST_VCARD_TEMP, jsr.jid);
- ppro->ListAddResource(LIST_VCARD_TEMP, jsr.jid, him->status, him->statusMessage, him->priority);
+ ppro->ListAddResource(LIST_VCARD_TEMP, jsr.jid, him->m_iStatus, him->m_tszStatusMessage, him->m_iPriority);
hContact = (HANDLE)CallProtoService(ppro->m_szModuleName, PS_ADDTOLIST, PALF_TEMPORARY, (LPARAM)&jsr);
CallService(MS_USERINFO_SHOWDIALOG, (WPARAM)hContact, 0);
@@ -1260,11 +1260,11 @@ static void sttNickListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK*
break;
case IDM_RJID_ADD:
- if (him->szRealJid && *him->szRealJid) {
+ if (him->m_tszRealJid && *him->m_tszRealJid) {
JABBER_SEARCH_RESULT jsr={0};
jsr.hdr.cbSize = sizeof(JABBER_SEARCH_RESULT);
jsr.hdr.flags = PSR_TCHAR;
- mir_sntprintf(jsr.jid, SIZEOF(jsr.jid), _T("%s"), him->szRealJid);
+ mir_sntprintf(jsr.jid, SIZEOF(jsr.jid), _T("%s"), him->m_tszRealJid);
if (TCHAR *tmp = _tcschr(jsr.jid, _T('/'))) *tmp = 0;
jsr.hdr.nick = jsr.jid;
@@ -1311,18 +1311,18 @@ static void sttLogListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* g
case IDM_TOPIC:
mir_sntprintf(szCaption, SIZEOF(szCaption), TranslateT("Set topic for %s"), gch->pDest->ptszID);
{
- size_t cbLen = 2048 + lstrlen(item->m_pItemResource->statusMessage)*2;
+ size_t cbLen = 2048 + lstrlen(item->m_pItemResource->m_tszStatusMessage)*2;
ptrT ptszBuf((TCHAR*)mir_alloc( sizeof(TCHAR) * cbLen));
- if (item->m_pItemResource->statusMessage) {
+ if (item->m_pItemResource->m_tszStatusMessage) {
TCHAR *d = ptszBuf;
for (int i = 0; i < (int)cbLen; i++) {
- if (item->m_pItemResource->statusMessage[ i ] != _T('\n') || (i && item->m_pItemResource->statusMessage[ i - 1 ] == _T('\r')))
- *d++ = item->m_pItemResource->statusMessage[ i ];
+ if (item->m_pItemResource->m_tszStatusMessage[ i ] != _T('\n') || (i && item->m_pItemResource->m_tszStatusMessage[ i - 1 ] == _T('\r')))
+ *d++ = item->m_pItemResource->m_tszStatusMessage[ i ];
else {
*d++ = _T('\r');
*d++ = _T('\n');
}
- if ( !item->m_pItemResource->statusMessage[ i ])
+ if ( !item->m_pItemResource->m_tszStatusMessage[ i ])
break;
}
*d = 0;
@@ -1409,7 +1409,7 @@ static void sttLogListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* g
case IDM_LINK5: case IDM_LINK6: case IDM_LINK7: case IDM_LINK8: case IDM_LINK9:
{
unsigned idx = IDM_LINK0;
- for (TCHAR *p = _tcsstr(item->m_pItemResource->statusMessage, _T("http://")); p && *p; p = _tcsstr(p+1, _T("http://")))
+ for (TCHAR *p = _tcsstr(item->m_pItemResource->m_tszStatusMessage, _T("http://")); p && *p; p = _tcsstr(p+1, _T("http://")))
{
if (idx == gch->dwData)
{
@@ -1431,7 +1431,7 @@ static void sttLogListHook(CJabberProto *ppro, JABBER_LIST_ITEM *item, GCHOOK* g
JabberCopyText((HWND)CallService(MS_CLUI_GETHWND, 0, 0), item->jid);
break;
case IDM_CPY_TOPIC:
- JabberCopyText((HWND)CallService(MS_CLUI_GETHWND, 0, 0), item->m_pItemResource->statusMessage);
+ JabberCopyText((HWND)CallService(MS_CLUI_GETHWND, 0, 0), item->m_pItemResource->m_tszStatusMessage);
break;
}
}
@@ -1447,7 +1447,7 @@ static void sttSendPrivateMessage(CJabberProto *ppro, JABBER_LIST_ITEM *item, co
if (hContact != NULL) {
pResourceStatus r( item->findResource(nick));
if (r)
- ppro->setWord(hContact, "Status", r->status);
+ ppro->setWord(hContact, "Status", r->m_iStatus);
db_set_b(hContact, "CList", "Hidden", 1);
ppro->setTString(hContact, "Nick", nick);
diff --git a/protocols/JabberG/src/jabber_disco.cpp b/protocols/JabberG/src/jabber_disco.cpp
index 5f89785f31..dec2a9f62e 100644
--- a/protocols/JabberG/src/jabber_disco.cpp
+++ b/protocols/JabberG/src/jabber_disco.cpp
@@ -168,7 +168,7 @@ static void sttApplyNodeIcon(HTREELISTITEM hItem, CJabberSDNode *pNode);
void CJabberProto::OnIqResultServiceDiscoveryInfo(HXML iqNode, CJabberIqInfo* pInfo)
{
m_SDManager.Lock();
- CJabberSDNode* pNode = m_SDManager.FindByIqId(pInfo->GetIqId(), TRUE);
+ CJabberSDNode *pNode = m_SDManager.FindByIqId(pInfo->GetIqId(), TRUE);
if ( !pNode) {
m_SDManager.Unlock();
return;
@@ -214,7 +214,7 @@ void CJabberProto::OnIqResultServiceDiscoveryInfo(HXML iqNode, CJabberIqInfo* pI
void CJabberProto::OnIqResultServiceDiscoveryItems(HXML iqNode, CJabberIqInfo* pInfo)
{
m_SDManager.Lock();
- CJabberSDNode* pNode = m_SDManager.FindByIqId(pInfo->GetIqId(), FALSE);
+ CJabberSDNode *pNode = m_SDManager.FindByIqId(pInfo->GetIqId(), FALSE);
if ( !pNode) {
m_SDManager.Unlock();
return;
@@ -303,7 +303,7 @@ void CJabberProto::OnIqResultServiceDiscoveryRootItems(HXML iqNode, CJabberIqInf
m_ThreadInfo->send(packet);
}
-BOOL CJabberProto::SendInfoRequest(CJabberSDNode* pNode, HXML parent)
+BOOL CJabberProto::SendInfoRequest(CJabberSDNode *pNode, HXML parent)
{
if ( !pNode || !m_bJabberOnline)
return FALSE;
@@ -333,7 +333,7 @@ BOOL CJabberProto::SendInfoRequest(CJabberSDNode* pNode, HXML parent)
return TRUE;
}
-BOOL CJabberProto::SendBothRequests(CJabberSDNode* pNode, HXML parent)
+BOOL CJabberProto::SendBothRequests(CJabberSDNode *pNode, HXML parent)
{
if ( !pNode || !m_bJabberOnline)
return FALSE;
@@ -412,7 +412,7 @@ void CJabberProto::PerformBrowse(HWND hwndDlg)
if (m_lstTransports.getIndex(item->jid) == -1)
m_lstTransports.insert(mir_tstrdup(item->jid));
- CJabberSDNode* pNode = m_SDManager.AddPrimaryNode(item->jid, NULL, NULL);
+ CJabberSDNode *pNode = m_SDManager.AddPrimaryNode(item->jid, NULL, NULL);
SendBothRequests(pNode, NULL);
} }
} }
@@ -452,7 +452,7 @@ void CJabberProto::PerformBrowse(HWND hwndDlg)
getTString(setting, &dbvJid);
mir_snprintf(setting, sizeof(setting), "discoWnd_favNode_%d", i);
getTString(setting, &dbvNode);
- CJabberSDNode* pNode = m_SDManager.AddPrimaryNode(dbvJid.ptszVal, dbvNode.ptszVal, dbv.ptszVal);
+ CJabberSDNode *pNode = m_SDManager.AddPrimaryNode(dbvJid.ptszVal, dbvNode.ptszVal, dbv.ptszVal);
SendBothRequests(pNode, NULL);
db_free(&dbv);
db_free(&dbvJid);
@@ -460,7 +460,7 @@ void CJabberProto::PerformBrowse(HWND hwndDlg)
} } }
else {
sttBrowseMode = SD_BROWSE_NORMAL;
- CJabberSDNode* pNode = m_SDManager.AddPrimaryNode(szJid, _tcslen(szNode) ? szNode : NULL, NULL);
+ CJabberSDNode *pNode = m_SDManager.AddPrimaryNode(szJid, _tcslen(szNode) ? szNode : NULL, NULL);
SendBothRequests(pNode, NULL);
}
m_SDManager.Unlock();
@@ -541,7 +541,7 @@ void CJabberProto::ApplyNodeIcon(HTREELISTITEM hItem, CJabberSDNode *pNode)
TreeList_SetIcon(pNode->GetTreeItemHandle(), iIcon, iOverlay);
}
-BOOL CJabberProto::SyncTree(HTREELISTITEM hIndex, CJabberSDNode* pNode)
+BOOL CJabberProto::SyncTree(HTREELISTITEM hIndex, CJabberSDNode *pNode)
{
if ( !m_pDlgServiceDiscovery) return FALSE;
@@ -909,7 +909,7 @@ void CJabberDlgDiscovery::btnRefresh_OnClick(CCtrlButton *)
m_proto->m_SDManager.Lock();
XmlNode packet(NULL);
- CJabberSDNode* pNode = (CJabberSDNode*)TreeList_GetData(hItem);
+ CJabberSDNode *pNode = (CJabberSDNode*)TreeList_GetData(hItem);
if (pNode) {
TreeList_ResetItem(GetDlgItem(m_hwnd, IDC_TREE_DISCO), hItem);
pNode->ResetInfo();
@@ -972,7 +972,7 @@ INT_PTR CJabberDlgDiscovery::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
if (wParam == REFRESH_TIMER) {
m_proto->m_SDManager.Lock();
- CJabberSDNode* pNode = m_proto->m_SDManager.GetPrimaryNode();
+ CJabberSDNode *pNode = m_proto->m_SDManager.GetPrimaryNode();
while (pNode)
{
if (pNode->GetJid()) {
@@ -1074,10 +1074,10 @@ INT_PTR CJabberDlgDiscovery::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
ListView_GetItem(pHeader->hwndFrom, &lvi);
HTREELISTITEM hItem = (HTREELISTITEM)lvi.lParam;
m_proto->m_SDManager.Lock();
- CJabberSDNode* pNode = (CJabberSDNode*)TreeList_GetData(hItem);
- if (pNode) {
+ CJabberSDNode *pNode = (CJabberSDNode*)TreeList_GetData(hItem);
+ if (pNode)
pNode->GetTooltipText(pInfoTip->pszText, pInfoTip->cchTextMax);
- }
+
m_proto->m_SDManager.Unlock();
}
else if (pHeader->code == TVN_ITEMEXPANDED) {
@@ -1086,10 +1086,8 @@ INT_PTR CJabberDlgDiscovery::DlgProc(UINT msg, WPARAM wParam, LPARAM lParam)
m_proto->m_SDManager.Lock();
XmlNode packet(NULL);
- CJabberSDNode* pNode;
- pNode = (CJabberSDNode*)TreeList_GetData(hItem);
- if (pNode)
- {
+ CJabberSDNode *pNode = (CJabberSDNode*)TreeList_GetData(hItem);
+ if (pNode) {
m_proto->SendBothRequests(pNode, packet);
TreeList_MakeFakeParent(hItem, FALSE);
}
@@ -1170,15 +1168,15 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM
};
enum {
- SD_FLG_NONODE = 0x001,
- SD_FLG_NOTONROSTER = 0x002,
- SD_FLG_ONROSTER = 0x004,
- SD_FLG_SUBSCRIBED = 0x008,
- SD_FLG_NOTSUBSCRIBED = 0x010,
- SD_FLG_ONLINE = 0x020,
- SD_FLG_NOTONLINE = 0x040,
- SD_FLG_NORESOURCE = 0x080,
- SD_FLG_HASUSER = 0x100
+ SD_FLG_NONODE = 0x001,
+ SD_FLG_NOTONROSTER = 0x002,
+ SD_FLG_ONROSTER = 0x004,
+ SD_FLG_SUBSCRIBED = 0x008,
+ SD_FLG_NOTSUBSCRIBED = 0x010,
+ SD_FLG_ONLINE = 0x020,
+ SD_FLG_NOTONLINE = 0x040,
+ SD_FLG_NORESOURCE = 0x080,
+ SD_FLG_HASUSER = 0x100
};
struct
@@ -1218,46 +1216,40 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM
HMENU hMenu = CreatePopupMenu();
BOOL lastSeparator = TRUE;
bool bFilterItems = !GetAsyncKeyState(VK_CONTROL);
- for (int i = 0; i < SIZEOF(items); i++)
- {
+ for (int i = 0; i < SIZEOF(items); i++) {
JABBER_LIST_ITEM *rosterItem = NULL;
-
- if (bFilterItems)
- {
- if ((items[i].flags&SD_FLG_NONODE) && pNode->GetNode())
+ if (bFilterItems) {
+ if ((items[i].flags & SD_FLG_NONODE) && pNode->GetNode())
continue;
- if ((items[i].flags&SD_FLG_NOTONROSTER) && (rosterItem = ListGetItemPtr(LIST_ROSTER, pNode->GetJid())))
+ if ((items[i].flags & SD_FLG_NOTONROSTER) && (rosterItem = ListGetItemPtr(LIST_ROSTER, pNode->GetJid())))
continue;
- if ((items[i].flags&SD_FLG_ONROSTER) && !(rosterItem = ListGetItemPtr(LIST_ROSTER, pNode->GetJid())))
+ if ((items[i].flags & SD_FLG_ONROSTER) && !(rosterItem = ListGetItemPtr(LIST_ROSTER, pNode->GetJid())))
continue;
- if ((items[i].flags&SD_FLG_SUBSCRIBED) && (!rosterItem || (rosterItem->subscription == SUB_NONE)))
+ if ((items[i].flags & SD_FLG_SUBSCRIBED) && (!rosterItem || (rosterItem->subscription == SUB_NONE)))
continue;
- if ((items[i].flags&SD_FLG_NOTSUBSCRIBED) && (rosterItem && (rosterItem->subscription != SUB_NONE)))
+ if ((items[i].flags & SD_FLG_NOTSUBSCRIBED) && (rosterItem && (rosterItem->subscription != SUB_NONE)))
continue;
- if ((items[i].flags&SD_FLG_ONLINE) && rosterItem && (rosterItem->m_pItemResource->status != ID_STATUS_OFFLINE))
+ if ((items[i].flags & SD_FLG_ONLINE) && rosterItem && (rosterItem->m_pItemResource->m_iStatus != ID_STATUS_OFFLINE))
continue;
- if ((items[i].flags&SD_FLG_NOTONLINE) && rosterItem && (rosterItem->m_pItemResource->status == ID_STATUS_OFFLINE))
+ if ((items[i].flags & SD_FLG_NOTONLINE) && rosterItem && (rosterItem->m_pItemResource->m_iStatus == ID_STATUS_OFFLINE))
continue;
- if ((items[i].flags&SD_FLG_NORESOURCE) && _tcschr(pNode->GetJid(), _T('/')))
+ if ((items[i].flags & SD_FLG_NORESOURCE) && _tcschr(pNode->GetJid(), _T('/')))
continue;
- if ((items[i].flags&SD_FLG_HASUSER) && !_tcschr(pNode->GetJid(), _T('@')))
+ if ((items[i].flags & SD_FLG_HASUSER) && !_tcschr(pNode->GetJid(), _T('@')))
continue;
}
- if ( !items[i].feature)
- {
- if (items[i].title)
- {
+ if ( !items[i].feature) {
+ if (items[i].title) {
HANDLE hContact;
if ((items[i].action == SD_ACT_USERMENU) && (hContact = HContactFromJID(pNode->GetJid()))) {
HMENU hContactMenu = (HMENU)CallService(MS_CLIST_MENUBUILDCONTACT, (WPARAM)hContact, 0);
AppendMenu(hMenu, MF_STRING|MF_POPUP, (UINT_PTR)hContactMenu, TranslateTS(items[i].title));
- } else
- AppendMenu(hMenu, MF_STRING, items[i].action, TranslateTS(items[i].title));
+ }
+ else AppendMenu(hMenu, MF_STRING, items[i].action, TranslateTS(items[i].title));
lastSeparator = FALSE;
- } else
- if ( !lastSeparator)
- {
+ }
+ else if (!lastSeparator) {
AppendMenu(hMenu, MF_SEPARATOR, 0, NULL);
lastSeparator = TRUE;
}
@@ -1267,29 +1259,24 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM
bool bFeatureOk = !bFilterItems;
if (bFilterItems)
for (CJabberSDFeature *iFeature = pNode->GetFirstFeature(); iFeature; iFeature = iFeature->GetNext())
- if ( !lstrcmp(iFeature->GetVar(), items[i].feature))
- {
+ if ( !lstrcmp(iFeature->GetVar(), items[i].feature)) {
bFeatureOk = true;
break;
}
- if (bFeatureOk)
- {
- if (items[i].title)
- {
+ if (bFeatureOk) {
+ if (items[i].title) {
AppendMenu(hMenu, MF_STRING, items[i].action, TranslateTS(items[i].title));
lastSeparator = FALSE;
- } else
- if ( !lastSeparator)
- {
+ }
+ else if (!lastSeparator) {
AppendMenu(hMenu, MF_SEPARATOR, 0, NULL);
lastSeparator = TRUE;
}
}
}
- if ( !GetMenuItemCount(hMenu))
- {
+ if ( !GetMenuItemCount(hMenu)) {
DestroyMenu(hMenu);
return;
}
@@ -1297,9 +1284,8 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM
int res = TrackPopupMenu(hMenu, TPM_RETURNCMD, pt.x, pt.y, 0, m_pDlgServiceDiscovery->GetHwnd(), NULL);
DestroyMenu(hMenu);
- switch (res)
- {
- case SD_ACT_REFRESH:
+ switch (res) {
+ case SD_ACT_REFRESH:
{
m_SDManager.Lock();
XmlNode packet(NULL);
@@ -1314,10 +1300,10 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM
if (xmlGetChild(packet))
m_ThreadInfo->send(packet);
- break;
}
+ break;
- case SD_ACT_REFRESHCHILDREN:
+ case SD_ACT_REFRESHCHILDREN:
{
m_SDManager.Lock();
XmlNode packet(NULL);
@@ -1335,31 +1321,32 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM
if (xmlGetChildCount(packet) > 50) {
m_ThreadInfo->send(packet);
packet = XmlNode(NULL);
- } }
+ }
+ }
m_SDManager.Unlock();
if (xmlGetChildCount(packet))
m_ThreadInfo->send(packet);
- break;
}
+ break;
- case SD_ACT_COPYJID:
- JabberCopyText(m_pDlgServiceDiscovery->GetHwnd(), pNode->GetJid());
- break;
+ case SD_ACT_COPYJID:
+ JabberCopyText(m_pDlgServiceDiscovery->GetHwnd(), pNode->GetJid());
+ break;
- case SD_ACT_COPYNODE:
- JabberCopyText(m_pDlgServiceDiscovery->GetHwnd(), pNode->GetNode());
- break;
+ case SD_ACT_COPYNODE:
+ JabberCopyText(m_pDlgServiceDiscovery->GetHwnd(), pNode->GetNode());
+ break;
- case SD_ACT_COPYINFO:
+ case SD_ACT_COPYINFO:
{
TCHAR buf[8192];
pNode->GetTooltipText(buf, SIZEOF(buf));
JabberCopyText(m_pDlgServiceDiscovery->GetHwnd(), buf);
- break;
}
+ break;
- case SD_ACT_FAVORITE:
+ case SD_ACT_FAVORITE:
{
char setting[MAXMODULELABELLENGTH];
int count = getDword("discoWnd_favCount", 0);
@@ -1370,35 +1357,35 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM
mir_snprintf(setting, sizeof(setting), "discoWnd_favNode_%d", count);
setTString(setting, pNode->GetNode() ? pNode->GetNode() : _T(""));
setDword("discoWnd_favCount", ++count);
- break;
}
+ break;
- case SD_ACT_REGISTER:
- RegisterAgent(m_pDlgServiceDiscovery->GetHwnd(), pNode->GetJid());
- break;
+ case SD_ACT_REGISTER:
+ RegisterAgent(m_pDlgServiceDiscovery->GetHwnd(), pNode->GetJid());
+ break;
- case SD_ACT_ADHOC:
- ContactMenuAdhocCommands(new CJabberAdhocStartupParams(this, pNode->GetJid(), pNode->GetNode()));
- break;
+ case SD_ACT_ADHOC:
+ ContactMenuAdhocCommands(new CJabberAdhocStartupParams(this, pNode->GetJid(), pNode->GetNode()));
+ break;
- case SD_ACT_ADDDIRECTORY:
- SearchAddToRecent(pNode->GetJid());
- break;
+ case SD_ACT_ADDDIRECTORY:
+ SearchAddToRecent(pNode->GetJid());
+ break;
- case SD_ACT_PROXY:
- m_options.BsDirect = FALSE;
- m_options.BsProxyManual = TRUE;
- setTString("BsProxyServer", pNode->GetJid());
- break;
+ case SD_ACT_PROXY:
+ m_options.BsDirect = FALSE;
+ m_options.BsProxyManual = TRUE;
+ setTString("BsProxyServer", pNode->GetJid());
+ break;
- case SD_ACT_JOIN:
- if (jabberChatDllPresent)
- GroupchatJoinRoomByJid(m_pDlgServiceDiscovery->GetHwnd(), pNode->GetJid());
- else
- JabberChatDllError();
- break;
+ case SD_ACT_JOIN:
+ if (jabberChatDllPresent)
+ GroupchatJoinRoomByJid(m_pDlgServiceDiscovery->GetHwnd(), pNode->GetJid());
+ else
+ JabberChatDllError();
+ break;
- case SD_ACT_BOOKMARK:
+ case SD_ACT_BOOKMARK:
{
JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_BOOKMARK, pNode->GetJid());
if (item == NULL) {
@@ -1410,11 +1397,12 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM
if (item != NULL) {
item->type = _T("conference");
AddEditBookmark(item);
- } }
- break;
+ }
+ }
}
+ break;
- case SD_ACT_USERMENU:
+ case SD_ACT_USERMENU:
{
HANDLE hContact = HContactFromJID(pNode->GetJid());
if ( !hContact) {
@@ -1426,12 +1414,12 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM
GetCursorPos(&pt);
int res = TrackPopupMenu(hContactMenu, TPM_RETURNCMD, pt.x, pt.y, 0, m_pDlgServiceDiscovery->GetHwnd(), NULL);
CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(res, MPCF_CONTACTMENU), (LPARAM)hContact);
- break;
}
+ break;
- case SD_ACT_VCARD:
+ case SD_ACT_VCARD:
{
- TCHAR * jid = pNode->GetJid();
+ TCHAR *jid = pNode->GetJid();
HANDLE hContact = HContactFromJID(pNode->GetJid());
if ( !hContact) {
JABBER_SEARCH_RESULT jsr={0};
@@ -1446,37 +1434,37 @@ void CJabberProto::ServiceDiscoveryShowMenu(CJabberSDNode *pNode, HTREELISTITEM
ListAddResource(LIST_VCARD_TEMP, jid, ID_STATUS_OFFLINE, NULL, 0);
}
CallService(MS_USERINFO_SHOWDIALOG, (WPARAM)hContact, 0);
- break;
}
+ break;
- case SD_ACT_ROSTER:
+ case SD_ACT_ROSTER:
{
HANDLE hContact = DBCreateContact(pNode->GetJid(), pNode->GetName(), FALSE, FALSE);
db_unset(hContact, "CList", "NotOnList");
JABBER_LIST_ITEM *item = ListAdd(LIST_VCARD_TEMP, pNode->GetJid());
item->bUseResource = TRUE;
- break;
}
+ break;
- case SD_ACT_LOGON:
- case SD_ACT_LOGOFF:
- m_ThreadInfo->send(XmlNode(_T("presence")) << XATTR(_T("to"), pNode->GetJid()) << XATTR(_T("type"), (res != SD_ACT_LOGON) ? _T("unavailable") : NULL));
- break;
+ case SD_ACT_LOGON:
+ case SD_ACT_LOGOFF:
+ m_ThreadInfo->send(XmlNode(_T("presence")) << XATTR(_T("to"), pNode->GetJid()) << XATTR(_T("type"), (res != SD_ACT_LOGON) ? _T("unavailable") : NULL));
+ break;
- case SD_ACT_UNREGISTER:
- m_ThreadInfo->send( XmlNodeIq(_T("set"), SerialNext(), pNode->GetJid()) << XQUERY(JABBER_FEAT_REGISTER) << XCHILD(_T("remove")));
+ case SD_ACT_UNREGISTER:
+ m_ThreadInfo->send( XmlNodeIq(_T("set"), SerialNext(), pNode->GetJid()) << XQUERY(JABBER_FEAT_REGISTER) << XCHILD(_T("remove")));
- m_ThreadInfo->send( XmlNodeIq(_T("set"), SerialNext()) << XQUERY(JABBER_FEAT_IQ_ROSTER)
- << XCHILD(_T("item")) << XATTR(_T("jid"), pNode->GetJid()) << XATTR(_T("subscription"), _T("remove")));
- break;
+ m_ThreadInfo->send( XmlNodeIq(_T("set"), SerialNext()) << XQUERY(JABBER_FEAT_IQ_ROSTER)
+ << XCHILD(_T("item")) << XATTR(_T("jid"), pNode->GetJid()) << XATTR(_T("subscription"), _T("remove")));
+ break;
- default:
- if ((res >= CLISTMENUIDMIN) && (res <= CLISTMENUIDMAX)) {
- HANDLE hContact = HContactFromJID(pNode->GetJid());
- if (hContact)
- CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(res, MPCF_CONTACTMENU), (LPARAM)hContact);
- }
- break;
+ default:
+ if ((res >= CLISTMENUIDMIN) && (res <= CLISTMENUIDMAX)) {
+ HANDLE hContact = HContactFromJID(pNode->GetJid());
+ if (hContact)
+ CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(res, MPCF_CONTACTMENU), (LPARAM)hContact);
+ }
+ break;
}
}
@@ -1489,7 +1477,8 @@ void CJabberProto::LaunchServiceDiscovery(TCHAR *jid)
SetDlgItemTextA(m_pDlgServiceDiscovery->GetHwnd(), IDC_COMBO_NODE, "");
PostMessage(m_pDlgServiceDiscovery->GetHwnd(), WM_COMMAND, MAKEWPARAM(IDC_BUTTON_BROWSE, 0), 0);
}
- } else {
+ }
+ else {
m_pDlgServiceDiscovery = new CJabberDlgDiscovery(this, jid);
m_pDlgServiceDiscovery->Show();
}
diff --git a/protocols/JabberG/src/jabber_groupchat.cpp b/protocols/JabberG/src/jabber_groupchat.cpp
index 7597c9bdd8..4bd9b689a1 100644
--- a/protocols/JabberG/src/jabber_groupchat.cpp
+++ b/protocols/JabberG/src/jabber_groupchat.cpp
@@ -868,7 +868,7 @@ void CJabberProto::RenameParticipantNick(JABBER_LIST_ITEM *item, const TCHAR *ol
if (r == NULL)
return;
- replaceStrT(r->resourceName, newNick);
+ r->m_tszResourceName = mir_tstrdup(newNick);
if ( !lstrcmp(item->nick, oldNick)) {
replaceStrT(item->nick, newNick);
@@ -921,11 +921,11 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
nNode = xmlGetChildByTag(node, "nick:nick", "xmlns:nick", JABBER_FEAT_NICK);
const TCHAR *cnick = xmlGetText(nNode);
- const TCHAR *nick = cnick ? cnick : (r && r->nick ? r->nick : resource);
+ const TCHAR *nick = cnick ? cnick : (r && r->m_tszNick ? r->m_tszNick : resource);
// process custom nick change
- if (cnick && r && r->nick && _tcscmp(cnick, r->nick))
- replaceStrT(r->nick, cnick);
+ if (cnick && r && r->m_tszNick && _tcscmp(cnick, r->m_tszNick))
+ r->m_tszNick = mir_tstrdup(cnick);
HXML xNode = xmlGetChildByTag(node, "x", "xmlns", JABBER_FEAT_MUC_USER);
HXML xUserNode = xmlGetChildByTag(node, "user:x", "xmlns:user", JABBER_FEAT_MUC_USER);
@@ -962,7 +962,7 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
int newRes = ListAddResource(LIST_CHATROOM, from, status, str, priority, cnick) ? GC_EVENT_JOIN : 0;
if (pResourceStatus oldRes = ListFindResource(LIST_CHATROOM, from))
- if ((oldRes->status != status) || lstrcmp_null(oldRes->statusMessage, str))
+ if ((oldRes->m_iStatus != status) || lstrcmp_null(oldRes->m_tszStatusMessage, str))
bStatusChanged = true;
// Check additional MUC info for this user
@@ -970,8 +970,8 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
if (r == NULL)
r = item->findResource(resource);
if (r != NULL) {
- JABBER_GC_AFFILIATION affiliation = r->affiliation;
- JABBER_GC_ROLE role = r->role;
+ JABBER_GC_AFFILIATION affiliation = r->m_affiliation;
+ JABBER_GC_ROLE role = r->m_role;
if ((str = xmlGetAttrValue(itemNode, _T("affiliation"))) != NULL) {
if ( !_tcscmp(str, _T("owner"))) affiliation = AFFILIATION_OWNER;
@@ -992,19 +992,19 @@ void CJabberProto::GroupchatProcessPresence(HXML node)
if ( !newRes) newRes = GC_EVENT_ADDSTATUS;
}
- if (affiliation != r->affiliation) {
- r->affiliation = affiliation;
+ if (affiliation != r->m_affiliation) {
+ r->m_affiliation = affiliation;
bAffiliationChanged = true;
}
- if (role != r->role) {
- r->role = role;
- if (r->role != ROLE_NONE)
+ if (role != r->m_role) {
+ r->m_role = role;
+ if (r->m_role != ROLE_NONE)
bRoleChanged = true;
}
if (str = xmlGetAttrValue(itemNode, _T("jid")))
- replaceStrT(r->szRealJid, str);
+ r->m_tszRealJid = mir_tstrdup(str);
}
}
@@ -1162,8 +1162,9 @@ void CJabberProto::GroupchatProcessMessage(HXML node)
if (tmptr != NULL && *tmptr != 0) {
*(TCHAR*)(--tmptr) = 0;
resource = tmpnick;
- } }
- replaceStrT(item->m_pItemResource->statusMessage, msgText);
+ }
+ }
+ item->m_pItemResource->m_tszStatusMessage = mir_tstrdup(msgText);
}
else {
if ((n = xmlGetChildByTag(node , "body", "xml:lang", m_tszSelectedLang)) == NULL)
@@ -1199,7 +1200,7 @@ void CJabberProto::GroupchatProcessMessage(HXML node)
if (resource != NULL) {
pResourceStatus r( item->findResource(resource));
- nick = (r && r->nick) ? r->nick : resource;
+ nick = (r && r->m_tszNick) ? r->m_tszNick : resource;
}
else nick = NULL;
diff --git a/protocols/JabberG/src/jabber_iqid.cpp b/protocols/JabberG/src/jabber_iqid.cpp
index 7c1d9a9709..f34c53ca49 100644
--- a/protocols/JabberG/src/jabber_iqid.cpp
+++ b/protocols/JabberG/src/jabber_iqid.cpp
@@ -1627,10 +1627,10 @@ void CJabberProto::OnIqResultLastActivity(HXML iqNode, CJabberIqInfo* pInfo)
LPCTSTR szLastStatusMessage = XPathT(iqNode, "query[@xmlns='jabber:iq:last']");
if (szLastStatusMessage) // replace only if it exists
- replaceStrT(r->statusMessage, szLastStatusMessage);
+ r->m_tszStatusMessage = mir_tstrdup(szLastStatusMessage);
}
- r->idleStartTime = lastActivity;
+ r->m_dwIdleStartTime = lastActivity;
JabberUserInfoUpdate(pInfo->GetHContact());
}
diff --git a/protocols/JabberG/src/jabber_list.cpp b/protocols/JabberG/src/jabber_list.cpp
index 1533733ca1..dc0539869b 100644
--- a/protocols/JabberG/src/jabber_list.cpp
+++ b/protocols/JabberG/src/jabber_list.cpp
@@ -71,19 +71,8 @@ JABBER_RESOURCE_STATUS::JABBER_RESOURCE_STATUS() :
JABBER_RESOURCE_STATUS::~JABBER_RESOURCE_STATUS()
{
- mir_free(resourceName);
- mir_free(nick);
- mir_free(statusMessage);
- mir_free(software);
- mir_free(version);
- mir_free(system);
- mir_free(szCapsNode);
- mir_free(szCapsVer);
- mir_free(szCapsExt);
- mir_free(szRealJid);
-
- if (pSoftwareInfo)
- delete pSoftwareInfo;
+ if (m_pSoftwareInfo)
+ delete m_pSoftwareInfo;
}
void JABBER_RESOURCE_STATUS::AddRef()
@@ -150,7 +139,7 @@ JABBER_LIST_ITEM *CJabberProto::ListAdd(JABBER_LIST list, const TCHAR *jid)
item->bUseResource = bUseResource;
if (!bUseResource) {
item->m_pItemResource = new JABBER_RESOURCE_STATUS();
- item->m_pItemResource->status = ID_STATUS_OFFLINE;
+ item->m_pItemResource->m_iStatus = ID_STATUS_OFFLINE;
}
m_lstRoster.insert(item);
lck.unlock();
@@ -237,7 +226,7 @@ pResourceStatus JABBER_LIST_ITEM::findResource(const TCHAR *resourceName) const
for (int i=0; i < arResources.getCount(); i++) {
JABBER_RESOURCE_STATUS *r = arResources[i];
- if ( !_tcscmp(r->resourceName, resourceName))
+ if ( !_tcscmp(r->m_tszResourceName, resourceName))
return r;
}
@@ -272,29 +261,29 @@ bool CJabberProto::ListAddResource(JABBER_LIST list, const TCHAR *jid, int statu
if (resource[0]) {
pResourceStatus r( LI->findResource(resource));
if (r != NULL) { // Already exists, update status and statusMessage
- r->status = status;
- replaceStrT(r->statusMessage, statusMessage);
- r->priority = priority;
+ r->m_iStatus = status;
+ r->m_tszStatusMessage = mir_tstrdup(statusMessage);
+ r->m_iPriority = priority;
}
else { // Does not exist, add new resource
bIsNewResource = true;
r = new JABBER_RESOURCE_STATUS();
- r->status = status;
- r->affiliation = AFFILIATION_NONE;
- r->role = ROLE_NONE;
- r->resourceName = mir_tstrdup(resource);
- r->nick = mir_tstrdup(nick);
+ r->m_iStatus = status;
+ r->m_affiliation = AFFILIATION_NONE;
+ r->m_role = ROLE_NONE;
+ r->m_tszResourceName = mir_tstrdup(resource);
+ r->m_tszNick = mir_tstrdup(nick);
if (statusMessage)
- r->statusMessage = mir_tstrdup(statusMessage);
- r->priority = priority;
+ r->m_tszStatusMessage = mir_tstrdup(statusMessage);
+ r->m_iPriority = priority;
LI->arResources.insert(r);
} }
}
// No resource, update the main statusMessage
else {
LI->m_pItemResource = new JABBER_RESOURCE_STATUS();
- LI->m_pItemResource->status = status;
- replaceStrT(LI->m_pItemResource->statusMessage, statusMessage);
+ LI->m_pItemResource->m_iStatus = status;
+ LI->m_pItemResource->m_tszStatusMessage = mir_tstrdup(statusMessage);
}
lck.unlock();
@@ -320,13 +309,13 @@ void CJabberProto::ListRemoveResource(JABBER_LIST list, const TCHAR *jid)
return;
// Found last seen resource ID to be removed
- if (LI->pLastSeenResource == r)
- LI->pLastSeenResource = NULL;
+ if (LI->m_pLastSeenResource == r)
+ LI->m_pLastSeenResource = NULL;
// update manually selected resource ID
- if (LI->resourceMode == RSMODE_MANUAL && LI->pManualResource == r) {
+ if (LI->resourceMode == RSMODE_MANUAL && LI->m_pManualResource == r) {
LI->resourceMode = RSMODE_LASTSEEN;
- LI->pManualResource = NULL;
+ LI->m_pManualResource = NULL;
}
// Update MirVer due to possible resource changes
@@ -348,16 +337,16 @@ pResourceStatus JABBER_LIST_ITEM::getBestResource() const
return arResources[0];
if (resourceMode == RSMODE_LASTSEEN)
- return pLastSeenResource;
+ return m_pLastSeenResource;
if (resourceMode == RSMODE_MANUAL)
- return pManualResource;
+ return m_pManualResource;
int nBestPos = -1, nBestPri = -200;
for (int i=0; i < arResources.getCount(); i++) {
JABBER_RESOURCE_STATUS *r = arResources[i];
- if (r->priority > nBestPri) {
- nBestPri = r->priority;
+ if (r->m_iPriority > nBestPri) {
+ nBestPri = r->m_iPriority;
nBestPos = i;
}
}
@@ -374,14 +363,14 @@ TCHAR* CJabberProto::ListGetBestClientResourceNamePtr(const TCHAR *jid)
pResourceStatus r( LI->getBestResource());
if (r != NULL)
- return r->resourceName;
+ return r->m_tszResourceName;
int status = ID_STATUS_OFFLINE;
TCHAR *res = NULL;
for (int i=0; i < LI->arResources.getCount(); i++) {
r = LI->arResources[i];
bool foundBetter = false;
- switch (r->status) {
+ switch (r->m_iStatus) {
case ID_STATUS_FREECHAT:
foundBetter = true;
break;
@@ -403,8 +392,8 @@ TCHAR* CJabberProto::ListGetBestClientResourceNamePtr(const TCHAR *jid)
break;
}
if (foundBetter) {
- res = r->resourceName;
- status = r->status;
+ res = r->m_tszResourceName;
+ status = r->m_iStatus;
}
}
diff --git a/protocols/JabberG/src/jabber_list.h b/protocols/JabberG/src/jabber_list.h
index 88b646c1c0..38f22a79ef 100644
--- a/protocols/JabberG/src/jabber_list.h
+++ b/protocols/JabberG/src/jabber_list.h
@@ -84,32 +84,33 @@ public:
void AddRef();
void Release();
- int status;
- TCHAR* resourceName;
- TCHAR* nick;
- TCHAR* statusMessage;
- TCHAR* software;
- TCHAR* version;
- TCHAR* system;
- signed char priority; // resource priority, -128..+127
- time_t idleStartTime;// XEP-0012 support
- JABBER_GC_AFFILIATION affiliation;
- JABBER_GC_ROLE role;
- TCHAR* szRealJid; // real jid for jabber conferences
+ int m_iStatus;
+ ptrT m_tszResourceName;
+ ptrT m_tszStatusMessage;
+ int m_iPriority; // resource priority, -128..+127
+ time_t m_dwIdleStartTime;// XEP-0012 support
+
+ // groupchat support
+ JABBER_GC_AFFILIATION m_affiliation;
+ JABBER_GC_ROLE m_role;
+ ptrT m_tszNick;
+ ptrT m_tszRealJid; // real jid for jabber conferences
// XEP-0115 support
- TCHAR* szCapsNode;
- TCHAR* szCapsVer;
- TCHAR* szCapsExt;
- DWORD dwVersionRequestTime;
- DWORD dwDiscoInfoRequestTime;
- JabberCapsBits jcbCachedCaps;
- JabberCapsBits jcbManualDiscoveredCaps;
+ 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-0085 gone event support
- BOOL bMessageSessionActive;
+ BOOL m_bMessageSessionActive;
- JABBER_XEP0232_SOFTWARE_INFO* pSoftwareInfo;
+ JABBER_XEP0232_SOFTWARE_INFO *m_pSoftwareInfo;
};
class pResourceStatus
@@ -160,9 +161,9 @@ struct JABBER_LIST_ITEM : public MZeroedObject
JABBER_RESOURCE_MODE resourceMode;
LIST<JABBER_RESOURCE_STATUS> arResources; // array of resources
JABBER_RESOURCE_STATUS
- *pLastSeenResource, // resource which was last seen active
- *pManualResource, // manually set resource
- *m_pItemResource; // resource for jids without /resource node
+ *m_pLastSeenResource, // resource which was last seen active
+ *m_pManualResource, // manually set resource
+ *m_pItemResource; // resource for jids without /resource node
JABBER_SUBSCRIPTION subscription;
TCHAR* group;
diff --git a/protocols/JabberG/src/jabber_menu.cpp b/protocols/JabberG/src/jabber_menu.cpp
index 9cfba1f4d2..7d2ae259a0 100644
--- a/protocols/JabberG/src/jabber_menu.cpp
+++ b/protocols/JabberG/src/jabber_menu.cpp
@@ -451,14 +451,14 @@ int CJabberProto::OnPrebuildContactMenu(WPARAM wParam, LPARAM)
pResourceStatus r(item->arResources[i]);
CLISTMENUITEM clmi = { sizeof(clmi) };
clmi.flags = CMIM_NAME|CMIM_FLAGS | CMIF_CHILDPOPUP|CMIF_TCHAR;
- if ((item->resourceMode == RSMODE_MANUAL) && (item->pManualResource == r))
+ if ((item->resourceMode == RSMODE_MANUAL) && (item->m_pManualResource == r))
clmi.flags |= CMIF_CHECKED;
if (ServiceExists(MS_FP_GETCLIENTICONT)) {
clmi.flags |= CMIM_ICON;
FormatMirVer(r, szTmp, SIZEOF(szTmp));
clmi.hIcon = Finger_GetClientIcon(szTmp, 0);
}
- mir_sntprintf(szTmp, SIZEOF(szTmp), _T("%s [%s, %d]"), r->resourceName, pcli->pfnGetStatusModeDescription(r->status, 0), r->priority);
+ mir_sntprintf(szTmp, SIZEOF(szTmp), _T("%s [%s, %d]"), r->m_tszResourceName, pcli->pfnGetStatusModeDescription(r->m_iStatus, 0), r->m_iPriority);
clmi.ptszName = szTmp;
Menu_ModifyItem(m_phMenuResourceItems[i], &clmi);
DestroyIcon(clmi.hIcon);
@@ -587,7 +587,7 @@ INT_PTR __cdecl CJabberProto::OnMenuTransportLogin(WPARAM wParam, LPARAM)
JABBER_LIST_ITEM *item = ListGetItemPtr(LIST_ROSTER, jid.ptszVal);
if (item != NULL) {
XmlNode p(_T("presence")); xmlAddAttr(p, _T("to"), item->jid);
- if (item->m_pItemResource->status == ID_STATUS_ONLINE)
+ if (item->m_pItemResource->m_iStatus == ID_STATUS_ONLINE)
xmlAddAttr(p, _T("type"), _T("unavailable"));
m_ThreadInfo->send(p);
}
@@ -1058,8 +1058,8 @@ int CJabberProto::OnProcessSrmmEvent(WPARAM, LPARAM lParam)
TCHAR jid[JABBER_MAX_JID_LEN];
if ( GetClientJID(event->hContact, jid, SIZEOF(jid))) {
pResourceStatus r( ResourceInfoFromJID(jid));
- if (r && r->bMessageSessionActive) {
- r->bMessageSessionActive = FALSE;
+ if (r && r->m_bMessageSessionActive) {
+ r->m_bMessageSessionActive = FALSE;
if (GetResourceCapabilites(jid, TRUE) & JABBER_CAPS_CHATSTATES)
m_ThreadInfo->send(
@@ -1096,34 +1096,34 @@ int CJabberProto::OnProcessSrmmIconClick(WPARAM wParam, LPARAM lParam)
TCHAR buf[256];
mir_sntprintf(buf, SIZEOF(buf), TranslateT("Last active (%s)"),
- LI->pLastSeenResource ? LI->pLastSeenResource->resourceName : TranslateT("No activity yet, use server's choice"));
+ LI->m_pLastSeenResource ? LI->m_pLastSeenResource->m_tszResourceName : TranslateT("No activity yet, use server's choice"));
AppendMenu(hMenu, MF_STRING, MENUITEM_LASTSEEN, buf);
AppendMenu(hMenu, MF_STRING, MENUITEM_SERVER, TranslateT("Highest priority (server's choice)"));
AppendMenu(hMenu, MF_SEPARATOR, 0, NULL);
for (int i = 0; i < LI->arResources.getCount(); i++)
- AppendMenu(hMenu, MF_STRING, MENUITEM_RESOURCES+i, LI->arResources[i]->resourceName);
+ AppendMenu(hMenu, MF_STRING, MENUITEM_RESOURCES+i, LI->arResources[i]->m_tszResourceName);
if (LI->resourceMode == RSMODE_LASTSEEN)
CheckMenuItem(hMenu, MENUITEM_LASTSEEN, MF_BYCOMMAND|MF_CHECKED);
else if (LI->resourceMode == RSMODE_SERVER)
CheckMenuItem(hMenu, MENUITEM_SERVER, MF_BYCOMMAND|MF_CHECKED);
- else if (LI->pManualResource)
- CheckMenuItem(hMenu, MENUITEM_RESOURCES + LI->arResources.indexOf(LI->pManualResource), MF_BYCOMMAND|MF_CHECKED);
+ else if (LI->m_pManualResource)
+ CheckMenuItem(hMenu, MENUITEM_RESOURCES + LI->arResources.indexOf(LI->m_pManualResource), MF_BYCOMMAND|MF_CHECKED);
int res = TrackPopupMenu(hMenu, TPM_RETURNCMD, sicd->clickLocation.x, sicd->clickLocation.y, 0, WindowList_Find(hDialogsList, hContact), NULL);
if (res == MENUITEM_LASTSEEN) {
- LI->pManualResource = NULL;
+ LI->m_pManualResource = NULL;
LI->resourceMode = RSMODE_LASTSEEN;
}
else if (res == MENUITEM_SERVER) {
- LI->pManualResource = NULL;
+ LI->m_pManualResource = NULL;
LI->resourceMode = RSMODE_SERVER;
}
else if (res >= MENUITEM_RESOURCES) {
- LI->pManualResource = LI->arResources[res - MENUITEM_RESOURCES];
+ LI->m_pManualResource = LI->arResources[res - MENUITEM_RESOURCES];
LI->resourceMode = RSMODE_MANUAL;
}
@@ -1151,15 +1151,15 @@ INT_PTR __cdecl CJabberProto::OnMenuHandleResource(WPARAM wParam, LPARAM, LPARAM
return 0;
if (res == MENUITEM_LASTSEEN) {
- LI->pManualResource = NULL;
+ LI->m_pManualResource = NULL;
LI->resourceMode = RSMODE_LASTSEEN;
}
else if (res == MENUITEM_SERVER) {
- LI->pManualResource = NULL;
+ LI->m_pManualResource = NULL;
LI->resourceMode = RSMODE_SERVER;
}
else if (res >= MENUITEM_RESOURCES) {
- LI->pManualResource = LI->arResources[res - MENUITEM_RESOURCES];
+ LI->m_pManualResource = LI->arResources[res - MENUITEM_RESOURCES];
LI->resourceMode = RSMODE_MANUAL;
}
diff --git a/protocols/JabberG/src/jabber_misc.cpp b/protocols/JabberG/src/jabber_misc.cpp
index f3e9bc35af..781d0ebe7f 100644
--- a/protocols/JabberG/src/jabber_misc.cpp
+++ b/protocols/JabberG/src/jabber_misc.cpp
@@ -386,9 +386,9 @@ void CJabberProto::UpdateMirVer(JABBER_LIST_ITEM *item)
pResourceStatus p(NULL);
if (item->resourceMode == RSMODE_LASTSEEN)
- p = item->pLastSeenResource;
+ p = item->m_pLastSeenResource;
else if (item->resourceMode == RSMODE_MANUAL)
- p = item->pManualResource;
+ p = item->m_pManualResource;
if (p)
UpdateMirVer(hContact, p);
@@ -401,75 +401,75 @@ void CJabberProto::FormatMirVer(pResourceStatus &resource, TCHAR *buf, int bufSi
if ( !resource) return;
// jabber:iq:version info requested and exists?
- if (resource->dwVersionRequestTime && resource->software) {
- Log("JabberUpdateMirVer: for iq:version rc %S: %S", resource->resourceName, resource->software);
- if ( !resource->version || _tcsstr(resource->software, resource->version))
- lstrcpyn(buf, resource->software, bufSize);
+ 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))
+ lstrcpyn(buf, resource->m_tszSoftware, bufSize);
else
- mir_sntprintf(buf, bufSize, _T("%s %s"), resource->software, resource->version);
+ mir_sntprintf(buf, bufSize, _T("%s %s"), resource->m_tszSoftware, resource->m_tszVersion);
}
// no version info and no caps info? set MirVer = resource name
- else if ( !resource->szCapsNode || !resource->szCapsVer) {
- Log("JabberUpdateMirVer: for rc %S: %S", resource->resourceName, resource->resourceName);
- if (resource->resourceName)
- lstrcpyn(buf, resource->resourceName, bufSize);
+ else if ( !resource->m_tszCapsNode || !resource->m_tszCapsVer) {
+ Log("JabberUpdateMirVer: for rc %S: %S", resource->m_tszResourceName, resource->m_tszResourceName);
+ if (resource->m_tszResourceName)
+ lstrcpyn(buf, resource->m_tszResourceName, bufSize);
}
// XEP-0115 caps mode
else {
- Log("JabberUpdateMirVer: for rc %S: %S#%S", resource->resourceName, resource->szCapsNode, resource->szCapsVer);
+ Log("JabberUpdateMirVer: for rc %S: %S#%S", resource->m_tszResourceName, resource->m_tszCapsNode, resource->m_tszCapsVer);
int i;
// search through known software list
for (i = 0; i < SIZEOF(sttCapsNodeToName_Map); i++)
- if (_tcsstr(resource->szCapsNode, sttCapsNodeToName_Map[i].node))
+ if (_tcsstr(resource->m_tszCapsNode, sttCapsNodeToName_Map[i].node))
{
- mir_sntprintf(buf, bufSize, _T("%s %s"), sttCapsNodeToName_Map[i].name, resource->szCapsVer);
+ mir_sntprintf(buf, bufSize, _T("%s %s"), sttCapsNodeToName_Map[i].name, resource->m_tszCapsVer);
break;
}
// unknown software
if (i == SIZEOF(sttCapsNodeToName_Map))
- mir_sntprintf(buf, bufSize, _T("%s %s"), resource->szCapsNode, resource->szCapsVer);
+ mir_sntprintf(buf, bufSize, _T("%s %s"), resource->m_tszCapsNode, resource->m_tszCapsVer);
}
// attach additional info for fingerprint plguin
- if (resource->szCapsExt && _tcsstr(resource->szCapsExt, _T(JABBER_EXT_PLATFORMX86)) && !_tcsstr(buf, _T("x86")))
+ if (resource->m_tszCapsExt && _tcsstr(resource->m_tszCapsExt, _T(JABBER_EXT_PLATFORMX86)) && !_tcsstr(buf, _T("x86")))
{
int offset = lstrlen(buf);
mir_sntprintf(buf + offset, bufSize - offset, _T(" x86"));
}
- if (resource->szCapsExt && _tcsstr(resource->szCapsExt, _T(JABBER_EXT_PLATFORMX64)) && !_tcsstr(buf, _T("x64")))
+ if (resource->m_tszCapsExt && _tcsstr(resource->m_tszCapsExt, _T(JABBER_EXT_PLATFORMX64)) && !_tcsstr(buf, _T("x64")))
{
int offset = lstrlen(buf);
mir_sntprintf(buf + offset, bufSize - offset, _T(" x64"));
}
- if (resource->szCapsExt && _tcsstr(resource->szCapsExt, _T(JABBER_EXT_SECUREIM)) && !_tcsstr(buf, _T("(SecureIM)")))
+ if (resource->m_tszCapsExt && _tcsstr(resource->m_tszCapsExt, _T(JABBER_EXT_SECUREIM)) && !_tcsstr(buf, _T("(SecureIM)")))
{
int offset = lstrlen(buf);
mir_sntprintf(buf + offset, bufSize - offset, _T(" (SecureIM)"));
}
- if (resource->szCapsExt && _tcsstr(resource->szCapsExt, _T(JABBER_EXT_MIROTR)) && !_tcsstr(buf, _T("(MirOTR)")))
+ if (resource->m_tszCapsExt && _tcsstr(resource->m_tszCapsExt, _T(JABBER_EXT_MIROTR)) && !_tcsstr(buf, _T("(MirOTR)")))
{
int offset = lstrlen(buf);
mir_sntprintf(buf + offset, bufSize - offset, _T(" (MirOTR)"));
}
- if (resource->szCapsExt && _tcsstr(resource->szCapsExt, _T(JABBER_EXT_NEWGPG)) && !_tcsstr(buf, _T("(New_GPG)")))
+ if (resource->m_tszCapsExt && _tcsstr(resource->m_tszCapsExt, _T(JABBER_EXT_NEWGPG)) && !_tcsstr(buf, _T("(New_GPG)")))
{
int offset = lstrlen(buf);
mir_sntprintf(buf + offset, bufSize - offset, _T(" (New_GPG)"));
}
- if (resource->resourceName && !_tcsstr(buf, resource->resourceName))
+ if (resource->m_tszResourceName && !_tcsstr(buf, resource->m_tszResourceName))
{
if (_tcsstr(buf, _T("Miranda IM")) || _tcsstr(buf, _T("Miranda NG")) || m_options.ShowForeignResourceInMirVer)
{
int offset = lstrlen(buf);
- mir_sntprintf(buf + offset, bufSize - offset, _T(" [%s]"), resource->resourceName);
+ mir_sntprintf(buf + offset, bufSize - offset, _T(" [%s]"), resource->m_tszResourceName);
}
}
}
@@ -487,8 +487,8 @@ void CJabberProto::UpdateMirVer(HANDLE hContact, pResourceStatus &resource)
DBVARIANT 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);
+ if (resource->m_tszResourceName)
+ mir_sntprintf(szFullJid, SIZEOF(szFullJid), _T("%s/%s"), dbv.ptszVal, resource->m_tszResourceName);
else
lstrcpyn(szFullJid, dbv.ptszVal, SIZEOF(szFullJid));
setTString(hContact, DBSETTING_DISPLAY_UID, szFullJid);
diff --git a/protocols/JabberG/src/jabber_opt.cpp b/protocols/JabberG/src/jabber_opt.cpp
index 4c3e9a426b..53dfa67f6c 100644
--- a/protocols/JabberG/src/jabber_opt.cpp
+++ b/protocols/JabberG/src/jabber_opt.cpp
@@ -872,8 +872,8 @@ public:
HANDLE hContact = m_proto->HContactFromJID(item->jid);
if (hContact != NULL) {
if (bChecked) {
- if (item->m_pItemResource->status != m_proto->getWord(hContact, "Status", ID_STATUS_OFFLINE)) {
- m_proto->setWord(hContact, "Status", (WORD)item->m_pItemResource->status);
+ if (item->m_pItemResource->m_iStatus != m_proto->getWord(hContact, "Status", ID_STATUS_OFFLINE)) {
+ m_proto->setWord(hContact, "Status", (WORD)item->m_pItemResource->m_iStatus);
} }
else if (m_proto->getWord(hContact, "Status", ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE)
m_proto->setWord(hContact, "Status", ID_STATUS_OFFLINE);
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp
index 5ce0f096ad..521d68781e 100644
--- a/protocols/JabberG/src/jabber_proto.cpp
+++ b/protocols/JabberG/src/jabber_proto.cpp
@@ -731,7 +731,7 @@ int __cdecl CJabberProto::GetInfo(HANDLE hContact, int /*infoType*/)
pResourceStatus him( tmpItem->findResource(pDelimiter));
if (him) {
item = ListAdd(LIST_VCARD_TEMP, jid);
- ListAddResource(LIST_VCARD_TEMP, jid, him->status, him->statusMessage, him->priority);
+ ListAddResource(LIST_VCARD_TEMP, jid, him->m_iStatus, him->m_tszStatusMessage, him->m_iPriority);
}
}
else item = ListAdd(LIST_VCARD_TEMP, jid);
@@ -742,26 +742,26 @@ int __cdecl CJabberProto::GetInfo(HANDLE hContact, int /*infoType*/)
JABBER_RESOURCE_STATUS *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->resourceName);
+ mir_sntprintf(tmp, SIZEOF(tmp), _T("%s/%s"), szp1, r->m_tszResourceName);
XmlNodeIq iq3(m_iqManager.AddHandler(&CJabberProto::OnIqResultLastActivity, JABBER_IQ_TYPE_GET, tmp, JABBER_IQ_PARSE_FROM));
iq3 << XQUERY(JABBER_FEAT_LAST_ACTIVITY);
m_ThreadInfo->send(iq3);
- if ( !r->dwVersionRequestTime) {
+ 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->pSoftwareInfo) {
+ 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->dwVersionRequestTime) {
+ else if ( !item->m_pItemResource->m_dwVersionRequestTime) {
XmlNodeIq iq4(m_iqManager.AddHandler(&CJabberProto::OnIqResultVersion, JABBER_IQ_TYPE_GET, item->jid, JABBER_IQ_PARSE_FROM | JABBER_IQ_PARSE_HCONTACT | JABBER_IQ_PARSE_CHILD_TAG_NODE));
iq4 << XQUERY(JABBER_FEAT_VERSION);
m_ThreadInfo->send(iq4);
@@ -1152,7 +1152,7 @@ int __cdecl CJabberProto::SendMsg(HANDLE hContact, int flags, const char* pszSrc
pResourceStatus r( ResourceInfoFromJID(szClientJid));
if (r)
- r->bMessageSessionActive = TRUE;
+ r->m_bMessageSessionActive = TRUE;
JabberCapsBits jcb = GetResourceCapabilites(szClientJid, TRUE);
@@ -1312,9 +1312,9 @@ void __cdecl CJabberProto::GetAwayMsgThread(void* hContact)
size_t len = msgCount = 0;
for (i=0; i < item->arResources.getCount(); i++) {
JABBER_RESOURCE_STATUS *r = item->arResources[i];
- if (r->statusMessage) {
+ if (r->m_tszStatusMessage) {
msgCount++;
- len += (_tcslen(r->resourceName) + _tcslen(r->statusMessage) + 8);
+ len += (_tcslen(r->m_tszResourceName) + _tcslen(r->m_tszStatusMessage) + 8);
}
}
@@ -1322,14 +1322,14 @@ void __cdecl CJabberProto::GetAwayMsgThread(void* hContact)
str[0] = str[len] = '\0';
for (i=0; i < item->arResources.getCount(); i++) {
JABBER_RESOURCE_STATUS *r = item->arResources[i];
- if (r->statusMessage) {
+ if (r->m_tszStatusMessage) {
if (str[0] != '\0') _tcscat(str, _T("\r\n"));
if (msgCount > 1) {
_tcscat(str, _T("("));
- _tcscat(str, r->resourceName);
+ _tcscat(str, r->m_tszResourceName);
_tcscat(str, _T("): "));
}
- _tcscat(str, r->statusMessage);
+ _tcscat(str, r->m_tszStatusMessage);
}
}
@@ -1337,8 +1337,8 @@ void __cdecl CJabberProto::GetAwayMsgThread(void* hContact)
return;
}
- if (item->m_pItemResource->statusMessage != NULL) {
- ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)item->m_pItemResource->statusMessage);
+ if (item->m_pItemResource->m_tszStatusMessage != NULL) {
+ ProtoBroadcastAck(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, (HANDLE)1, (LPARAM)item->m_pItemResource->m_tszStatusMessage);
return;
}
}
diff --git a/protocols/JabberG/src/jabber_proto.h b/protocols/JabberG/src/jabber_proto.h
index 300f00f8ee..02253c9217 100644
--- a/protocols/JabberG/src/jabber_proto.h
+++ b/protocols/JabberG/src/jabber_proto.h
@@ -85,13 +85,13 @@ struct TFilterInfo
struct CJabberSysInterface: public IJabberSysInterface
{
- int STDMETHODCALLTYPE GetVersion() const; // Returns version of IJabberSysInterface.
- int STDMETHODCALLTYPE CompareJIDs(LPCTSTR jid1, LPCTSTR jid2); // Strips resource names from given JIDs and returns result of comparison for these JIDs.
- HANDLE STDMETHODCALLTYPE ContactFromJID(LPCTSTR jid); // Returns contact handle for given JID.
- LPTSTR STDMETHODCALLTYPE ContactToJID(HANDLE hContact); // Returns JID of hContact. You must free the result using mir_free().
- LPTSTR STDMETHODCALLTYPE GetBestResourceName(LPCTSTR jid); // Returns best resource name for given JID. You must free the result using mir_free().
- LPTSTR STDMETHODCALLTYPE GetResourceList(LPCTSTR jid); // Returns all resource names for a given JID in format "resource1\0resource2\0resource3\0\0" (all resources are separated by \0 character and the whole string is terminated with two \0 characters). You must free the string using mir_free().
- char* STDMETHODCALLTYPE GetModuleName() const; // Returns Jabber module name.
+ int STDMETHODCALLTYPE GetVersion() const; // Returns version of IJabberSysInterface.
+ int STDMETHODCALLTYPE CompareJIDs(LPCTSTR jid1, LPCTSTR jid2); // Strips resource names from given JIDs and returns result of comparison for these JIDs.
+ HANDLE STDMETHODCALLTYPE ContactFromJID(LPCTSTR jid); // Returns contact handle for given JID.
+ LPTSTR STDMETHODCALLTYPE ContactToJID(HANDLE hContact); // Returns JID of hContact. You must free the result using mir_free().
+ LPTSTR STDMETHODCALLTYPE GetBestResourceName(LPCTSTR jid); // Returns best resource name for given JID. You must free the result using mir_free().
+ LPTSTR STDMETHODCALLTYPE GetResourceList(LPCTSTR jid); // Returns all resource names for a given JID in format "resource1\0resource2\0resource3\0\0" (all resources are separated by \0 character and the whole string is terminated with two \0 characters). You must free the string using mir_free().
+ char* STDMETHODCALLTYPE GetModuleName() const; // Returns Jabber module name.
CJabberProto *m_psProto;
};
@@ -483,12 +483,12 @@ struct CJabberProto : public PROTO<CJabberProto>
void OnIqResultServiceDiscoveryRootInfo(HXML iqNode, CJabberIqInfo* pInfo);
void OnIqResultServiceDiscoveryRoot(HXML iqNode, CJabberIqInfo* pInfo);
void OnIqResultServiceDiscoveryRootItems(HXML iqNode, CJabberIqInfo* pInfo);
- BOOL SendInfoRequest(CJabberSDNode* pNode, HXML parent);
- BOOL SendBothRequests(CJabberSDNode* pNode, HXML parent);
+ BOOL SendInfoRequest(CJabberSDNode *pNode, HXML parent);
+ BOOL SendBothRequests(CJabberSDNode *pNode, HXML parent);
void PerformBrowse(HWND hwndDlg);
BOOL IsNodeRegistered(CJabberSDNode *pNode);
void ApplyNodeIcon(HTREELISTITEM hItem, CJabberSDNode *pNode);
- BOOL SyncTree(HTREELISTITEM hIndex, CJabberSDNode* pNode);
+ BOOL SyncTree(HTREELISTITEM hIndex, CJabberSDNode *pNode);
void ServiceDiscoveryShowMenu(CJabberSDNode *node, HTREELISTITEM hItem, POINT pt);
int SetupServiceDiscoveryDlg(TCHAR* jid);
diff --git a/protocols/JabberG/src/jabber_svc.cpp b/protocols/JabberG/src/jabber_svc.cpp
index de10ebd483..eba2f9976c 100644
--- a/protocols/JabberG/src/jabber_svc.cpp
+++ b/protocols/JabberG/src/jabber_svc.cpp
@@ -413,28 +413,28 @@ INT_PTR __cdecl CJabberProto::JabberGCGetToolTipText(WPARAM wParam, LPARAM lPara
bool bIsTipper = db_get_b(NULL, "Tab_SRMsg", "adv_TipperTooltip", 0) && ServiceExists("mToolTip/HideTip");
//JID:
- if (_tcschr(info->resourceName, _T('@')) != NULL)
- appendString(bIsTipper, _T("JID:"), info->resourceName, outBuf, SIZEOF(outBuf));
+ if (_tcschr(info->m_tszResourceName, _T('@')) != NULL)
+ appendString(bIsTipper, _T("JID:"), info->m_tszResourceName, outBuf, SIZEOF(outBuf));
else if (lParam) //or simple nick
appendString(bIsTipper, _T("Nick:"), (TCHAR*) lParam, outBuf, SIZEOF(outBuf));
// status
- if (info->status >= ID_STATUS_OFFLINE && info->status <= ID_STATUS_IDLE )
- appendString(bIsTipper, _T("Status:"), pcli->pfnGetStatusModeDescription(info->status, 0), outBuf, SIZEOF(outBuf));
+ if (info->m_iStatus >= ID_STATUS_OFFLINE && info->m_iStatus <= ID_STATUS_IDLE )
+ appendString(bIsTipper, _T("Status:"), pcli->pfnGetStatusModeDescription(info->m_iStatus, 0), outBuf, SIZEOF(outBuf));
// status text
- if (info->statusMessage)
- appendString(bIsTipper, _T("Status text:"), info->statusMessage, outBuf, SIZEOF(outBuf));
+ if (info->m_tszStatusMessage)
+ appendString(bIsTipper, _T("Status text:"), info->m_tszStatusMessage, outBuf, SIZEOF(outBuf));
// Role
- appendString(bIsTipper, _T("Role:"), TranslateTS(JabberEnum2RoleStr[info->role]), outBuf, SIZEOF(outBuf));
+ appendString(bIsTipper, _T("Role:"), TranslateTS(JabberEnum2RoleStr[info->m_role]), outBuf, SIZEOF(outBuf));
// Affiliation
- appendString(bIsTipper, _T("Affiliation:"), TranslateTS(JabberEnum2AffilationStr[info->affiliation]), outBuf, SIZEOF(outBuf));
+ appendString(bIsTipper, _T("Affiliation:"), TranslateTS(JabberEnum2AffilationStr[info->m_affiliation]), outBuf, SIZEOF(outBuf));
// real jid
- if (info->szRealJid)
- appendString(bIsTipper, _T("Real JID:"), info->szRealJid, outBuf, SIZEOF(outBuf));
+ if (info->m_tszRealJid)
+ appendString(bIsTipper, _T("Real JID:"), info->m_tszRealJid, outBuf, SIZEOF(outBuf));
return (INT_PTR)(outBuf[0] == 0 ? NULL : mir_tstrdup(outBuf));
}
@@ -810,7 +810,7 @@ LPTSTR CJabberSysInterface::GetResourceList(LPCTSTR jid)
CMString res;
for (int i=0; i < item->arResources.getCount(); i++) {
- res.Append(item->arResources[i]->resourceName);
+ res.Append(item->arResources[i]->m_tszResourceName);
res.AppendChar(0);
}
res.AppendChar(0);
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp
index f392327dfd..7c880d01c9 100644
--- a/protocols/JabberG/src/jabber_thread.cpp
+++ b/protocols/JabberG/src/jabber_thread.cpp
@@ -1100,7 +1100,7 @@ HANDLE CJabberProto::CreateTemporaryContact(const TCHAR *szJid, JABBER_LIST_ITEM
pResourceStatus r( chatItem->findResource(p));
if (r)
- setWord(hContact, "Status", r->status);
+ setWord(hContact, "Status", r->m_iStatus);
}
else {
TCHAR *nick = JabberNickFromJID(szJid);
@@ -1131,7 +1131,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData* info)
<< XCHILDNS(_T("received"), JABBER_FEAT_MESSAGE_RECEIPTS) << XATTR(_T("id"), idStr));
if (pFromResource)
- pFromResource->jcbManualDiscoveredCaps |= JABBER_CAPS_MESSAGE_RECEIPTS;
+ pFromResource->m_jcbManualDiscoveredCaps |= JABBER_CAPS_MESSAGE_RECEIPTS;
}
if (m_messageManager.HandleMessagePermanent(node, info))
@@ -1199,7 +1199,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData* info)
// check chatstates availability
if (pFromResource && xmlGetChildByTag(node, "active", "xmlns", JABBER_FEAT_CHATSTATES))
- pFromResource->jcbManualDiscoveredCaps |= JABBER_CAPS_CHATSTATES;
+ pFromResource->m_jcbManualDiscoveredCaps |= JABBER_CAPS_CHATSTATES;
// chatstates composing event
if (hContact && xmlGetChildByTag(node, "composing", "xmlns", JABBER_FEAT_CHATSTATES))
@@ -1213,7 +1213,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData* info)
if (hContact && xmlGetChildByTag(node, "inactive", "xmlns", JABBER_FEAT_CHATSTATES)) {
CallService(MS_PROTO_CONTACTISTYPING, (WPARAM)hContact, PROTOTYPE_CONTACTTYPING_OFF);
if (pFromResource)
- pFromResource->bMessageSessionActive = false;
+ pFromResource->m_bMessageSessionActive = false;
}
// message receipts delivery notification
@@ -1318,7 +1318,7 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData* info)
jcbCaps = JABBER_RESOURCE_CAPS_NONE;
// FIXME: disabled due to expired XEP-0022 and problems with bombus delivery checks
// if (jcbCaps && pFromResource && (!(jcbCaps & JABBER_CAPS_MESSAGE_EVENTS)))
-// pFromResource->jcbManualDiscoveredCaps |= (JABBER_CAPS_MESSAGE_EVENTS | JABBER_CAPS_MESSAGE_EVENTS_NO_DELIVERY);
+// pFromResource->m_jcbManualDiscoveredCaps |= (JABBER_CAPS_MESSAGE_EVENTS | JABBER_CAPS_MESSAGE_EVENTS_NO_DELIVERY);
if (bodyNode == NULL) {
HXML idNode = xmlGetChild(xNode , "id");
@@ -1449,10 +1449,10 @@ void CJabberProto::OnProcessMessage(HXML node, ThreadData* info)
if (item != NULL) {
if (pFromResource) {
- pFromResource->bMessageSessionActive = TRUE;
+ pFromResource->m_bMessageSessionActive = TRUE;
- JABBER_RESOURCE_STATUS *pLast = item->pLastSeenResource;
- item->pLastSeenResource = pFromResource;
+ JABBER_RESOURCE_STATUS *pLast = item->m_pLastSeenResource;
+ item->m_pLastSeenResource = pFromResource;
if (item->resourceMode == RSMODE_LASTSEEN && pLast == pFromResource)
UpdateMirVer(item);
}
@@ -1508,9 +1508,9 @@ void CJabberProto::OnProcessPresenceCapabilites(HXML node)
const TCHAR *szVer = xmlGetAttrValue(n, _T("ver"));
const TCHAR *szExt = xmlGetAttrValue(n, _T("ext"));
if (szNode && szVer) {
- replaceStrT(r->szCapsNode, szNode);
- replaceStrT(r->szCapsVer, szVer);
- replaceStrT(r->szCapsExt, szExt);
+ r->m_tszCapsNode = mir_tstrdup(szNode);
+ r->m_tszCapsVer = mir_tstrdup(szVer);
+ r->m_tszCapsExt = mir_tstrdup(szExt);
HANDLE hContact = HContactFromJID(from);
if (hContact)
UpdateMirVer(hContact, r);
@@ -1534,9 +1534,9 @@ void CJabberProto::UpdateJidDbSettings(const TCHAR *jid)
if ( !item->arResources.getCount()) {
// set offline only if jid has resources
if (_tcschr(jid, '/') == NULL)
- status = item->m_pItemResource->status;
- if (item->m_pItemResource->statusMessage)
- db_set_ts(hContact, "CList", "StatusMsg", item->m_pItemResource->statusMessage);
+ status = item->m_pItemResource->m_iStatus;
+ if (item->m_pItemResource->m_tszStatusMessage)
+ db_set_ts(hContact, "CList", "StatusMsg", item->m_pItemResource->m_tszStatusMessage);
else
db_unset(hContact, "CList", "StatusMsg");
}
@@ -1546,22 +1546,22 @@ void CJabberProto::UpdateJidDbSettings(const TCHAR *jid)
int nMaxPriority = -999; // -128...+127 valid range
for (i = 0; i < item->arResources.getCount(); i++) {
pResourceStatus r(item->arResources[i]);
- if (r->priority > nMaxPriority) {
- nMaxPriority = r->priority;
- status = r->status;
+ if (r->m_iPriority > nMaxPriority) {
+ nMaxPriority = r->m_iPriority;
+ status = r->m_iStatus;
nSelectedResource = i;
}
- else if (r->priority == nMaxPriority) {
- if ((status = JabberCombineStatus(status, r->status)) == r->status)
+ else if (r->m_iPriority == nMaxPriority) {
+ if ((status = JabberCombineStatus(status, r->m_iStatus)) == r->m_iStatus)
nSelectedResource = i;
}
}
- item->m_pItemResource->status = status;
+ item->m_pItemResource->m_iStatus = status;
if (nSelectedResource != -1) {
pResourceStatus r(item->arResources[nSelectedResource]);
- Log("JabberUpdateJidDbSettings: updating jid %S to rc %S", item->jid, r->resourceName);
- if (r->statusMessage)
- db_set_ts(hContact, "CList", "StatusMsg", r->statusMessage);
+ Log("JabberUpdateJidDbSettings: updating jid %S to rc %S", item->jid, r->m_tszResourceName);
+ if (r->m_tszStatusMessage)
+ db_set_ts(hContact, "CList", "StatusMsg", r->m_tszStatusMessage);
else
db_unset(hContact, "CList", "StatusMsg");
UpdateMirVer(hContact, r);
@@ -1725,8 +1725,8 @@ void CJabberProto::OnProcessPresence(HXML node, ThreadData* info)
// set status only if no more available resources
if ( !item->arResources.getCount()) {
- item->m_pItemResource->status = ID_STATUS_OFFLINE;
- replaceStrT(item->m_pItemResource->statusMessage, xmlGetText( xmlGetChild(node , "status")));
+ item->m_pItemResource->m_iStatus = ID_STATUS_OFFLINE;
+ item->m_pItemResource->m_tszStatusMessage = mir_tstrdup(xmlGetText( xmlGetChild(node , "status")));
}
}
else Log("SKIP Receive presence offline from %S (who is not in my roster)", from);
@@ -1810,22 +1810,22 @@ void CJabberProto::OnIqResultVersion(HXML /*node*/, CJabberIqInfo *pInfo)
if (r == NULL)
return;
- r->dwVersionRequestTime = -1;
+ r->m_dwVersionRequestTime = -1;
- replaceStrT(r->software, NULL);
- replaceStrT(r->version, NULL);
- replaceStrT(r->system, NULL);
+ r->m_tszSoftware = NULL;
+ r->m_tszVersion = NULL;
+ r->m_tszSystem = NULL;
HXML queryNode = pInfo->GetChildNode();
if (pInfo->GetIqType() == JABBER_IQ_TYPE_RESULT && queryNode) {
HXML n;
if ((n = xmlGetChild(queryNode , "name")) != NULL && xmlGetText(n))
- r->software = mir_tstrdup(xmlGetText(n));
+ r->m_tszSoftware = mir_tstrdup(xmlGetText(n));
if ((n = xmlGetChild(queryNode , "version")) != NULL && xmlGetText(n))
- r->version = mir_tstrdup(xmlGetText(n));
+ r->m_tszVersion = mir_tstrdup(xmlGetText(n));
if ((n = xmlGetChild(queryNode , "os")) != NULL && xmlGetText(n))
- r->system = mir_tstrdup(xmlGetText(n));
+ r->m_tszSystem = 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 aabac64901..c79e6e31b9 100644
--- a/protocols/JabberG/src/jabber_userinfo.cpp
+++ b/protocols/JabberG/src/jabber_userinfo.cpp
@@ -214,26 +214,26 @@ static void sttFillResourceInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM hti
HTREEITEM htiResource = htiRoot;
JABBER_RESOURCE_STATUS *res = resource ? item->arResources[resource-1] : item->m_pItemResource;
- if (res->resourceName && *res->resourceName)
- htiResource = sttFillInfoLine(hwndTree, htiRoot, LoadSkinnedProtoIcon(ppro->m_szModuleName, res->status),
- TranslateT("Resource"), res->resourceName, sttInfoLineId(resource, INFOLINE_NAME), true);
+ 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);
// StatusMsg
sttFillInfoLine(hwndTree, htiResource, NULL /*LoadSkinnedIcon(SKINICON_EVENT_MESSAGE)*/,
- TranslateT("Message"), res->statusMessage ? res->statusMessage : TranslateT("<not specified>"),
+ TranslateT("Message"), res->m_tszStatusMessage ? res->m_tszStatusMessage : TranslateT("<not specified>"),
sttInfoLineId(resource, INFOLINE_MESSAGE));
// Software
HICON hIcon = NULL;
if (ServiceExists(MS_FP_GETCLIENTICONT)) {
- if (res->software != NULL) {
- mir_sntprintf(buf, SIZEOF(buf), _T("%s %s"), res->software, res->version);
+ if (res->m_tszSoftware != NULL) {
+ mir_sntprintf(buf, SIZEOF(buf), _T("%s %s"), res->m_tszSoftware, res->m_tszVersion);
hIcon = Finger_GetClientIcon(buf, 0);
}
}
sttFillInfoLine(hwndTree, htiResource, hIcon, TranslateT("Software"),
- res->software ? res->software : TranslateT("<not specified>"),
+ res->m_tszSoftware ? res->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->version ? res->version : TranslateT("<not specified>"),
+ res->m_tszVersion ? res->m_tszVersion : TranslateT("<not specified>"),
sttInfoLineId(resource, INFOLINE_VERSION));
// System
sttFillInfoLine(hwndTree, htiResource, NULL, TranslateT("System"),
- res->system ? res->system : TranslateT("<not specified>"),
+ res->m_tszSystem ? res->m_tszSystem : TranslateT("<not specified>"),
sttInfoLineId(resource, INFOLINE_SYSTEM));
// Resource priority
TCHAR szPriority[128];
- mir_sntprintf(szPriority, SIZEOF(szPriority), _T("%d"), (int)res->priority);
+ mir_sntprintf(szPriority, SIZEOF(szPriority), _T("%d"), (int)res->m_iPriority);
sttFillInfoLine(hwndTree, htiResource, NULL, TranslateT("Resource priority"), szPriority, sttInfoLineId(resource, INFOLINE_PRIORITY));
// Idle
- if (res->idleStartTime > 0) {
- lstrcpyn(buf, _tctime(&res->idleStartTime), SIZEOF(buf));
+ if (res->m_dwIdleStartTime > 0) {
+ lstrcpyn(buf, _tctime(&res->m_dwIdleStartTime), SIZEOF(buf));
int len = lstrlen(buf);
if (len > 0) buf[len-1] = 0;
}
- else if ( !res->idleStartTime)
+ else if ( !res->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->resourceName);
+ mir_sntprintf(buf, SIZEOF(buf), _T("%s/%s"), item->jid, res->m_tszResourceName);
JabberCapsBits jcb = ppro->GetResourceCapabilites(buf, TRUE);
if ( !(jcb & JABBER_RESOURCE_CAPS_ERROR)) {
@@ -296,10 +296,10 @@ static void sttFillResourceInfo(CJabberProto *ppro, HWND hwndTree, HTREEITEM hti
}
// Software info
- if (res->pSoftwareInfo) {
+ 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->pSoftwareInfo;
+ 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)
@@ -365,12 +365,12 @@ static void sttFillUserInfo(CJabberProto *ppro, HWND hwndTree, JABBER_LIST_ITEM
}
// logoff
- if (item->m_pItemResource->idleStartTime > 0) {
- lstrcpyn(buf, _tctime(&item->m_pItemResource->idleStartTime), SIZEOF(buf));
+ if (item->m_pItemResource->m_dwIdleStartTime > 0) {
+ lstrcpyn(buf, _tctime(&item->m_pItemResource->m_dwIdleStartTime), SIZEOF(buf));
int len = lstrlen(buf);
if (len > 0) buf[len-1] = 0;
}
- else if ( !item->m_pItemResource->idleStartTime)
+ else if ( !item->m_pItemResource->m_dwIdleStartTime)
lstrcpyn(buf, TranslateT("unknown"), SIZEOF(buf));
else
lstrcpyn(buf, TranslateT("<not specified>"), SIZEOF(buf));
@@ -381,11 +381,11 @@ static void sttFillUserInfo(CJabberProto *ppro, HWND hwndTree, JABBER_LIST_ITEM
// logoff msg
sttFillInfoLine(hwndTree, htiRoot, NULL, TranslateT("Logoff message"),
- item->m_pItemResource->statusMessage ? item->m_pItemResource->statusMessage : TranslateT("<not specified>"), sttInfoLineId(0, INFOLINE_LOGOFF_MSG));
+ item->m_pItemResource->m_tszStatusMessage ? item->m_pItemResource->m_tszStatusMessage : TranslateT("<not specified>"), sttInfoLineId(0, INFOLINE_LOGOFF_MSG));
// activity
- if (item->pLastSeenResource)
- lstrcpyn(buf, item->pLastSeenResource->resourceName, SIZEOF(buf));
+ if (item->m_pLastSeenResource)
+ lstrcpyn(buf, item->m_pLastSeenResource->m_tszResourceName, SIZEOF(buf));
else
lstrcpyn(buf, TranslateT("<no information available>"), SIZEOF(buf));
@@ -397,7 +397,7 @@ static void sttFillUserInfo(CJabberProto *ppro, HWND hwndTree, JABBER_LIST_ITEM
for (int i = 0; i < item->arResources.getCount(); i++)
sttFillResourceInfo(ppro, hwndTree, htiRoot, item, i+1);
}
- else if ( !_tcschr(item->jid, _T('@')) || (item->m_pItemResource->status != ID_STATUS_OFFLINE))
+ else if ( !_tcschr(item->jid, _T('@')) || (item->m_pItemResource->m_iStatus != ID_STATUS_OFFLINE))
sttFillResourceInfo(ppro, hwndTree, htiRoot, item, 0);
sttCleanupInfo(hwndTree, 1);
diff --git a/protocols/JabberG/src/jabber_util.cpp b/protocols/JabberG/src/jabber_util.cpp
index 2f4229dba2..ad8e170346 100644
--- a/protocols/JabberG/src/jabber_util.cpp
+++ b/protocols/JabberG/src/jabber_util.cpp
@@ -902,7 +902,7 @@ TCHAR* CJabberProto::GetClientJID(const TCHAR *jid, TCHAR *dest, size_t destLen)
mir_cslock lck(m_csLists);
JABBER_LIST_ITEM *LI = ListGetItemPtr(LIST_ROSTER, jid);
if (LI != NULL) {
- if (LI->arResources.getCount() == 1 && !lstrcmp(LI->arResources[0]->szCapsNode, _T("http://talk.google.com/xmpp/bot/caps"))) {
+ if (LI->arResources.getCount() == 1 && !lstrcmp(LI->arResources[0]->m_tszCapsNode, _T("http://talk.google.com/xmpp/bot/caps"))) {
if (p) *p = 0;
return dest;
}
@@ -910,7 +910,7 @@ TCHAR* CJabberProto::GetClientJID(const TCHAR *jid, TCHAR *dest, size_t destLen)
if (p == NULL) {
pResourceStatus r( LI->getBestResource());
if (r != NULL)
- mir_sntprintf(dest, destLen, _T("%s/%s"), jid, r->resourceName);
+ mir_sntprintf(dest, destLen, _T("%s/%s"), jid, r->m_tszResourceName);
}
}