Loading...
Searching...
No Matches
AccelByte::Api::Chat Class Reference

Chat API for chatting between users Unlike other servers which use HTTP, Chat server uses WebSocket (RFC 6455). More...

#include <AccelByteChatApi.h>

Inheritance diagram for AccelByte::Api::Chat:

Public Types

typedef AccelByteWebSocket::FConnectionCloseDelegate FChatConnectionClosed
typedef AccelByteWebSocket::FReconnectAttemptMulticastDelegate FReconnectAttempted
typedef AccelByteWebSocket::FMassiveOutageMulticastDelegate FMassiveOutage

Public Member Functions

 Chat (Credentials &InCredentialsRef, Settings const &InSettingsRef, FHttpRetrySchedulerBase &InHttpRef, FAccelByteMessagingSystem &InMessagingSystemRef, FAccelByteNetworkConditioner &InNetworkConditionerRef, TSharedPtr< AccelByte::FApiClient, ESPMode::ThreadSafe > const &InApiClient=nullptr, float InPingDelay=30.f, float InInitialBackoffDelay=1.f, float InMaxBackoffDelay=30.f, float InTotalTimeout=60.f)
 Chat (Credentials &InCredentialsRef, Settings const &InSettingsRef, FHttpRetrySchedulerBase &InHttpRef, FAccelByteMessagingSystem &InMessagingSystemRef, FAccelByteNetworkConditioner &InNetworkConditionerRef, FAccelBytePlatformPtr const &InAccelBytePlatform, float InPingDelay=30.f, float InInitialBackoffDelay=1.f, float InMaxBackoffDelay=30.f, float InTotalTimeout=60.f)
 DECLARE_DELEGATE (FChatConnectSuccess)
 DECLARE_DELEGATE_OneParam (FChatDisconnectNotif, FAccelByteModelsChatDisconnectNotif const &)
 DECLARE_DELEGATE_OneParam (FChatRefreshTokenResponse, FAccelByteModelsChatRefreshTokenResponse const &)
 delegate for handling response when refreshing chat token.
 DECLARE_DELEGATE_OneParam (FSendChatResponse, FAccelByteModelsChatSendChatResponse const &)
 delegate for handling sent chat response.
 DECLARE_DELEGATE_OneParam (FQueryTopicResponse, FAccelByteModelsChatQueryTopicResponse const &)
 delegate for handling chat topic query response.
 DECLARE_DELEGATE_OneParam (FQueryTopicByIdResponse, FAccelByteModelsChatQueryTopicByIdResponse const &)
 delegate for handling chat topic query by id response.
 DECLARE_DELEGATE_OneParam (FQueryPublicTopicResponse, FAccelByteModelsChatQueryPublicTopicResponse const &)
 delegate for handling public topic query response.
 DECLARE_DELEGATE_OneParam (FQueryChatResponse, FAccelByteModelsChatQueryChatResponse const &)
 delegate for handling chat query response.
 DECLARE_DELEGATE_OneParam (FReadChatResponse, FAccelByteModelsChatReadChatResponse const &)
 delegate for handling read chat response.
 DECLARE_DELEGATE_OneParam (FChatBlockUserResponse, FAccelByteModelsChatBlockUserResponse const &)
 delegate for handling user block response.
 DECLARE_DELEGATE_OneParam (FChatUnblockUserResponse, FAccelByteModelsChatUnblockUserResponse const &)
 delegate for handling user unblock response.
 DECLARE_DELEGATE_OneParam (FChatActionTopicResponse, FAccelByteModelsChatActionTopicResponse const &)
 delegate for handling action chat topic response (create, update, delete, join, quit)
 DECLARE_DELEGATE_OneParam (FAddRemoveUserFromTopicResponse, FAccelByteModelsChatActionUserTopicResponse const &)
 delegate for handling add user to topic and remove user from topic response.
 DECLARE_DELEGATE_OneParam (FDeleteSystemMessagesResponse, FAccelByteModelsDeleteSystemMessagesResponse const &)
 delegate for handling delete system message(s) response.
 DECLARE_DELEGATE_OneParam (FUpdateSystemMessagesResponse, FAccelByteModelsUpdateSystemMessagesResponse const &)
 delegate for handling update system message(s) response.
 DECLARE_DELEGATE_OneParam (FQuerySystemMessageResponse, FAccelByteModelsQuerySystemMessagesResponse const &)
 delegate for handling query system message response.
 DECLARE_DELEGATE_OneParam (FGetSystemMessageStatsResponse, FAccelByteGetSystemMessageStatsResponse const &)
 DECLARE_DELEGATE_OneParam (FGetUserChatConfigurationResponse, FAccelByteModelsGetUserChatConfigurationResponse const &)
 DECLARE_DELEGATE_OneParam (FSetUserChatConfigurationResponse, FAccelByteSetUserChatConfigurationResponse const &)
 DECLARE_DELEGATE_OneParam (FChatNotif, FAccelByteModelsChatNotif const &)
 delegate for handling incoming chat notification.
 DECLARE_DELEGATE_OneParam (FReadChatNotif, FAccelByteModelsReadChatNotif const &)
 delegate for handling read chat notification.
 DECLARE_DELEGATE_OneParam (FAddRemoveFromTopicNotif, FAccelByteModelsChatUpdateUserTopicNotif const &)
 delegate for handling add to/ remove from topic notification.
 DECLARE_DELEGATE_OneParam (FDeleteUpdateTopicNotif, FAccelByteModelsChatUpdateTopicNotif const &)
 delegate for handling chat topic removal/update notification.
 DECLARE_DELEGATE_OneParam (FSystemMessageNotif, FAccelByteModelsChatSystemMessageNotif const &)
 delegate for handling chat incoming system messages.
 DECLARE_DELEGATE_OneParam (FUserBanUnbanNotif, FAccelByteModelsChatUserBanUnbanNotif const &)
 DECLARE_DELEGATE_OneParam (FUserMutedNotif, FAccelByteModelsChatMutedNotif const &)
 DECLARE_DELEGATE_OneParam (FUserUnmutedNotif, FAccelByteModelsChatUnmutedNotif const &)
