diff options
author | George Hazan <ghazan@miranda.im> | 2019-02-26 13:55:31 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-02-26 13:55:31 +0300 |
commit | 59f72fa52bd560003af3c4635f92a885d1c07dbc (patch) | |
tree | a574aa7c8115bda94252bbd0587cf1158b49e1b3 /protocols/JabberG/src/jabber_proto.cpp | |
parent | 1bf0fece31876c453bea93479e6d0d40bd8a564d (diff) |
XmlFirstChild / XmlGetAttr - safe wrappers for tinyxml2
Diffstat (limited to 'protocols/JabberG/src/jabber_proto.cpp')
-rwxr-xr-x | protocols/JabberG/src/jabber_proto.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index 9533b031dc..469a6b8626 100755 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -1002,6 +1002,8 @@ int CJabberProto::SendMsg(MCONTACT hContact, int unused_unknown, const char *psz if (jcb & JABBER_CAPS_CHATSTATES)
m << XCHILDNS("active", JABBER_FEAT_CHATSTATES);
+ m << XATTR("to", szClientJid);
+
if (
// if message delivery check disabled by entity caps manager
(jcb & JABBER_CAPS_MESSAGE_EVENTS_NO_DELIVERY) ||
@@ -1010,19 +1012,18 @@ int CJabberProto::SendMsg(MCONTACT hContact, int unused_unknown, const char *psz // if message sent to groupchat
!mir_strcmp(msgType, "groupchat") ||
// if message delivery check disabled in settings
- !m_bMsgAck || !getByte(hContact, "MsgAck", true)) {
- if (!mir_strcmp(msgType, "groupchat"))
- XmlAddAttr(m, "to", szClientJid);
- else {
+ !m_bMsgAck || !getByte(hContact, "MsgAck", true))
+ {
+ if (mir_strcmp(msgType, "groupchat")) {
id = SerialNext();
- XmlAddAttr(m, "to", szClientJid); XmlAddAttrID(m, id);
+ XmlAddAttrID(m, id);
}
m_ThreadInfo->send(m);
ForkThread(&CJabberProto::SendMessageAckThread, new TFakeAckParams(hContact, nullptr, id));
}
else {
- XmlAddAttr(m, "to", szClientJid); XmlAddAttrID(m, id);
+ XmlAddAttrID(m, id);
// message receipts XEP priority
if (jcb & JABBER_CAPS_MESSAGE_RECEIPTS)
|