use of org.jivesoftware.smackx.muclight.element.MUCLightGetAffiliationsIQ in project Smack by igniterealtime.
the class MultiUserChatLight method getAffiliations.
/**
* Get the MUC Light affiliations.
*
* @param version
* @return the room affiliations
* @throws NoResponseException
* @throws XMPPErrorException
* @throws NotConnectedException
* @throws InterruptedException
*/
public HashMap<Jid, MUCLightAffiliation> getAffiliations(String version) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
MUCLightGetAffiliationsIQ mucLightGetAffiliationsIQ = new MUCLightGetAffiliationsIQ(room, version);
IQ responseIq = connection.createStanzaCollectorAndSend(mucLightGetAffiliationsIQ).nextResultOrThrow();
MUCLightAffiliationsIQ mucLightAffiliationsIQ = (MUCLightAffiliationsIQ) responseIq;
return mucLightAffiliationsIQ.getAffiliations();
}
use of org.jivesoftware.smackx.muclight.element.MUCLightGetAffiliationsIQ in project Smack by igniterealtime.
the class MUCLightGetAffiliationsTest method checkGetAffiliationsIQ.
@Test
public void checkGetAffiliationsIQ() throws Exception {
MUCLightGetAffiliationsIQ mucLightGetAffiliationsIQ = new MUCLightGetAffiliationsIQ(JidCreate.from("coven@muclight.shakespeare.lit"), "abcdefg");
mucLightGetAffiliationsIQ.setStanzaId("getmembers");
Assert.assertEquals(getAffiliationsIQExample, mucLightGetAffiliationsIQ.toXML().toString());
}
Aggregations