void Connect ()
 Connect to the Chat server via websocket.
void Disconnect (bool ForceCleanup=false)
 Disconnect from server if and only if the you have connected to server. If not currently connected, then this does nothing.
bool IsConnected () const
 Check whether the websocket is currently connected to the Chat server.
bool IsReconnecting () const
 Check whether the websocket is currently trying to reconnect to the Chat server.
void SendPing ()
 Send and empty string through the web socket connection.
void SetConnectSuccessDelegate (FChatConnectSuccess const &OnConnectSuccess)
 Delegate setter for chat websocket connection success event.
void SetConnectFailedDelegate (FErrorHandler const &OnConnectError)
 Delegate setter for chat websocket connection failure event.
void SetDisconnectNotifDelegate (FChatDisconnectNotif const &OnDisconnectNotif)
 Delegate setter for chat websocket disconnected event.
void SetConnectionClosedDelegate (FChatConnectionClosed const &OnConnectionClosed)
 Delegate setter for chat websocket connection closed event (connection closed by peer).
FReconnectAttempted & OnReconnectAttemptedMulticastDelegate ()
 Get a multicast delegate that will be triggered when an attempt to reconnect websocket has been done.
FMassiveOutage & OnMassiveOutageMulticastDelegate ()
 Get a multicast delegate that will be triggered when connection is down & can't be reestablished. Longer than usual.
FString RefreshToken (FString const &AccessToken, FChatRefreshTokenResponse const &OnSuccess, FErrorHandler const &OnError=nullptr)
 Refresh access token used in chat.
void UnbindEvent ()
 Unbind all delegates set previously.
void CreatePersonalTopic (FString const &TargetUserId, FChatActionTopicResponse const &OnSuccess, FErrorHandler const &OnError=nullptr)
 Create a personal chat topic between logged in user and a TargetUserid (chat members == 2).
void CreateGroupTopic (TSet< FString > const &Users, TSet< FString > const &Admins, FString const &TopicName, bool bIsJoinable, FChatActionTopicResponse const &OnSuccess, FErrorHandler const &OnError=nullptr)
 Create a chat topic between multiple users (chat members > 2). Deprecated.
void CreateGroupTopic (FAccelByteModelsChatCreateTopicRequest const &Request, FChatActionTopicResponse const &OnSuccess, FErrorHandler const &OnError=nullptr)
 Create a chat topic between multiple users (chat members > 2). Deprecated.
void UpdateTopic (FString const &TopicId, FString const &NewFriendlyTopicName, bool bIsJoinable, FChatActionTopicResponse const &OnSuccess, FErrorHandler const &OnError=nullptr)
 Update the topic information, only topic admin can use this operation.
void UpdateTopic (FAccelByteModelsChatUpdateTopicRequest const &Request, FChatActionTopicResponse const &OnSuccess, FErrorHandler const &OnError=nullptr)
 Update the topic information, only topic admin can use this operation.
void DeleteTopic (FString const &ToDeleteGroupTopicId, FChatActionTopicResponse const &OnSuccess, FErrorHandler const &OnError=nullptr)
 Delete the group topic id, only topic admin can use this operation. PERSONAL topic cannot be deleted.
void AddUserToTopic (FAccelByteModelsChatAddUserToTopicRequest const &Request, FAddRemoveUserFromTopicResponse const &OnSuccess, FErrorHandler const &OnError=nullptr)
 Add a new user to an existing GROUP topic id, only topic admin can use this operation.
void AddUserToTopic (FString const &TopicId, FString const &ToAddUserId, FAddRemoveUserFromTopicResponse const &OnSuccess, FErrorHandler const &OnError=nullptr)
 Add an user to an existing topic id, only topic admin can use this operation.
void RemoveUserFromTopic (FAccelByteModelsChatRemoveUserFromTopicRequest const &Request, FAddRemoveUserFromTopicResponse const &OnSuccess, FErrorHandler const &OnError=nullptr)
 Remove an user from an existing topic id, only topic admin can use this operation.
void RemoveUserFromTopic (FString const &TopicId, FString const &ToRemoveUserId, FAddRemoveUserFromTopicResponse const &OnSuccess, FErrorHandler const &OnError=nullptr)
 Remove an user from an existing topic id, only topic admin can use this operation.
void JoinTopic (FString const &TopicId, FChatActionTopicResponse const &OnSuccess, FErrorHandler const &OnError=nullptr)
 Join a joinable group topic.
void QuitTopic (FString const &TopicId, FChatActionTopicResponse const &OnSuccess, FErrorHandler const &OnError=nullptr)
 Leave a group topic.
void SendChat (FString const &TopicId, FString const &Message, FSendChatResponse const &OnSuccess, FErrorHandler const &OnError=nullptr)
 Create a personal chat topic between logged in user and a TargetUserid (chat members == 2).
void DeleteSystemMessages (TSet< FString > const &MessageIds, FDeleteSystemMessagesResponse const &OnSuccess, FErrorHandler const &OnError=nullptr)
 Delete system message(s) in user system inbox.
void UpdateSystemMessages (TArray< FAccelByteModelsActionUpdateSystemMessage > const &ActionUpdateSystemMessages, FUpdateSystemMessagesResponse const &OnSuccess, FErrorHandler const &OnError=nullptr)
 Update system message(s) in user system inbox.
