use of org.jivesoftware.smackx.blocking.element.BlockContactsIQ in project Smack by igniterealtime.
the class BlockContactsIQTest method checkBlockContactPushIQ.
@Test
public void checkBlockContactPushIQ() throws Exception {
IQ iq = (IQ) PacketParserUtils.parseStanza(blockContactPushIQExample);
BlockContactsIQ blockContactIQ = (BlockContactsIQ) iq;
Assert.assertEquals(JidCreate.from("romeo@montague.net"), blockContactIQ.getJids().get(0));
Assert.assertEquals(JidCreate.from("pepe@montague.net"), blockContactIQ.getJids().get(1));
}
use of org.jivesoftware.smackx.blocking.element.BlockContactsIQ in project Smack by igniterealtime.
the class BlockingCommandManager method blockContacts.
/**
* Block contacts.
*
* @param jids
* @throws NoResponseException
* @throws XMPPErrorException
* @throws NotConnectedException
* @throws InterruptedException
*/
public void blockContacts(List<Jid> jids) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
BlockContactsIQ blockContactIQ = new BlockContactsIQ(jids);
connection().createStanzaCollectorAndSend(blockContactIQ).nextResultOrThrow();
}
use of org.jivesoftware.smackx.blocking.element.BlockContactsIQ in project Smack by igniterealtime.
the class BlockContactsIQTest method checkBlockContactIQStanza.
@Test
public void checkBlockContactIQStanza() throws Exception {
List<Jid> jids = new ArrayList<>();
jids.add(JidCreate.from("romeo@montague.net"));
jids.add(JidCreate.from("pepe@montague.net"));
BlockContactsIQ blockContactIQ = new BlockContactsIQ(jids);
blockContactIQ.setStanzaId("block1");
Assert.assertEquals(blockContactIQExample, blockContactIQ.toXML().toString());
}
Aggregations