Set and handle single 'group' parameters (roster item group) in user.roster messages.

git-svn-id: http://yate.null.ro/svn/yate/trunk@3674 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
marian 2010-09-29 08:21:57 +00:00
parent 3a2bb71e0f
commit 893122fe8c
1 changed files with 13 additions and 2 deletions

View File

@ -838,6 +838,14 @@ bool YJBEngine::handleUserRoster(Message& msg, const String& line)
item->addChild(XMPPUtils::createElement(XmlTag::Group,o->get()->toString()));
TelEngine::destruct(list);
}
else {
unsigned int n = msg.length();
for (unsigned int i = 0; i < n; i++) {
NamedString* ns = msg.getParam(i);
if (ns && ns->name() == "group" && *ns)
item->addChild(XMPPUtils::createElement(XmlTag::Group,*ns));
}
}
// Arbitrary children
String* tmp = msg.getParam("extra");
if (tmp) {
@ -1622,8 +1630,11 @@ static void addRosterItem(NamedList& list, XmlElement& x, const String& id,
// Groups and other children
const String* ns = &XMPPUtils::s_ns[XMPPNamespace::Roster];
for (XmlElement* c = x.findFirstChild(0,ns); c; c = x.findNextChild(c,0,ns)) {
if (XMPPUtils::isUnprefTag(*c,XmlTag::Group))
groups->append(c->getText(),",");
if (XMPPUtils::isUnprefTag(*c,XmlTag::Group)) {
const String& grp = c->getText();
groups->append(grp,",");
list.addParam(pref + "group",grp,false);
}
else
list.addParam(pref + c->unprefixedTag(),c->getText());
}