void QuerySystemMessage (FQuerySystemMessageResponse const &OnSuccess, FErrorHandler const &OnError=nullptr, FQuerySystemMessageOptions const &OptionalParams={})
 Query system messages in user's system inbox.
void GetSystemMessageStats (FGetSystemMessageStatsResponse const &OnSuccess, FErrorHandler const &OnError, FAccelByteGetSystemMessageStatsRequest const &Request={})
void QueryPersonalTopic (int Offset, int Limit, FQueryTopicResponse const &OnSuccess, FErrorHandler const &OnError=nullptr)
 Query PERSONAL chat topics that the logged in user is a member of.
void QueryGroupTopic (FAccelByteModelsChatQueryTopicRequest const &Request, FQueryTopicResponse const &OnSuccess, FErrorHandler const &OnError=nullptr)
 Query GROUP chat topics that the logged in user is a member of.
void QueryGroupTopic (FString const &Keyword, int Offset, int Limit, FQueryTopicResponse const &OnSuccess, FErrorHandler const &OnError=nullptr)
 Query GROUP chat topics that are subscribed by the logged in user.
void QueryTopic (FAccelByteModelsChatQueryTopicRequest const &Request, FQueryTopicResponse const &OnSuccess, FErrorHandler const &OnError=nullptr)
 Query chat topics (PERSONAL and GROUP, excluding PUBLIC) that are subscribed by the logged in user.
void QueryTopic (FString const &Keyword, int Offset, int Limit, FQueryTopicResponse const &OnSuccess, FErrorHandler const &OnError=nullptr)
 Query chat topics (PERSONAL and GROUP, excluding PUBLIC) that are subscribed by the logged in user.
void QueryTopicById (FString const &TopicId, FQueryTopicByIdResponse const &OnSuccess, FErrorHandler const &OnError=nullptr)
 Query chat topics (PERSONAL and GROUP, excluding PUBLIC) that are subscribed by the logged in user By using Id as keyword instead of group name.
void QueryPublicTopic (FAccelByteModelsChatQueryTopicRequest const &Request, FQueryPublicTopicResponse const &OnSuccess, FErrorHandler const &OnError=nullptr)
 Query PUBLIC (joinable) chat topics (server topic / channel).
void QueryChat (FAccelByteModelsChatQueryChatRequest const &Request, FQueryChatResponse const &OnSuccess, FErrorHandler const &OnError=nullptr)
 Query chat messages that are subscribed by the logged in user.
void QueryChat (FString const &TopicId, int Limit, FQueryChatResponse const &OnSuccess, FErrorHandler const &OnError=nullptr)
 Query chat messages that are subscribed by the logged in user.
void ReadChat (TSet< FString > const &ChatIds, FReadChatResponse const &OnSuccess, FErrorHandler const &OnError=nullptr)
 Flag the supplied ChatIds as has been read.
void BlockUser (FString const &UserId, FChatBlockUserResponse const &OnSuccess, FErrorHandler const &OnError=nullptr)
 Block user from chatting.
void UnblockUser (FString const &UserId, FChatUnblockUserResponse const &OnSuccess, FErrorHandler const &OnError=nullptr)
 Unblock user from chatting.
FAccelByteTaskWPtr DeleteGroupChat (FString const &GroupId, FString const &ChatId, FVoidHandler const &OnSuccess, FErrorHandler const &OnError)
 Delete a message from group chat (used by group moderator).
FAccelByteTaskWPtr MuteGroupUserChat (FString const &GroupId, FString const &UserId, int32 DurationInSeconds, FVoidHandler const &OnSuccess, FErrorHandler const &OnError)
 Mute user from group chat (used by group moderator).
FAccelByteTaskWPtr UnmuteGroupUserChat (FString const &GroupId, FString const &UserId, FVoidHandler const &OnSuccess, FErrorHandler const &OnError)
 Unmute user from group chat (used by group moderator).
FAccelByteTaskWPtr GetGroupChatSnapshot (FString const &GroupId, FString const &ChatId, THandler< FAccelByteModelsChatSnapshotResponse > const &OnSuccess, FErrorHandler const &OnError)
 Get chat snapshot (used by group moderator).
FAccelByteTaskWPtr BanGroupUserChat (FString const &GroupId, TArray< FString > const &UserIds, THandler< FAccelByteModelsBanGroupChatResponse > const &OnSuccess, FErrorHandler const &OnError)
 Ban users from group chat (used by group moderator).
FAccelByteTaskWPtr UnbanGroupUserChat (FString const &GroupId, TArray< FString > const &UserIds, THandler< FAccelByteModelsUnbanGroupChatResponse > const &OnSuccess, FErrorHandler const &OnError)
 Unban users from group chat (used by group moderator).
void GetUserChatConfiguration (FGetUserChatConfigurationResponse const &OnSuccess, FErrorHandler const &OnError=nullptr)
 Get chat configuration for current user.
void SetUserChatConfiguration (const FAccelByteModelsSetUserChatConfigurationRequest &Request, FSetUserChatConfigurationResponse const &OnSuccess, FErrorHandler const &OnError=nullptr)
 Set chat configuration for current user.
void SetChatNotifDelegate (FChatNotif const &Delegate)
 Delegate setter for incoming chat message event.
void SetAddToTopicNotifDelegate (FAddRemoveFromTopicNotif const &Delegate)
 Delegate setter for logged in user added to a topic event.
void SetRemoveFromTopicNotifDelegate (FAddRemoveFromTopicNotif const &Delegate)
 Delegate setter for logged in user removed from a topic event.
void SetDeleteTopicNotifDelegate (FDeleteUpdateTopicNotif const &Delegate)
 Delegate setter for when a subscribed topic is deleted.
