Search in sources :

Example 11 with MUCLightBlockingIQ

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;
}
Also used : Jid(org.jxmpp.jid.Jid) DomainBareJid(org.jxmpp.jid.DomainBareJid) EntityBareJid(org.jxmpp.jid.EntityBareJid) MUCLightBlockingIQ(org.jivesoftware.smackx.muclight.element.MUCLightBlockingIQ) ArrayList(java.util.ArrayList)

Example 12 with MUCLightBlockingIQ

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());
}
Also used : MUCLightBlockingIQ(org.jivesoftware.smackx.muclight.element.MUCLightBlockingIQ) Test(org.junit.Test)

Example 13 with MUCLightBlockingIQ

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;
}
Also used : Jid(org.jxmpp.jid.Jid) DomainBareJid(org.jxmpp.jid.DomainBareJid) EntityBareJid(org.jxmpp.jid.EntityBareJid) MUCLightBlockingIQ(org.jivesoftware.smackx.muclight.element.MUCLightBlockingIQ) ArrayList(java.util.ArrayList)

Example 14 with MUCLightBlockingIQ

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;
}
Also used : Jid(org.jxmpp.jid.Jid) DomainBareJid(org.jxmpp.jid.DomainBareJid) EntityBareJid(org.jxmpp.jid.EntityBareJid) MUCLightBlockingIQ(org.jivesoftware.smackx.muclight.element.MUCLightBlockingIQ) ArrayList(java.util.ArrayList)

Aggregations

MUCLightBlockingIQ (org.jivesoftware.smackx.muclight.element.MUCLightBlockingIQ)14 Jid (org.jxmpp.jid.Jid)7 Test (org.junit.Test)5 ArrayList (java.util.ArrayList)3 HashMap (java.util.HashMap)3 DomainBareJid (org.jxmpp.jid.DomainBareJid)3 EntityBareJid (org.jxmpp.jid.EntityBareJid)3 IQ (org.jivesoftware.smack.packet.IQ)2 IQReplyFilter (org.jivesoftware.smack.filter.IQReplyFilter)1 StanzaFilter (org.jivesoftware.smack.filter.StanzaFilter)1