mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2024-12-23 13:07:59 +01:00
64 lines
978 B
Markdown
64 lines
978 B
Markdown
|
Blocking Command
|
||
|
================
|
||
|
|
||
|
Allows to manage communications blocking.
|
||
|
|
||
|
* Check push notifications support
|
||
|
* Get blocking list
|
||
|
* Block contact
|
||
|
* Unblock contact
|
||
|
* Unblock all
|
||
|
|
||
|
|
||
|
**XEP related:** [XEP-0191](http://xmpp.org/extensions/xep-0191.html)
|
||
|
|
||
|
|
||
|
Get an instance of Blocking Command Manager
|
||
|
-------------------------------------------
|
||
|
|
||
|
```
|
||
|
BlockingCommandManager blockingCommandManager = BlockingCommandManager.getInstanceFor(connection);
|
||
|
```
|
||
|
|
||
|
|
||
|
Check blocking command support
|
||
|
------------------------------
|
||
|
|
||
|
```
|
||
|
boolean isSupported = blockingCommandManager.isSupportedByServer();
|
||
|
```
|
||
|
|
||
|
|
||
|
Get block list
|
||
|
--------------
|
||
|
|
||
|
```
|
||
|
List<Jid> blockList = blockingCommandManager.getBlockList();
|
||
|
```
|
||
|
|
||
|
|
||
|
Block contact
|
||
|
-------------
|
||
|
|
||
|
```
|
||
|
blockingCommandManager.blockContact(jid);
|
||
|
```
|
||
|
*jid* is a `Jid`
|
||
|
|
||
|
|
||
|
Unblock contact
|
||
|
---------------
|
||
|
|
||
|
```
|
||
|
blockingCommandManager.unblockContact(jid);
|
||
|
```
|
||
|
*jid* is a `Jid`
|
||
|
|
||
|
|
||
|
Unblock all
|
||
|
-----------
|
||
|
|
||
|
```
|
||
|
blockingCommandManager.unblockAll();
|
||
|
```
|