use of com.xabber.xmpp.blocking.Unblock in project xabber-android by redsolution.
the class BlockingManager method unblockContacts.
public void unblockContacts(String account, final List<String> contacts, final UnblockContactListener listener) {
if (!isSupported(account)) {
return;
}
final Unblock unblockRequest = new Unblock();
unblockRequest.setType(IQ.Type.set);
for (String contact : contacts) {
unblockRequest.addItem(contact);
}
sendUnblock(account, listener, unblockRequest);
}
use of com.xabber.xmpp.blocking.Unblock in project xabber-android by redsolution.
the class BlockingManager method onPacket.
@Override
public void onPacket(ConnectionItem connection, String bareAddress, Stanza packet) {
if (packet instanceof Block && ((Block) packet).getType() == IQ.Type.set) {
LogManager.i(this, "Block push received");
Block block = (Block) packet;
for (String contact : block.getItems()) {
blockContactLocally(packet.getTo(), contact);
}
requestBlockList(packet.getTo());
}
if (packet instanceof Unblock && ((Unblock) packet).getType() == IQ.Type.set) {
LogManager.i(this, "Unblock push received");
requestBlockList(packet.getTo());
}
}