use of org.jivesoftware.smackx.muclight.element.MUCLightBlockingIQ in project Smack by igniterealtime.
the class MultiUserChatLightManager method getRoomsBlocked.
/**
* Get rooms blocked.
*
* @param mucLightService
* @return the list of rooms blocked
* @throws NoResponseException
* @throws XMPPErrorException
* @throws NotConnectedException
* @throws InterruptedException
*/
public List<Jid> getRoomsBlocked(DomainBareJid mucLightService) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
MUCLightBlockingIQ muclIghtBlockingIQResult = getBlockingList(mucLightService);
List<Jid> jids = new ArrayList<>();
if (muclIghtBlockingIQResult.getRooms() != null) {
jids.addAll(muclIghtBlockingIQResult.getRooms().keySet());
}
return jids;
}
use of org.jivesoftware.smackx.muclight.element.MUCLightBlockingIQ in project Smack by igniterealtime.
the class MUCLightBlockingTest method checkGetBlockingListIQ.
@Test
public void checkGetBlockingListIQ() throws Exception {
MUCLightBlockingIQ mucLightBlockingIQ = new MUCLightBlockingIQ(null, null);
mucLightBlockingIQ.setType(Type.get);
mucLightBlockingIQ.setStanzaId("getblock1");
mucLightBlockingIQ.setTo(JidCreate.from("muclight.shakespeare.lit"));
Assert.assertEquals(getBlockingListIQExample, mucLightBlockingIQ.toXML().toString());
}
use of org.jivesoftware.smackx.muclight.element.MUCLightBlockingIQ in project Smack by igniterealtime.
the class MultiUserChatLightManager method getUsersBlocked.
/**
* Get users blocked.
*
* @param mucLightService
* @return the list of users blocked
* @throws NoResponseException
* @throws XMPPErrorException
* @throws NotConnectedException
* @throws InterruptedException
*/
public List<Jid> getUsersBlocked(DomainBareJid mucLightService) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
MUCLightBlockingIQ muclIghtBlockingIQResult = getBlockingList(mucLightService);
List<Jid> jids = new ArrayList<>();
if (muclIghtBlockingIQResult.getUsers() != null) {
jids.addAll(muclIghtBlockingIQResult.getUsers().keySet());
}
return jids;
}
use of org.jivesoftware.smackx.muclight.element.MUCLightBlockingIQ in project Smack by igniterealtime.
the class MultiUserChatLightManager method getUsersAndRoomsBlocked.
/**
* Get users and rooms blocked.
*
* @param mucLightService
* @return the list of users and rooms blocked
* @throws NoResponseException
* @throws XMPPErrorException
* @throws NotConnectedException
* @throws InterruptedException
*/
public List<Jid> getUsersAndRoomsBlocked(DomainBareJid mucLightService) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
MUCLightBlockingIQ muclIghtBlockingIQResult = getBlockingList(mucLightService);
List<Jid> jids = new ArrayList<>();
if (muclIghtBlockingIQResult.getRooms() != null) {
jids.addAll(muclIghtBlockingIQResult.getRooms().keySet());
}
if (muclIghtBlockingIQResult.getUsers() != null) {
jids.addAll(muclIghtBlockingIQResult.getUsers().keySet());
}
return jids;
}
Aggregations