From fc8f2a3b692878aa581bf3fcd5c1c3c2295bbcb5 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 19 Feb 2019 15:21:04 +0300 Subject: Jabber: - XmlGetChildText / XmlGetChildInt - new handy helpers for tinyxml2; - Unicode logging replaced with ANSI when appropriate; - JabberErrorMsg rewritten to be more useful --- protocols/JabberG/src/jabber_opt.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'protocols/JabberG/src/jabber_opt.cpp') diff --git a/protocols/JabberG/src/jabber_opt.cpp b/protocols/JabberG/src/jabber_opt.cpp index 05fddd6d2f..598f4c7867 100755 --- a/protocols/JabberG/src/jabber_opt.cpp +++ b/protocols/JabberG/src/jabber_opt.cpp @@ -1006,8 +1006,8 @@ void CJabberProto::_RosterHandleGetRequest(const TiXmlElement *node, CJabberIqIn const char *name = item->Attribute("name"); const char *subscription = item->Attribute("subscription"); - auto *group = item->FirstChildElement("group"); - _RosterInsertListItem(hList, jid, name, (group) ? group->GetText() : 0, subscription, TRUE); + const char *group = XmlGetChildText(item, "group"); + _RosterInsertListItem(hList, jid, name, group, subscription, TRUE); } // now it is require to process whole contact list to add not in roster contacts @@ -1080,8 +1080,8 @@ void CJabberProto::_RosterHandleGetRequest(const TiXmlElement *node, CJabberIqIn bPushed = TRUE; } if (!bPushed) { - auto *rosterGroup = itemRoster->FirstChildElement("group"); - if ((rosterGroup != nullptr || group[0] != 0) && mir_strcmpi(rosterGroup->GetText(), szGroup)) + auto *rosterGroup = XmlGetChildText(itemRoster, "group"); + if (rosterGroup != nullptr && mir_strcmpi(rosterGroup, szGroup)) bPushed = TRUE; } } -- cgit v1.2.3