void SetUpdateTopicNotifDelegate (FDeleteUpdateTopicNotif const &Delegate)
 Delegate setter for when a subscribed topic is updated.
void SetReadChatNotifDelegate (FReadChatNotif const &Delegate)
 Delegate setter for when a subscribed topic's chat has been read by others.
void SetUserBanNotifDelegate (FUserBanUnbanNotif const &Delegate)
 Delegate setter for when user received ban event.
void SetSystemMessageNotifDelegate (FSystemMessageNotif const &Delegate)
 Delegate setter for when user received a System message.
void SetUserUnbanNotifDelegate (FUserBanUnbanNotif const &Delegate)
 Delegate setter for when user received unban event.
void SetUserMutedNotifDelegate (FUserMutedNotif const &Delegate)
 Delegate setter for when user received muted event.
void SetUserUnmutedNotifDelegate (FUserUnmutedNotif const &Delegate)
 Delegate setter for when user received unmuted event.
FAccelByteTaskWPtr GetChatConfig (THandler< FAccelByteModelsChatPublicConfigResponse > const &OnSuccess, FErrorHandler const &OnError)
 Get chat config of a namespace.
Public Member Functions inherited from AccelByte::FApiBase
 FApiBase (Credentials const &InCredentialsRef, Settings const &InSettingsRef, FHttpRetrySchedulerBase &InHttpRef, TSharedPtr< AccelByte::FApiClient, ESPMode::ThreadSafe > const &InApiClient)
 FApiBase (Credentials const &InCredentialsRef, Settings const &InSettingsRef, FHttpRetrySchedulerBase &InHttpRef, FAccelBytePlatformPtr const &InAccelBytePlatform)
void SetApiClient (TSharedPtr< AccelByte::FApiClient, ESPMode::ThreadSafe > const &InApiClient)
Public Member Functions inherited from AccelByte::IWebsocketConfigurableReconnectStrategy
void SetDefaultReconnectionStrategy (const FReconnectionStrategy &Strategy)
FReconnectionStrategyGetDefaultReconnectionStrategy ()
TMap< int32, FReconnectionStrategy > & GetReconnectionStrategyDictionary ()
void SetSpecificReconnectionStrategy (EWebsocketClosureCodeForSpecificRetry WebsocketDisconnectionCode, const FReconnectionStrategy &Strategy)
void SetSpecificReconnectionStrategy (int32 RawWebsocketConnectionCode, const FReconnectionStrategy &Strategy)

Additional Inherited Members

Protected Member Functions inherited from AccelByte::FApiBase
template<typename T>
bool ValidateAccelByteId (FString const &Id, EAccelByteIdHypensRule HypenRule, FString const &ErrorMessage, T const &OnError)
Protected Attributes inherited from AccelByte::FApiBase
TSharedRef< Credentials const, ESPMode::ThreadSafe > CredentialsRef
Settings const & SettingsRef
FHttpRetrySchedulerBaseHttpRef
FHttpClient HttpClient
FAccelBytePlatformPtr AccelBytePlatformPtr

Detailed Description

Chat API for chatting between users Unlike other servers which use HTTP, Chat server uses WebSocket (RFC 6455).

Note
This chat service features more functionality/capacity than the conventional chat in Lobby API

Chat service enables user to send message to other user / group of user. We use topic as wrapper for chat connection. Topic can have two different types:

  1. Personal Topic for bidirectional chat between one user to other user (==2)
  2. Group Topic for chat between multiple user (>2) a. Can be public (join able) and private (not joinable)
    • public : user can join by knowing topic id
    • private: only admin can add or remove member

Member Function Documentation

◆ AddUserToTopic() [1/2]

void AccelByte::Api::Chat::AddUserToTopic ( FAccelByteModelsChatAddUserToTopicRequest const & Request,
FAddRemoveUserFromTopicResponse const & OnSuccess,
FErrorHandler const & OnError = nullptr )

Add a new user to an existing GROUP topic id, only topic admin can use this operation.

Parameters
Request- Parameter request in struct form for adding a user to a group topic
OnSuccess- Callback for successful chat topic user addition response
OnError- Callback for failed chat topic user addition
See also
SetAddToTopicNotifDelegate

◆ AddUserToTopic() [2/2]

void AccelByte::Api::Chat::AddUserToTopic ( FString const & TopicId,
FString const & ToAddUserId,
FAddRemoveUserFromTopicResponse const & OnSuccess,
FErrorHandler const & OnError = nullptr )
inline

Add an user to an existing topic id, only topic admin can use this operation.

Parameters
TopicId- Topic id that will receive the new user
ToAddUserId- User Id that will be added to the topic
OnSuccess- Callback for successful chat topic user addition response
OnError- Callback for failed chat topic user addition
See also
SetAddToTopicNotifDelegate

◆ BanGroupUserChat()

FAccelByteTaskWPtr AccelByte::Api::Chat::BanGroupUserChat ( FString const & GroupId,
TArray< FString > const & UserIds,
THandler< FAccelByteModelsBanGroupChatResponse > const & OnSuccess,
FErrorHandler const & OnError )

Ban users from group chat (used by group moderator).

Parameters
GroupIdId of group from group service.
UserIdsArray of user ids to ban.
OnSuccessCalled when the operation succeeded.
OnErrorCalled when the operation failed.
Returns
AccelByteTask object to track and cancel the ongoing API operation.

◆ BlockUser()

void AccelByte::Api::Chat::BlockUser ( FString const & UserId,
FChatBlockUserResponse const & OnSuccess,
FErrorHandler const & OnError = nullptr )

Block user from chatting.

Parameters
UserId- User ID to block
OnSuccess- Callback for successful block user response
OnError- Callback for failed block user
See also
SetBlockUserResponseDelegate

◆ Connect()

