Report offensive messages

Unreal Chat SDK provides a mechanism for users to report offensive content in messages directly from their applications.

In each case, a user must provide a reason for flagging a given message. As a result of flagging, a reported message gets published on the dedicated administrative channel (with the PUBNUB_INTERNAL_ADMIN_CHANNEL ID) and an event of the report type gets created.

As a developer, you can add custom logic that uses the emitted events and defines what an admin can later do with such reported messages. For example, an admin can delete an inappropriate message.

icon

Usage in Blueprints and C++


Message Persistence

To work with stored message data, you must enable Message Persistence for your app's keyset in the Admin Portal.

Flag/Report messages

Report() lets you flag and report an inappropriate message to the admin.

Method signature

Output

This method doesn't return any value.

Basic usage

Report a message on the support channel as offensive.

#include "Kismet/GameplayStatics.h"
#include "PubnubChatSubsystem.h"

UGameInstance* GameInstance = UGameplayStatics::GetGameInstance(this);
UPubnubChatSubsystem* PubnubChatSubsystem = GameInstance->GetSubsystem<UPubnubChatSubsystem>();

UPubnubChat* Chat = PubnubChatSubsystem ->InitChat("demo", "demo", "my_user");

UPubnubChannel* Channel = Chat->GetChannel("support");

FString Timetoken = "16200000000000001";

// Fetch the message
UPubnubMessage* Message = Channel->GetMessage(Timetoken);

show all 16 lines

Listen to report events

As an admin of your chat app, you can monitor all events emitted when someone reports an offensive message using the ListenForEvents() method. You can use this method to create moderation dashboard alerts.

Events documentation

To read more about the events of type report, refer to the Chat events documentation.

Method signature

icon

Handle the response

Output

This method doesn't return any value.

Basic usage

Print a notification for an offensive message reported on the support channel.

#include "Kismet/GameplayStatics.h"
#include "PubnubChatSubsystem.h"

UGameInstance* GameInstance = UGameplayStatics::GetGameInstance(this);
UPubnubChatSubsystem* PubnubChatSubsystem = GameInstance->GetSubsystem<UPubnubChatSubsystem>();

UPubnubChat* Chat = PubnubChatSubsystem ->InitChat("demo", "demo", "my_user");

UPubnubChannel* Channel = Chat->GetChannel("support");

FString Timetoken = "16200000000000001";

// Fetch the message
UPubnubMessage* Message = Channel->GetMessage(Timetoken);

show all 27 lines
Last updated on