Search in sources :

Example 1 with UserWithAffiliationElement

use of org.jivesoftware.smackx.muclight.element.MUCLightElements.UserWithAffiliationElement in project Smack by igniterealtime.

the class MUCLightChangeAffiliationsIQ method getIQChildElementBuilder.

@Override
protected IQChildElementXmlStringBuilder getIQChildElementBuilder(IQChildElementXmlStringBuilder xml) {
    xml.rightAngleBracket();
    if (affiliations != null) {
        Iterator<Map.Entry<Jid, MUCLightAffiliation>> it = affiliations.entrySet().iterator();
        while (it.hasNext()) {
            Map.Entry<Jid, MUCLightAffiliation> pair = it.next();
            xml.element(new UserWithAffiliationElement(pair.getKey(), pair.getValue()));
        }
    }
    return xml;
}
Also used : MUCLightAffiliation(org.jivesoftware.smackx.muclight.MUCLightAffiliation) Jid(org.jxmpp.jid.Jid) UserWithAffiliationElement(org.jivesoftware.smackx.muclight.element.MUCLightElements.UserWithAffiliationElement) Map(java.util.Map) HashMap(java.util.HashMap)

Example 2 with UserWithAffiliationElement

use of org.jivesoftware.smackx.muclight.element.MUCLightElements.UserWithAffiliationElement in project Smack by igniterealtime.

the class MUCLightAffiliationsIQ method getIQChildElementBuilder.

@Override
protected IQChildElementXmlStringBuilder getIQChildElementBuilder(IQChildElementXmlStringBuilder xml) {
    xml.rightAngleBracket();
    xml.optElement("version", version);
    Iterator<Map.Entry<Jid, MUCLightAffiliation>> it = affiliations.entrySet().iterator();
    while (it.hasNext()) {
        Map.Entry<Jid, MUCLightAffiliation> pair = it.next();
        xml.element(new UserWithAffiliationElement(pair.getKey(), pair.getValue()));
    }
    return xml;
}
Also used : MUCLightAffiliation(org.jivesoftware.smackx.muclight.MUCLightAffiliation) Jid(org.jxmpp.jid.Jid) UserWithAffiliationElement(org.jivesoftware.smackx.muclight.element.MUCLightElements.UserWithAffiliationElement) Map(java.util.Map) HashMap(java.util.HashMap)

Aggregations

HashMap (java.util.HashMap)2 Map (java.util.Map)2 MUCLightAffiliation (org.jivesoftware.smackx.muclight.MUCLightAffiliation)2 UserWithAffiliationElement (org.jivesoftware.smackx.muclight.element.MUCLightElements.UserWithAffiliationElement)2 Jid (org.jxmpp.jid.Jid)2