void AccelByte::Api::Chat::Connect ( )

Connect to the Chat server via websocket.

Note
You must connect to the server before you can start sending/receiving. Also make sure you have logged in first as this operation requires access token.

◆ CreateGroupTopic() [1/2]

void AccelByte::Api::Chat::CreateGroupTopic ( FAccelByteModelsChatCreateTopicRequest const & Request,
FChatActionTopicResponse const & OnSuccess,
FErrorHandler const & OnError = nullptr )

Create a chat topic between multiple users (chat members > 2). Deprecated.

Parameters
Request- Parameter request in struct form for creating a group topic
OnSuccess- Callback for successful chat topic creation response
OnError- Callback for failed chat topic creation
See also
SetAddToTopicNotifDelegate

◆ CreateGroupTopic() [2/2]

void AccelByte::Api::Chat::CreateGroupTopic ( TSet< FString > const & Users,
TSet< FString > const & Admins,
FString const & TopicName,
bool bIsJoinable,
FChatActionTopicResponse const & OnSuccess,
FErrorHandler const & OnError = nullptr )
inline

Create a chat topic between multiple users (chat members > 2). Deprecated.

Parameters
Users- UserIds to be added to the chat topic, self/logged in user is automatically added as first user
Admins- UserIds to be added to the chat topic as admin , self/logged in user is automatically added as admin
TopicName- Friendly name of the chat topic (alias)
bIsJoinable- Whether new user can join this group topic without invitation from admin
OnSuccess- Callback for successful chat topic creation response
OnError- Callback for failed chat topic creation
See also
SetAddToTopicNotifDelegate

◆ CreatePersonalTopic()

void AccelByte::Api::Chat::CreatePersonalTopic ( FString const & TargetUserId,
FChatActionTopicResponse const & OnSuccess,
FErrorHandler const & OnError = nullptr )

Create a personal chat topic between logged in user and a TargetUserid (chat members == 2).

Parameters
TargetUserId- User id for 2nd member of the personal chat topic (1st member is self/logged in user)
OnSuccess- Callback for successful chat topic creation response
OnError- Callback for failed chat topic creation
See also
SetAddToTopicNotifDelegate

◆ DECLARE_DELEGATE_OneParam() [1/3]

AccelByte::Api::Chat::DECLARE_DELEGATE_OneParam ( FGetSystemMessageStatsResponse ,
FAccelByteGetSystemMessageStatsResponse const &  )

Delegate for handling get system message stats response.

◆ DECLARE_DELEGATE_OneParam() [2/3]

AccelByte::Api::Chat::DECLARE_DELEGATE_OneParam ( FGetUserChatConfigurationResponse ,
FAccelByteModelsGetUserChatConfigurationResponse const &  )

Delegate for handling get user chat configuration response.

◆ DECLARE_DELEGATE_OneParam() [3/3]

AccelByte::Api::Chat::DECLARE_DELEGATE_OneParam ( FSetUserChatConfigurationResponse ,
FAccelByteSetUserChatConfigurationResponse const &  )

Delegate for handling set user chat configuration response.

◆ DeleteGroupChat()

FAccelByteTaskWPtr AccelByte::Api::Chat::DeleteGroupChat ( FString const & GroupId,
FString const & ChatId,
FVoidHandler const & OnSuccess,
FErrorHandler const & OnError )

Delete a message from group chat (used by group moderator).

Parameters
GroupIdId of group from group service.
ChatIdId of message to delete.
OnSuccessCalled when the operation succeeded.
OnErrorCalled when the operation failed.
Returns
AccelByteTask object to track and cancel the ongoing API operation.

◆ DeleteSystemMessages()

void AccelByte::Api::Chat::DeleteSystemMessages ( TSet< FString > const & MessageIds,
FDeleteSystemMessagesResponse const & OnSuccess,
FErrorHandler const & OnError = nullptr )

Delete system message(s) in user system inbox.

Parameters
MessageIds- Array of system message id
OnSuccess- Callback for successful deleted system message(s) in user system inbox
OnError- Callback for failed deleted system message(s) in user system inbox

◆ DeleteTopic()

void AccelByte::Api::Chat::DeleteTopic ( FString const & ToDeleteGroupTopicId,
FChatActionTopicResponse const & OnSuccess,
FErrorHandler const & OnError = nullptr )

Delete the group topic id, only topic admin can use this operation. PERSONAL topic cannot be deleted.

Parameters
ToDeleteGroupTopicId- Group Topic id that will be deleted. PERSONAL topic cannot be deleted
OnSuccess- Callback for successful group chat topic deletion response
OnError- Callback for failed chat topic deletion
See also
SetDeleteTopicNotifDelegate

◆ Disconnect()

void AccelByte::Api::Chat::Disconnect ( bool ForceCleanup = false)

Disconnect from server if and only if the you have connected to server. If not currently connected, then this does nothing.

Parameters
ForceCleanupboolean flag to forcefully cleanup the WebSocket connection

◆ GetChatConfig()

FAccelByteTaskWPtr AccelByte::Api::Chat::GetChatConfig ( THandler< FAccelByteModelsChatPublicConfigResponse > const & OnSuccess,
FErrorHandler const & OnError )

Get chat config of a namespace.

Parameters
OnSuccessCalled when the operation succeeded.
OnErrorCalled when the operation failed.
Returns
AccelByteTask object to track and cancel the ongoing API operation.

◆ GetGroupChatSnapshot()

FAccelByteTaskWPtr AccelByte::Api::Chat::GetGroupChatSnapshot ( FString const & GroupId,
FString const & ChatId,
THandler< FAccelByteModelsChatSnapshotResponse > const & OnSuccess,
FErrorHandler const & OnError )

Get chat snapshot (used by group moderator).

