Moderation
Block a User#
To block a user call the below method.
caution
If block user feature unavailable for your plan then below methods will throw 403 exception.
| Argument | Type | Description |
|---|---|---|
| JID_TO_BLOCK | String | JID of the user |
| CALLBACK | FlyCompletionHandler | FlyCompletionHandler used as completion Handler |
Unblock a user#
To unblock a user who is blocked already call the below method.
caution
If unblock user feature unavailable for your plan then below methods will throw 403 exception.
| Argument | Type | Description |
|---|---|---|
| JID_TO_UNBLOCK | String | JID of the user |
| CALLBACK | FlyCompletionHandler | FlyCompletionHandler used as completion Handler |
caution
Blocking and Unblocking valid for Single chat user only not for Group/Broadcast.
Get user profiles that you blocked#
To get the list of chat user profiles that you blocked call the below method.
caution
If block user feature unavailable for your plan then below methods will throw 403 exception.
Refer Class documentation to know about ProfileDetails Class
| Argument | Type | Description |
|---|---|---|
FETCH_FROM_SERVER | true to fetch from server false will fetch from local database | Bool |
| CALLBACK | FlyCompletionHandler | FlyCompletionHandler used as completion Handler |
Note : To make server call internet connection is required
Get user profiles that blocked you#
To get the list of single chat user that blocked you call the below method.
caution
If block user feature unavailable for your plan then below methods will throw 403 exception.
Refer Class documentation to know about ProfileDetails Class
| Argument | Type | Description |
|---|---|---|
FETCH_FROM_SERVER | true to fetch from server false will fetch from local database | Bool |
| CALLBACK | FlyCompletionHandler | FlyCompletionHandler used as completion Handler |
Note : To make server call internet connection is required
Media File Encryption#
Media files can be encrypted before uploading them to the server by calling the below method.By default media file encryption is disabled.
| Argument | Type | Description |
|---|---|---|
| ENABLE | Bool | if true media files will be encrypted |
Report a user or group or message#
Reporting is a feature which allows users to report a user or group or message.
Getting Messgages To report by user Jid#
caution
If report message feature unavailable for your plan then below methods will throw 403 exception.
| Argument | Type | Description |
|---|---|---|
| chatUserJid | String | jid of a user or groupJid |
| messagesCount | Int | count of messages to be reported |
| Retrun | Type | Description |
|---|---|---|
| ReportMessage | ReportMessage struct | ReportMessage is a model to be passed while reporting messages |
Getting Messgages To report from selected message#
caution
If report message feature unavailable for your plan then below methods will throw 403 exception.
| Argument | Type | Description |
|---|---|---|
| message | ChatMessage | selected ChatMessage |
| messagesCount | Int | count of messages to be reported from selected message |
| Retrun | Type | Description |
|---|---|---|
| ReportMessage | ReportMessage struct | ReportMessage is a model to be passed while reporting messages |
Reporting#
To report call below method.
caution
If report message feature unavailable for your plan then below methods will throw 403 exception.
| Argument | Type | Description |
|---|---|---|
| reportMessage | ReportMessage | ReportMessage modle to be passed to report |
| result | Type | Description |
|---|---|---|
| isSent | Bool | true if success. false if failure |
Handling Banned User/Group#
Banning a user or group is a feature. A user or group can be blocked or unblocked from console. This is applicable to logged in user, contacts of logged in user and groups
Note: Xmpp must be connected
Current / Logged in user#
To get blocking/unblocking event of current/logged in user, confirm viewcontroller or Appdelegate to below protocol.
AdminBlockCurrentUserDelegate
In Appdelegate#
In ViewController#
| Argument | Type | Description |
|---|---|---|
| userJid | String | jid of the current user |
| isBlocked | Bool | true, if current user is being blocked. false, if current user is unblocked |
Contacts of current user and group#
To get blocking/unblocking event of Contacts of current user and group, confirm viewcontroller to below protocol.
AdminBlockDelegate
In ViewController#
| Argument | Type | Description |
|---|---|---|
| userJid | String | jid of the user |
| isBlocked | Bool | true, if user is being blocked. false, if user is unblocked |
| groupJid | String | jid of the group |