Moderation

Block a User#

To block a user call the below method.

Mirrorfly.blockUser(userJid: JID_TO_BLOCK, flyCallBack: (FlyResponse response) {
if (response.isSuccess) {
//User is blocked update the UI
} else {
//User blocking failed print throwable to find the exception details
}
});
ArgumentTypeDescription
JID_TO_BLOCKStringJID of the user
flyCallbackFlyResponsecallback to observe the action status
caution

If block feature unavailable for your plan then it will throw 403 exception.

Unblock a User#

To unblock a user who is blocked already call the below method.

Mirrorfly.unblockUser(userJid: JID_TO_UNBLOCK, flyCallBack: (FlyResponse response) {
if (response.isSuccess) {
//User is unblocked update the UI
} else {
//User unblocking failed print throwable to find the exception details
}
});
ArgumentTypeDescription
JID_TO_UNBLOCKStringJID of the user
flyCallbackFlyResponsecallback to observe the action status
caution

Blocking and Unblocking valid for Single chat user only not for Group.

caution

If block feature unavailable for your plan then it will throw 403 exception.

Get user profiles that you blocked#

To get the list of chat user profiles that you blocked call the below method.

Mirrorfly.getUsersIBlocked(fetchFromServer: SERVER_CALL, flyCallBack: (FlyResponse response) {
if(response.isSuccess && response.hasData){
var profilesList = memberFromJson(response.data);
} else {
//Getting users that you blocked failed print throwable to find the exception details
}
});
ArgumentDescriptionType
SERVER_CALLbooltrue to get the synced list from server false to get the list from local data. default value is false
flyCallbackFlyResponsecallback to observe the action status

Note : To make server call internet connection is required

caution

If block feature unavailable for your plan then it will throw 403 exception.

Get user profiles that blocked you#

To get the list of single chat user that blocked you call the below method.

Mirrorfly.getUsersWhoBlockedMe(fetchFromServer: SERVER_CALL, flyCallBack: (FlyResponse response) {
if(response.isSuccess && response.hasData){
var profilesList = memberFromJson(response.data);
} else {
//Getting users blocked me list failed print throwable to find the exception details
}
});
ArgumentTypeDescription
SERVER_CALLbooltrue to get the synced list from server false to get the list from local data. default value is false
flyCallbackFlyResponsecallback to observe the action status

Note : To make server call internet connection is required

caution

If block feature unavailable for your plan then it will throw 403 exception.

Mute user/Group#

If you want to mute the notifications for the chat of a user or a group, you can utilise the below method.

Mirrorfly.updateChatMuteStatus(jid: JID, muteStatus: MUTE_STATUS);
ArgumentTypeDescription
JIDStringjid of the chat user/ group
MUTE_STATUSbooltrue, if you want to mute notifications for the chat

Mute Chat Status#

Get Mute Chat Status to check the archived chat.

bool? isChatMuted = await Mirrorfly.isChatMuted();
info

The Mute chat status will be returned either true or false

Encrypt/Decrypt media files#

To encrypt all media files while uploading to server, call below method to enable media encryption in SDK

ChatManager.setMediaEncryption(enable: true);

Note: If this flag enabled then all type of media files will be encrypted while uploading and stored in server, On receiver side media files will be decrypted while downloading and readable file will be stored in local storage.

Report User/Group Messages#

This feature is used to do report the user/group messages by selecting the message or user/group profile. If the user/group is reported by person to admin, the user's last 5 conversations or by selecting along with the selected message and previous 4 messages will be sent to the admin panel based on that chats availability. By using the below method person can achieve the User/Group report messages.

Mirrorfly.reportUserOrMessages(jid: TO_USER_JID, type: CHAT_TYPE,messageId: SELECTED_MID, flyCallBack: (FlyResponse response) {
if (response.isSuccess) {
// Report Success Response
} else {
// Report Failure Response
}
});

Note : In this method SELECTED_MID is optional argument. If person selected a message to report use this param other wise ignore the param.

ArgumentTypeDescription
TO_USER_JIDStringReport User Jid who needs to be reported
CHAT_TYPEString"chat" for single chat, "groupchat" for group chat
SELECTED_MIDStringSelected Message ID (optional)
caution

If report chat feature unavailable for your plan then it will throw 403 exception.

Handling Banned User/Group#

This feature is used to get the users/groups admin blocked status. So that you can check the user/group available status and communicate with them. If user/group blocked by admin then you will get notify the alert message.

Get Own user Admin Block Status#

This method is used to get the live status of own user profile blocked/unblocked by Admin status, so that you will be navigated to show stopper screen if profile blocked by admin.

Mirrorfly.onAdminBlockedUser.listen((event) {
var data = json.decode(event.toString());
var jid = data["jid"];
var status = data["status"];
// jid - own user profile jid, status - admin block/unblock status
// Write your logic here
// to show/hide showstopper screen, based on the admin block/unblock status
});

Get Other user/group Admin Block Status#

This method is used to get the live status of other user/group profile blocked/unblocked by Admin status, so that you will be notified the profile status.

Mirrorfly.onAdminBlockedOtherUser.listen((event) {
var data = json.decode(event.toString());
var jid = data["jid"];
var type = data["type"];
var status = data["status"];
// jid - user/group profile jid, type - chat/groupchat, status - admin block/unblock status
// Write your logic here to handle the user/group communications
}