use of org.jivesoftware.smackx.muclight.element.MUCLightCreateIQ in project Smack by igniterealtime.
the class MultiUserChatLight method create.
/**
* Create new MUCLight.
*
* @param roomName
* @param subject
* @param customConfigs
* @param occupants
* @throws Exception
*/
public void create(String roomName, String subject, HashMap<String, String> customConfigs, List<Jid> occupants) throws Exception {
MUCLightCreateIQ createMUCLightIQ = new MUCLightCreateIQ(room, roomName, occupants);
messageCollector = connection.createStanzaCollector(fromRoomGroupchatFilter);
try {
connection.createStanzaCollectorAndSend(createMUCLightIQ).nextResultOrThrow();
} catch (NotConnectedException | InterruptedException | NoResponseException | XMPPErrorException e) {
removeConnectionCallbacks();
throw e;
}
}
use of org.jivesoftware.smackx.muclight.element.MUCLightCreateIQ in project Smack by igniterealtime.
the class MUCLightCreateIQTest method checkCreateMUCLightStanza.
@Test
public void checkCreateMUCLightStanza() throws Exception {
List<Jid> occupants = new ArrayList<>();
occupants.add(JidCreate.from("charlie@test.com"));
occupants.add(JidCreate.from("pep@test.com"));
MUCLightCreateIQ mucLightCreateIQ = new MUCLightCreateIQ(JidCreate.from("ef498f55-5f79-4238-a5ae-4efe19cbe617@muclight.test.com").asEntityJidIfPossible(), "test", occupants);
mucLightCreateIQ.setStanzaId("1c72W-50");
Assert.assertEquals(mucLightCreateIQ.getConfiguration().getRoomName(), "test");
HashMap<Jid, MUCLightAffiliation> iqOccupants = mucLightCreateIQ.getOccupants();
Assert.assertEquals(iqOccupants.get(JidCreate.from("charlie@test.com")), MUCLightAffiliation.member);
Assert.assertEquals(iqOccupants.get(JidCreate.from("pep@test.com")), MUCLightAffiliation.member);
}
Aggregations