use of org.jivesoftware.smackx.blocking.element.UnblockContactsIQ in project Smack by igniterealtime.
the class UnblockContactsIQTest method checkUnblockContactIQStanza.
@Test
public void checkUnblockContactIQStanza() throws Exception {
List<Jid> jids = new ArrayList<>();
jids.add(JidCreate.from("romeo@montague.net"));
jids.add(JidCreate.from("pepe@montague.net"));
UnblockContactsIQ unblockContactIQ = new UnblockContactsIQ(jids);
unblockContactIQ.setStanzaId("unblock1");
Assert.assertEquals(unblockContactIQExample, unblockContactIQ.toXML().toString());
}
use of org.jivesoftware.smackx.blocking.element.UnblockContactsIQ in project Smack by igniterealtime.
the class UnblockContactsIQTest method checkUnblockContactPushIQ.
@Test
public void checkUnblockContactPushIQ() throws Exception {
IQ iq = (IQ) PacketParserUtils.parseStanza(unblockContactPushIQExample);
UnblockContactsIQ unblockContactIQ = (UnblockContactsIQ) iq;
Assert.assertEquals(JidCreate.from("romeo@montague.net"), unblockContactIQ.getJids().get(0));
Assert.assertEquals(JidCreate.from("pepe@montague.net"), unblockContactIQ.getJids().get(1));
}
use of org.jivesoftware.smackx.blocking.element.UnblockContactsIQ in project Smack by igniterealtime.
the class UnblockContactsIQTest method checkUnblockAllPushIQ.
@Test
public void checkUnblockAllPushIQ() throws Exception {
IQ iq = (IQ) PacketParserUtils.parseStanza(unblockAllPushIQExample);
UnblockContactsIQ unblockAllIQ = (UnblockContactsIQ) iq;
Assert.assertNull(unblockAllIQ.getJids());
}
use of org.jivesoftware.smackx.blocking.element.UnblockContactsIQ in project Smack by igniterealtime.
the class BlockingCommandManager method unblockAll.
/**
* Unblock all.
*
* @throws NoResponseException
* @throws XMPPErrorException
* @throws NotConnectedException
* @throws InterruptedException
*/
public void unblockAll() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
UnblockContactsIQ unblockContactIQ = new UnblockContactsIQ();
connection().createStanzaCollectorAndSend(unblockContactIQ).nextResultOrThrow();
}
use of org.jivesoftware.smackx.blocking.element.UnblockContactsIQ in project Smack by igniterealtime.
the class BlockingCommandManager method unblockContacts.
/**
* Unblock contacts.
*
* @param jids
* @throws NoResponseException
* @throws XMPPErrorException
* @throws NotConnectedException
* @throws InterruptedException
*/
public void unblockContacts(List<Jid> jids) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
UnblockContactsIQ unblockContactIQ = new UnblockContactsIQ(jids);
connection().createStanzaCollectorAndSend(unblockContactIQ).nextResultOrThrow();
}
Aggregations