Parameters
GroupIdId of group from group service.
ChatIdId of message.
OnSuccessCalled when the operation succeeded.
OnErrorCalled when the operation failed.
Returns
AccelByteTask object to track and cancel the ongoing API operation.

◆ GetSystemMessageStats()

void AccelByte::Api::Chat::GetSystemMessageStats ( FGetSystemMessageStatsResponse const & OnSuccess,
FErrorHandler const & OnError,
FAccelByteGetSystemMessageStatsRequest const & Request = {} )

Get system message stats (number of unread messages and date time of oldest unread message)

Parameters
OnSuccess- Callback for successful get system message stats
OnError- Callback for failed get system message stats
Request- Optional request parameters

◆ GetUserChatConfiguration()

void AccelByte::Api::Chat::GetUserChatConfiguration ( FGetUserChatConfigurationResponse const & OnSuccess,
FErrorHandler const & OnError = nullptr )

Get chat configuration for current user.

Parameters
OnSuccess- Callback for successful get user chat configuration.
OnError- Callback for failed get user chat configuration.

◆ IsConnected()

bool AccelByte::Api::Chat::IsConnected ( ) const

Check whether the websocket is currently connected to the Chat server.

Returns
true if it's connected, false otherwise.

◆ IsReconnecting()

bool AccelByte::Api::Chat::IsReconnecting ( ) const

Check whether the websocket is currently trying to reconnect to the Chat server.

Returns
true if it's connected, false otherwise.

◆ JoinTopic()

void AccelByte::Api::Chat::JoinTopic ( FString const & TopicId,
FChatActionTopicResponse const & OnSuccess,
FErrorHandler const & OnError = nullptr )

Join a joinable group topic.

Parameters
TopicId- Joinable group topic id
OnSuccess- Callback for successful join
OnError- Callback for failed join
See also
SetJoinTopicResponseDelegate

◆ MuteGroupUserChat()

FAccelByteTaskWPtr AccelByte::Api::Chat::MuteGroupUserChat ( FString const & GroupId,
FString const & UserId,
int32 DurationInSeconds,
FVoidHandler const & OnSuccess,
FErrorHandler const & OnError )

Mute user from group chat (used by group moderator).

Parameters
GroupIdId of group from group service.
UserIdId of the user to be muted.
DurationInSecondsDuration of mute in seconds.
OnSuccessCalled when the operation succeeded.
OnErrorCalled when the operation failed.
Returns
AccelByteTask object to track and cancel the ongoing API operation.

◆ QueryChat() [1/2]

void AccelByte::Api::Chat::QueryChat ( FAccelByteModelsChatQueryChatRequest const & Request,
FQueryChatResponse const & OnSuccess,
FErrorHandler const & OnError = nullptr )

Query chat messages that are subscribed by the logged in user.

Parameters
OnSuccess- Callback for successful topic query response
OnError- Callback for failed topic query
See also
QueryChat

◆ QueryChat() [2/2]

void AccelByte::Api::Chat::QueryChat ( FString const & TopicId,
int Limit,
FQueryChatResponse const & OnSuccess,
FErrorHandler const & OnError = nullptr )
inline

Query chat messages that are subscribed by the logged in user.

Parameters
TopicId- target topic from which the chats are being queried
Limit- max count of returned results from the most recent
OnSuccess- Callback for successful topic query response
OnError- Callback for failed topic query
See also
QueryChat

◆ QueryGroupTopic() [1/2]

void AccelByte::Api::Chat::QueryGroupTopic ( FAccelByteModelsChatQueryTopicRequest const & Request,
FQueryTopicResponse const & OnSuccess,
FErrorHandler const & OnError = nullptr )

Query GROUP chat topics that the logged in user is a member of.

Parameters
Request- Parameter request in struct form
OnSuccess- Callback for successful personal topic query response
OnError- Callback for failed personal topic query
See also
QueryTopicById, QueryPersonalTopic, QueryTopic, QueryChat

◆ QueryGroupTopic() [2/2]

void AccelByte::Api::Chat::QueryGroupTopic ( FString const & Keyword,
int Offset,
int Limit,
FQueryTopicResponse const & OnSuccess,
FErrorHandler const & OnError = nullptr )
inline

Query GROUP chat topics that are subscribed by the logged in user.

if user has sequential 100 topics, 1 is oldest, 100 is most recent result will be returned from most recent. so in this order: 100 - 1

Parameters
Keyword- Friendly name keyword for the topic, e.g. "gg guild"
Offset- Result offset from most recent. e.g. if user has 100 topics, offset 25 means result will start from 75
Limit- Max count of returned results from the most recent e.g. if user has 100 topics, limit 20 will only return the last 20 (100-81)
OnSuccess- Callback for successful group topic query response
OnError- Callback for failed group topic query
See also
QueryTopicById, QueryGroupTopic, QueryPersonalTopic, QueryPublicTopic, QueryChat

◆ QueryPersonalTopic()

void AccelByte::Api::Chat::QueryPersonalTopic ( int Offset,
int Limit,
FQueryTopicResponse const & OnSuccess,
FErrorHandler const & OnError = nullptr )

Query PERSONAL chat topics that the logged in user is a member of.

if user has sequential 100 topics, 1 is oldest, 100 is most recent result will be returned from most recent. so in this order: 100 - 1

Parameters
Offset- Result offset from most recent. e.g. if user has 100 topics, offset 25 means result will start from 75
Limit- Max count of returned results from the most recent e.g. if user has 100 topics, limit 20 will only return the last 20 (100-81)
OnSuccess- Callback for successful personal topic query response
OnError- Callback for failed personal topic query
See also
QueryTopicById, QueryGroupTopic, QueryTopic, QueryPublicTopic, QueryChat

◆ QueryPublicTopic()

