summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/m_xml.h2
-rwxr-xr-xprotocols/JabberG/src/jabber_thread.cpp9
-rw-r--r--src/mir_core/src/CCtrlBase.cpp4
3 files changed, 7 insertions, 8 deletions
diff --git a/include/m_xml.h b/include/m_xml.h
index 2403b20997..8047c3e205 100644
--- a/include/m_xml.h
+++ b/include/m_xml.h
@@ -178,7 +178,7 @@ public:
TiXmlFilter(const TiXmlNode *pNode, const char *pszNodeName) :
m_pszFilter(pszNodeName)
{
- m_pFirst = (pNode) ? pNode->FirstChildElement() : nullptr;
+ m_pFirst = (pNode) ? pNode->FirstChildElement(pszNodeName) : nullptr;
}
TiXmlFilterIterator begin()
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp
index 1b3d83c291..293da198d5 100755
--- a/protocols/JabberG/src/jabber_thread.cpp
+++ b/protocols/JabberG/src/jabber_thread.cpp
@@ -1084,15 +1084,14 @@ void CJabberProto::OnProcessMessage(const TiXmlElement *node, ThreadData *info)
if (!m_bEnableCarbons)
return;
- const TiXmlElement *forwarded = nullptr;
- const TiXmlElement *message = nullptr;
+ auto *xmlForwarded = XmlGetChildByTag(carbon, "forwarded", "xmlns", JABBER_XMLNS_FORWARD);
+ auto *xmlMessage = XmlFirstChild(xmlForwarded, "message");
// Carbons MUST have forwarded/message content
- if (!(forwarded = XmlGetChildByTag(carbon, "forwarded", "xmlns", JABBER_XMLNS_FORWARD))
- || !(message = XmlFirstChild(forwarded, "message")))
+ if (xmlMessage == nullptr)
return;
// Unwrap the carbon in any case
- node = message;
+ node = xmlMessage;
type = XmlGetAttr(node, "type");
if (!carbonSent) {
diff --git a/src/mir_core/src/CCtrlBase.cpp b/src/mir_core/src/CCtrlBase.cpp
index 609804e390..4761bd07d5 100644
--- a/src/mir_core/src/CCtrlBase.cpp
+++ b/src/mir_core/src/CCtrlBase.cpp
@@ -151,14 +151,14 @@ char* CCtrlBase::GetTextU()
wchar_t* CCtrlBase::GetText(wchar_t *buf, size_t size)
{
- GetWindowTextW(m_hwnd, buf, size);
+ GetWindowTextW(m_hwnd, buf, (int)size);
buf[size - 1] = 0;
return buf;
}
char* CCtrlBase::GetTextA(char *buf, size_t size)
{
- GetWindowTextA(m_hwnd, buf, size);
+ GetWindowTextA(m_hwnd, buf, (int)size);
buf[size - 1] = 0;
return buf;
}