Examples of Unblock


Examples of com.sissi.protocol.iq.block.UnBlock

   *
   * @see com.sissi.pipeline.Input#input(com.sissi.context.JIDContext, com.sissi.protocol.Protocol)
   */
  @Override
  public boolean input(JIDContext context, Protocol protocol) {
    UnBlock ub = protocol.cast(UnBlock.class);
    return ub.unBlockAll() ? this.unblockAndReturn(context) : this.unblockAndReturn(context, ub.getItem());
  }
View Full Code Here

Examples of rocks.xmpp.extensions.blocking.model.Unblock

                        }
                        xmppSession.send(iq.createResult());
                        e.consume();
                        notifyListeners(pushedContacts, Collections.<Jid>emptyList());
                    } else {
                        Unblock unblock = iq.getExtension(Unblock.class);
                        if (unblock != null) {
                            List<Jid> pushedContacts = new ArrayList<>();
                            synchronized (blockedContacts) {
                                if (unblock.getItems().isEmpty()) {
                                    // Empty means, the user has unblocked communications with all contacts.
                                    pushedContacts.addAll(blockedContacts);
                                    blockedContacts.clear();
                                } else {
                                    for (Jid item : unblock.getItems()) {
                                        blockedContacts.remove(item);
                                        pushedContacts.add(item);
                                    }
                                }
                            }
View Full Code Here

Examples of rocks.xmpp.extensions.blocking.model.Unblock

     * @see <a href="http://xmpp.org/extensions/xep-0191.html#unblockall">3.5 User Unblocks All Contacts</a>
     */
    public void unblockContact(Jid... jids) throws XmppException {
        List<Jid> items = new ArrayList<>();
        Collections.addAll(items, jids);
        xmppSession.query(new IQ(IQ.Type.SET, new Unblock(items)));
    }
View Full Code Here

Examples of rocks.xmpp.extensions.blocking.model.Unblock

    @Test
    public void marshalUnblock() throws JAXBException, XMLStreamException {
        List<Jid> items = new ArrayList<>();
        items.add(Jid.valueOf("romeo@montague.net"));
        IQ iq = new IQ("1", IQ.Type.SET, new Unblock(items));
        String xml = marshal(iq);
        Assert.assertEquals(xml, "<iq id=\"1\" type=\"set\"><unblock xmlns=\"urn:xmpp:blocking\"><item jid=\"romeo@montague.net\"></item></unblock></iq>");
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.