diff options
Diffstat (limited to 'protocols/JabberG/src/jabber_thread.cpp')
-rwxr-xr-x | protocols/JabberG/src/jabber_thread.cpp | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp index dda7597d6a..87972f5cc0 100755 --- a/protocols/JabberG/src/jabber_thread.cpp +++ b/protocols/JabberG/src/jabber_thread.cpp @@ -90,7 +90,7 @@ static INT_PTR CALLBACK JabberPasswordDlgProc(HWND hwndDlg, UINT msg, WPARAM wPa param->pro->setByte("SavePassword", savePassword);
if (savePassword) {
param->pro->setWString("Password", param->onlinePassword);
- param->saveOnlinePassword = TRUE;
+ param->saveOnlinePassword = true;
}
}
__fallthrough;
@@ -692,7 +692,7 @@ void CJabberProto::OnProcessFeatures(const TiXmlElement *node, ThreadData *info) if (!mir_strcmp(pszName, "compression") && m_bEnableZlib == TRUE) {
debugLogA("Server compression available");
for (auto *c : TiXmlFilter(n, "method")) {
- if (!mir_strcmp(c->GetText(), "zlib") && info->zlibInit() == TRUE) {
+ if (!mir_strcmp(c->GetText(), "zlib") && info->zlibInit()) {
debugLogA("Requesting Zlib compression");
info->send(XmlNode("compress") << XATTR("xmlns", "http://jabber.org/protocol/compress")
<< XCHILD("method", "zlib"));
@@ -758,7 +758,7 @@ void CJabberProto::OnProcessFeatures(const TiXmlElement *node, ThreadData *info) << XCHILD("resource", info->resource));
if (m_AuthMechs.isSessionAvailable)
- info->bIsSessionAvailable = TRUE;
+ info->bIsSessionAvailable = true;
return;
}
@@ -940,7 +940,7 @@ void CJabberProto::OnProcessCompressed(const TiXmlElement *node, ThreadData *inf debugLogA("Starting Zlib stream compression...");
- info->useZlib = TRUE;
+ info->useZlib = true;
info->zRecvData = (char*)mir_alloc(ZLIB_CHUNK_SIZE);
xmlStreamInitialize("after successful Zlib init");
@@ -1367,7 +1367,7 @@ void CJabberProto::OnProcessMessage(const TiXmlElement *node, ThreadData *info) if (item != nullptr) {
if (pFromResource) {
- pFromResource->m_bMessageSessionActive = TRUE;
+ pFromResource->m_bMessageSessionActive = true;
JABBER_RESOURCE_STATUS *pLast = item->m_pLastSeenResource;
item->m_pLastSeenResource = pFromResource;
@@ -1739,13 +1739,15 @@ void CJabberProto::OnProcessPresence(const TiXmlElement *node, ThreadData *info) }
}
-BOOL CJabberProto::OnProcessJingle(const TiXmlElement *node)
+bool CJabberProto::OnProcessJingle(const TiXmlElement *node)
{
const char *type;
auto *child = XmlGetChildByTag(node, "jingle", "xmlns", JABBER_FEAT_JINGLE);
if (child) {
- if ((type = XmlGetAttr(node, "type")) == nullptr) return FALSE;
+ if ((type = XmlGetAttr(node, "type")) == nullptr)
+ return false;
+
if ((!mir_strcmp(type, "get") || !mir_strcmp(type, "set"))) {
const char *szAction = XmlGetAttr(child, "action");
const char *idStr = XmlGetAttr(node, "id");
@@ -1768,7 +1770,7 @@ BOOL CJabberProto::OnProcessJingle(const TiXmlElement *node) jingleNode << XCHILD("reason")
<< XCHILD("unsupported-applications");
m_ThreadInfo->send(iq);
- return TRUE;
+ return true;
}
else {
// if it's something else than 'session-initiate' and noone processed it yet, reply with "unknown-session"
@@ -1778,19 +1780,21 @@ BOOL CJabberProto::OnProcessJingle(const TiXmlElement *node) errNode << XCHILDNS("item-not-found", "urn:ietf:params:xml:ns:xmpp-stanzas");
errNode << XCHILDNS("unknown-session", "urn:xmpp:jingle:errors:1");
m_ThreadInfo->send(iq);
- return TRUE;
+ return true;
}
}
}
- return FALSE;
+ return false;
}
void CJabberProto::OnProcessIq(const TiXmlElement *node)
{
- if (!node->Name() || mir_strcmp(node->Name(), "iq")) return;
+ if (!node->Name() || mir_strcmp(node->Name(), "iq"))
+ return;
const char *type;
- if ((type = XmlGetAttr(node, "type")) == nullptr) return;
+ if ((type = XmlGetAttr(node, "type")) == nullptr)
+ return;
int id = JabberGetPacketID(node);
@@ -1905,12 +1909,12 @@ void CJabberProto::OnProcessRegIq(const TiXmlElement *node, ThreadData *info) else if (id == iqIdRegSetReg) {
info->send("</stream:stream>");
SendMessage(info->conn.reg_hwndDlg, WM_JABBER_REGDLG_UPDATE, 100, (LPARAM)TranslateT("Registration successful"));
- info->reg_done = TRUE;
+ info->reg_done = true;
}
}
else if (!mir_strcmp(type, "error")) {
SendMessage(info->conn.reg_hwndDlg, WM_JABBER_REGDLG_UPDATE, 100, (LPARAM)JabberErrorMsg(node).c_str());
- info->reg_done = TRUE;
+ info->reg_done = true;
info->send("</stream:stream>");
}
}
|