void AccelByte::Api::Chat::QueryPublicTopic ( FAccelByteModelsChatQueryTopicRequest const & Request,
FQueryPublicTopicResponse const & OnSuccess,
FErrorHandler const & OnError = nullptr )

Query PUBLIC (joinable) chat topics (server topic / channel).

Parameters
Request- Parameter request in struct form
OnSuccess- Callback for successful topic query response
OnError- Callback for failed topic query
See also
QueryTopicById, QueryGroupTopic, QueryPersonalTopic, QueryTopic, QueryChat

◆ QuerySystemMessage()

void AccelByte::Api::Chat::QuerySystemMessage ( FQuerySystemMessageResponse const & OnSuccess,
FErrorHandler const & OnError = nullptr,
FQuerySystemMessageOptions const & OptionalParams = {} )

Query system messages in user's system inbox.

Parameters
OnSuccess- Callback for successful deleted system message(s) in user system inbox
OnError- Callback for failed updated system message(s) in user system inbox
OptionalParams- Optional parameters for query inbox message

◆ QueryTopic() [1/2]

void AccelByte::Api::Chat::QueryTopic ( FAccelByteModelsChatQueryTopicRequest const & Request,
FQueryTopicResponse const & OnSuccess,
FErrorHandler const & OnError = nullptr )

Query chat topics (PERSONAL and GROUP, excluding PUBLIC) that are subscribed by the logged in user.

Parameters
Request- Parameter request in struct form
OnSuccess- Callback for successful topic query response
OnError- Callback for failed topic query
See also
QueryTopicById, QueryGroupTopic, QueryPersonalTopic, QueryPublicTopic, QueryChat

◆ QueryTopic() [2/2]

void AccelByte::Api::Chat::QueryTopic ( FString const & Keyword,
int Offset,
int Limit,
FQueryTopicResponse const & OnSuccess,
FErrorHandler const & OnError = nullptr )
inline

Query chat topics (PERSONAL and GROUP, excluding PUBLIC) that are subscribed by the logged in user.

if user has sequential 100 topics, 1 is oldest, 100 is most recent result will be returned from most recent. so in this order: 100 - 1

Parameters
KeywordFriendly name keyword for the topic, only relevant for topic topic and not personal topic e.g. "gg guild"
Offset- Result offset from most recent. e.g. if user has 100 topics, offset 25 means result will start from 75
Limit- Max count of returned results from the most recent e.g. if user has 100 topics, limit 20 will only return the last 20 (100-81)
OnSuccess- Callback for successful topic query response
OnError- Callback for failed topic query
See also
QueryTopicById, QueryGroupTopic, QueryPersonalTopic, QueryPublicTopic, QueryChat

◆ QueryTopicById()

void AccelByte::Api::Chat::QueryTopicById ( FString const & TopicId,
FQueryTopicByIdResponse const & OnSuccess,
FErrorHandler const & OnError = nullptr )

Query chat topics (PERSONAL and GROUP, excluding PUBLIC) that are subscribed by the logged in user By using Id as keyword instead of group name.

Parameters
TopicId- Parameter request in struct form
OnSuccess- Callback for successful topic query response
OnError- Callback for failed topic query
See also
QueryGroupTopic, QueryPersonalTopic, QueryPublicTopic, QueryChat

◆ QuitTopic()

void AccelByte::Api::Chat::QuitTopic ( FString const & TopicId,
FChatActionTopicResponse const & OnSuccess,
FErrorHandler const & OnError = nullptr )

Leave a group topic.

Parameters
TopicId- Group topic id that the logged in user is leaving
OnSuccess- Callback for successful quit
OnError- Callback for failed quit
See also
SetQuitTopicResponseDelegate

◆ ReadChat()

void AccelByte::Api::Chat::ReadChat ( TSet< FString > const & ChatIds,
FReadChatResponse const & OnSuccess,
FErrorHandler const & OnError = nullptr )

Flag the supplied ChatIds as has been read.

Parameters
ChatIds- Chat message Ids to mark as has been read
OnSuccess- Callback for successful topic query response
OnError- Callback for failed topic query
See also
QueryChat

◆ RefreshToken()

FString AccelByte::Api::Chat::RefreshToken ( FString const & AccessToken,
FChatRefreshTokenResponse const & OnSuccess,
FErrorHandler const & OnError = nullptr )

Refresh access token used in chat.

Parameters
AccessTokennew access token to be used in chat
OnSuccessdelegate to be triggered when operation success
OnErrordelegate to be triggered when operation error
Returns
TBA

◆ RemoveUserFromTopic() [1/2]

void AccelByte::Api::Chat::RemoveUserFromTopic ( FAccelByteModelsChatRemoveUserFromTopicRequest const & Request,
FAddRemoveUserFromTopicResponse const & OnSuccess,
FErrorHandler const & OnError = nullptr )

Remove an user from an existing topic id, only topic admin can use this operation.

Parameters
Request- Parameter request in struct form for removing an existing member from a group topic
OnSuccess- Callback for successful chat topic user removal response
OnError- Callback for failed chat topic user removal
See also
SetRemoveFromTopicNotifDelegate

◆ RemoveUserFromTopic() [2/2]

void AccelByte::Api::Chat::RemoveUserFromTopic ( FString const & TopicId,
FString const & ToRemoveUserId,
FAddRemoveUserFromTopicResponse const & OnSuccess,
FErrorHandler const & OnError = nullptr )
inline

Remove an user from an existing topic id, only topic admin can use this operation.

Parameters
TopicId- Topic id that will remove an existing user
ToRemoveUserId- User Id that will be removed from the topic
OnSuccess- Callback for successful chat topic user removal response
OnError- Callback for failed chat topic user removal
See also
SetRemoveFromTopicNotifDelegate

