org.jivesoftware.smackx.blocking.BlockingCommandManager Java Examples
The following examples show how to use
org.jivesoftware.smackx.blocking.BlockingCommandManager.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BlockingService.java From xyTalk-pc with GNU Affero General Public License v3.0 | 6 votes |
public BlockingService() { //初始化实例Blocking Command Manager BlockingCommandManager blockingCommandManager = BlockingCommandManager.getInstanceFor(Launcher.connection); //检查是否有阻止服务支持 try { boolean isSupported = blockingCommandManager.isSupportedByServer(); //获取block list List<Jid> blockList = blockingCommandManager.getBlockList(); } catch (NoResponseException | XMPPErrorException | NotConnectedException | InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } //阻止一个人 //blockingCommandManager.blockContact(jid); //解锁Unblock //blockingCommandManager.unblockContact(jid); //全部解锁 //blockingCommandManager.unblockAll(); }
Example #2
Source File: XMPPSession.java From mangosta-android with Apache License 2.0 | 4 votes |
public BlockingCommandManager getBlockingCommandManager() { return BlockingCommandManager.getInstanceFor(mXMPPConnection); }