◆ SendChat()

void AccelByte::Api::Chat::SendChat ( FString const & TopicId,
FString const & Message,
FSendChatResponse const & OnSuccess,
FErrorHandler const & OnError = nullptr )

Create a personal chat topic between logged in user and a TargetUserid (chat members == 2).

Parameters
TopicId- a chat topic's topic id as chat destination
Message- Chat message to be send
OnSuccess- Callback for successful sent chat response
OnError- Callback for failed sent chat
See also
CreatePersonalTopic, CreateGroupTopic, SetChatNotifDelegate, SetReadChatNotifDelegate

◆ SetConnectFailedDelegate()

void AccelByte::Api::Chat::SetConnectFailedDelegate ( FErrorHandler const & OnConnectError)
inline

Delegate setter for chat websocket connection failure event.

Parameters
OnConnectErrorCallback delegate when failed connecting to Chat Websocket.

◆ SetConnectionClosedDelegate()

void AccelByte::Api::Chat::SetConnectionClosedDelegate ( FChatConnectionClosed const & OnConnectionClosed)
inline

Delegate setter for chat websocket connection closed event (connection closed by peer).

Parameters
OnConnectionClosedCallback delegate when connection closed from Chat Websocket.

◆ SetConnectSuccessDelegate()

void AccelByte::Api::Chat::SetConnectSuccessDelegate ( FChatConnectSuccess const & OnConnectSuccess)
inline

Delegate setter for chat websocket connection success event.

Parameters
OnConnectSuccessCallback delegate when successfully connected to Chat Websocket.

◆ SetDisconnectNotifDelegate()

void AccelByte::Api::Chat::SetDisconnectNotifDelegate ( FChatDisconnectNotif const & OnDisconnectNotif)
inline

Delegate setter for chat websocket disconnected event.

Parameters
OnDisconnectNotifNotification Delegate when disconnected from Chat Websocket.

◆ SetUserChatConfiguration()

void AccelByte::Api::Chat::SetUserChatConfiguration ( const FAccelByteModelsSetUserChatConfigurationRequest & Request,
FSetUserChatConfigurationResponse const & OnSuccess,
FErrorHandler const & OnError = nullptr )

Set chat configuration for current user.

Parameters
Request- The chat configuration.
OnSuccess- Callback for successful set user chat configuration.
OnError- Callback for failed set user chat configuration.

◆ UnbanGroupUserChat()

FAccelByteTaskWPtr AccelByte::Api::Chat::UnbanGroupUserChat ( FString const & GroupId,
TArray< FString > const & UserIds,
THandler< FAccelByteModelsUnbanGroupChatResponse > const & OnSuccess,
FErrorHandler const & OnError )

Unban users from group chat (used by group moderator).

Parameters
GroupIdId of group from group service.
UserIdsArray of user ids to unban.
OnSuccessCalled when the operation succeeded.
OnErrorCalled when the operation failed.
Returns
AccelByteTask object to track and cancel the ongoing API operation.

◆ UnblockUser()

void AccelByte::Api::Chat::UnblockUser ( FString const & UserId,
FChatUnblockUserResponse const & OnSuccess,
FErrorHandler const & OnError = nullptr )

Unblock user from chatting.

Parameters
UserId- User ID to unblock
OnSuccess- Callback for successful block user response
OnError- Callback for failed Unblock user
See also
SetUnblockUserResponseDelegate

◆ UnmuteGroupUserChat()

FAccelByteTaskWPtr AccelByte::Api::Chat::UnmuteGroupUserChat ( FString const & GroupId,
FString const & UserId,
FVoidHandler const & OnSuccess,
FErrorHandler const & OnError )

Unmute user from group chat (used by group moderator).

Parameters
GroupIdId of group from group service.
UserIdId of the user to be un-muted.
OnSuccessCalled when the operation succeeded.
OnErrorCalled when the operation failed.
Returns
AccelByteTask object to track and cancel the ongoing API operation.

◆ UpdateSystemMessages()

void AccelByte::Api::Chat::UpdateSystemMessages ( TArray< FAccelByteModelsActionUpdateSystemMessage > const & ActionUpdateSystemMessages,
FUpdateSystemMessagesResponse const & OnSuccess,
FErrorHandler const & OnError = nullptr )

Update system message(s) in user system inbox.

Parameters
ActionUpdateSystemMessages- Array of ActionUpdateSystemMessage containing action to mark read/unread and keep
OnSuccess- Callback for successful deleted system message(s) in user system inbox
OnError- Callback for failed updated system message(s) in user system inbox

◆ UpdateTopic() [1/2]

void AccelByte::Api::Chat::UpdateTopic ( FAccelByteModelsChatUpdateTopicRequest const & Request,
FChatActionTopicResponse const & OnSuccess,
FErrorHandler const & OnError = nullptr )

Update the topic information, only topic admin can use this operation.

Parameters
Request- Parameter request in struct form for updating a group topic
OnSuccess- Callback for successful chat topic update response
OnError- Callback for failed chat topic update
See also
SetUpdateTopicNotifDelegate

◆ UpdateTopic() [2/2]

void AccelByte::Api::Chat::UpdateTopic ( FString const & TopicId,
FString const & NewFriendlyTopicName,
bool bIsJoinable,
FChatActionTopicResponse const & OnSuccess,
FErrorHandler const & OnError = nullptr )
inline

Update the topic information, only topic admin can use this operation.

Parameters
TopicId- To update topic id
NewFriendlyTopicName- new alias for the topic id
bIsJoinable- Whether new user can join this group topic without invitation from admin
OnSuccess- Callback for successful chat topic update response
OnError- Callback for failed chat topic update
See also
SetUpdateTopicNotifDelegate