Sendbird Chat SDK for Unreal
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
SBDOpenChannel Class Referencefinal

#include <SBDOpenChannel.h>

Inheritance diagram for SBDOpenChannel:
SBDBaseChannel

Public Member Functions

void UpdateChannel (const std::wstring &new_name, const std::wstring &new_cover_url, const std::wstring &new_data, const std::vector< std::wstring > &new_operator_user_ids, const std::wstring &new_custom_type, std::function< void(SBDOpenChannel *, SBDError *)> completion_handler)
 
void UpdateChannel (const std::wstring &new_name, const std::wstring &new_cover_image_file_path, const std::wstring &new_cover_file_mime_type, const std::wstring &new_data, const std::vector< std::wstring > &new_operator_user_ids, const std::wstring &new_custom_type, std::function< void(SBDOpenChannel *, SBDError *)> completion_handler)
 
void DeleteChannel (std::function< void(SBDError *)> completion_handler)
 
void Enter (std::function< void(SBDError *)> completion_handler)
 
void Exit (std::function< void(SBDError *)> completion_handler)
 
SBDUserListQueryCreateParticipantListQuery ()
 
SBDUserListQueryCreateMutedUserListQuery ()
 
SBDUserListQueryCreateBannedUserListQuery ()
 
void RefreshChannel (std::function< void(SBDError *)> completion_handler)
 
void BanUser (const SBDUser &user, int seconds, std::function< void(SBDError *)> completion_handler)
 
void UnbanUser (const SBDUser &user, std::function< void(SBDError *)> completion_handler)
 
void MuteUser (const SBDUser &user, std::function< void(SBDError *)> completion_handler)
 
void UnmuteUser (const SBDUser &user, std::function< void(SBDError *)> completion_handler)
 
bool IsOperator (const SBDUser &user)
 
- Public Member Functions inherited from SBDBaseChannel
SBDUserMessageSendUserMessage (SBDUserMessageParams &params, std::function< void(SBDUserMessage *, SBDError *)> completion_handler)
 
SBDFileMessageSendFileMessage (const char *file_buf, const std::wstring &filename, int64_t size, const std::wstring &type, std::vector< SBDThumbnailSize > thumbnail_sizes, const std::wstring &data, const std::wstring &custom_type, std::function< void(SBDFileMessage *, SBDError *)> completion_handler)
 
SBDFileMessageSendFileMessage (SBDFileMessageParams &params, std::function< void(SBDFileMessage *, SBDError *)> completion_handler)
 
void DeleteMessage (SBDBaseMessage *message, std::function< void(SBDError *)> completion_handler)
 
void UpdateUserMessage (SBDUserMessage *message, const std::wstring &message_text, const std::wstring &data, const std::wstring &custom_type, std::function< void(SBDUserMessage *, SBDError *)> completion_handler)
 
void UpdateFileMessage (SBDFileMessage *message, const std::wstring &data, const std::wstring &custom_type, std::function< void(SBDFileMessage *, SBDError *)> completion_handler)
 
SBDPreviousMessageListQueryCreatePreviousMessageListQuery ()
 
void CreateMetaCounters (const std::map< std::wstring, int64_t > &meta_counters, std::function< void(const std::map< std::wstring, int64_t > &meta_counters, SBDError *)> completion_handler)
 
void GetMetaCounters (const std::vector< std::wstring > &keys, std::function< void(const std::map< std::wstring, int64_t > &meta_counters, SBDError *)> completion_handler)
 
void GetAllMetaCounters (std::function< void(const std::map< std::wstring, int64_t > &meta_counters, SBDError *)> completion_handler)
 
void UpdateMetaCounters (const std::map< std::wstring, int64_t > &meta_counters, std::function< void(const std::map< std::wstring, int64_t > &meta_counters, SBDError *)> completion_handler)
 
void IncreaseMetaCounters (const std::map< std::wstring, int64_t > &meta_counters, std::function< void(const std::map< std::wstring, int64_t > &meta_counters, SBDError *)> completion_handler)
 
void DecreaseMetaCounters (const std::map< std::wstring, int64_t > &meta_counters, std::function< void(const std::map< std::wstring, int64_t > &meta_counters, SBDError *)> completion_handler)
 
void DeleteMetaCounter (const std::wstring &key, std::function< void(SBDError *)> completion_handler)
 
void DeleteAllMetaCounters (std::function< void(SBDError *)> completion_handler)
 
void CreateMetaData (const std::map< std::wstring, std::wstring > &meta_data, std::function< void(const std::map< std::wstring, std::wstring > &meta_data, SBDError *)> completion_handler)
 
void GetMetaData (const std::vector< std::wstring > &keys, std::function< void(const std::map< std::wstring, std::wstring > &meta_data, SBDError *error)> completion_handler)
 
void GetAllMetaData (std::function< void(const std::map< std::wstring, std::wstring > &meta_data, SBDError *error)> completion_handler)
 
void UpdateMetaData (const std::map< std::wstring, std::wstring > &meta_data, std::function< void(const std::map< std::wstring, std::wstring > &meta_data, SBDError *)> completion_handler)
 
void DeleteMetaData (const std::wstring &key, std::function< void(SBDError *)> completion_handler)
 
void DeleteAllMetaData (std::function< void(SBDError *)> completion_handler)
 
void GetNextMessagesByTimestamp (int64_t timestamp, int64_t next_limit, bool reverse, SBDMessageTypeFilter message_type, const std::wstring &custom_type, std::function< void(const std::vector< SBDBaseMessage * > &, SBDError *)> completion_handler)
 
void GetPreviousMessagesByTimestamp (int64_t timestamp, int64_t prev_limit, bool reverse, SBDMessageTypeFilter message_type, const std::wstring &custom_type, std::function< void(const std::vector< SBDBaseMessage * > &, SBDError *)> completion_handler)
 
void GetMessagesByTimestamp (int64_t timestamp, int64_t prev_limit, int64_t next_limit, bool reverse, SBDMessageTypeFilter message_type, const std::wstring &custom_type, std::function< void(const std::vector< SBDBaseMessage * > &, SBDError *)> completion_handler)
 
void GetNextMessagesByMessageId (int64_t message_id, int64_t next_limit, bool reverse, SBDMessageTypeFilter message_type, const std::wstring &custom_type, std::function< void(const std::vector< SBDBaseMessage * > &, SBDError *)> completion_handler)
 
void GetPreviousMessagesByMessageId (int64_t message_id, int64_t prev_limit, bool reverse, SBDMessageTypeFilter message_type, const std::wstring &custom_type, std::function< void(const std::vector< SBDBaseMessage * > &, SBDError *)> completion_handler)
 
void GetMessagesByMessageId (int64_t message_id, int64_t prev_limit, int64_t next_limit, bool reverse, SBDMessageTypeFilter message_type, const std::wstring &custom_type, std::function< void(const std::vector< SBDBaseMessage * > &, SBDError *)> completion_handler)
 
void AddMessageMetaArrayValues (const std::wstring &channel_url, int64_t message_id, const std::map< std::wstring, std::vector< std::wstring > > &key_value, std::function< void(SBDBaseMessage *, SBDError *)> completion_handler)
 
void AddMessageMetaArrayValues (const std::wstring &channel_url, int64_t message_id, const std::vector< SBDMessageMetaArray > &metaarrays, std::function< void(SBDBaseMessage *, SBDError *)> completion_handler)
 
void RemoveMessageMetaArrayValues (const std::wstring &channel_url, int64_t message_id, const std::map< std::wstring, std::vector< std::wstring > > &key_value, std::function< void(SBDBaseMessage *, SBDError *)> completion_handler)
 
void RemoveMessageMetaArrayValues (const std::wstring &channel_url, int64_t message_id, const std::vector< SBDMessageMetaArray > &metaarrays, std::function< void(SBDBaseMessage *, SBDError *)> completion_handler)
 
void DeleteMessageMetaArrayKeys (const std::wstring &channel_url, int64_t message_id, const std::vector< std::wstring > &metaarray_keys, std::function< void(SBDBaseMessage *, SBDError *)> completion_handler)
 
void CreateMessageMetaArrayKeys (const std::wstring &channel_url, int64_t message_id, const std::vector< std::wstring > &metaarray_keys, std::function< void(SBDBaseMessage *, SBDError *)> completion_handler)
 
SBDUserMessageCopyUserMessage (SBDUserMessage *message, SBDBaseChannel *target_channel, std::function< void(SBDUserMessage *, SBDError *)> completion_handler)
 
SBDFileMessageCopyFileMessage (SBDFileMessage *message, SBDBaseChannel *target_channel, std::function< void(SBDFileMessage *, SBDError *)> completion_handler)
 
void AddOperators (const std::vector< std::wstring > &user_ids, std::function< void(SBDError *)> completion_handler)
 
void RemoveOperators (const std::vector< std::wstring > &user_ids, std::function< void(SBDError *)> completion_handler)
 
void RemoveAllOperators (std::function< void(SBDError *)> completion_handler)
 
SBDOperatorListQueryCreateOperatorListQuery ()
 
void Report (SBDReportCategory report_category, std::wstring report_description, std::function< void(SBDError *)> completion_handler)
 
void ReportUser (SBDUser &offending_user, SBDReportCategory report_category, std::wstring report_description, std::function< void(SBDError *)> completion_handler)
 
void ReportMessage (SBDBaseMessage *message, SBDReportCategory report_category, std::wstring report_description, std::function< void(SBDError *)> completion_handler)
 

Static Public Member Functions

static SBDOpenChannelListQueryCreateOpenChannelListQuery ()
 
static void CreateChannel (const std::wstring &name, const std::wstring &channel_url, const std::wstring &cover_url, const std::wstring &data, const std::vector< std::wstring > &operator_user_ids, const std::wstring &custom_type, std::function< void(SBDOpenChannel *, SBDError *)> completion_handler)
 
static void CreateChannel (const std::wstring &name, const std::wstring &channel_url, const std::wstring &cover_image_file_path, const std::wstring &file_mime_type, const std::wstring &data, const std::vector< std::wstring > &operator_user_ids, const std::wstring &custom_type, std::function< void(SBDOpenChannel *, SBDError *)> completion_handler)
 
static void CreateChannel (SBDOpenChannelParams &params, std::function< void(SBDOpenChannel *, SBDError *)> completion_handler)
 
static void GetChannel (const std::wstring &channel_url, std::function< void(SBDOpenChannel *, SBDError *)> completion_handler)
 

Public Attributes

int64_t participant_count
 
std::vector< SBDUseroperators
 
bool is_frozen
 
- Public Attributes inherited from SBDBaseChannel
std::wstring channel_url
 
std::wstring name
 
std::wstring cover_url
 
int64_t created_at
 
std::wstring data
 
std::wstring custom_type
 
bool is_group_channel
 
bool is_open_channel
 

Additional Inherited Members

- Protected Member Functions inherited from SBDBaseChannel
 SBDBaseChannel (const std::string &dict)
 

Detailed Description

The SBDOpenChannel class represents a public chat. This is a channel type which anyone can participate without a permission. It can handle thousands of users in one channel. This channel has participants instead of members of SBDGroupChannel and every participant is always online. A user can be included as an operator when a channel is created. The operator has a permission to mute, unmute, ban and unban participants. The muted user can see the messages in the channel, but can't say anything. The unbanned user can't enter the channel. If a user who is in the channel is banned, the user will be kicked from the channel.

Member Function Documentation

◆ BanUser()

void SBDOpenChannel::BanUser ( const SBDUser user,
int  seconds,
std::function< void(SBDError *)>  completion_handler 
)

Bans a user with the user object.

Parameters
userThe user object.
secondsDuration for ban in seconds.
completion_handlerThe handler interface to execute.

◆ CreateBannedUserListQuery()

SBDUserListQuery * SBDOpenChannel::CreateBannedUserListQuery ( )

Creates a query instance for getting banned user list of the channel instance.

Returns
SBDUserListQuery instance for the banned user list.

◆ CreateChannel() [1/3]

static void SBDOpenChannel::CreateChannel ( const std::wstring &  name,
const std::wstring &  channel_url,
const std::wstring &  cover_image_file_path,
const std::wstring &  file_mime_type,
const std::wstring &  data,
const std::vector< std::wstring > &  operator_user_ids,
const std::wstring &  custom_type,
std::function< void(SBDOpenChannel *, SBDError *)>  completion_handler 
)
static

Updates an open channel with properties.

Parameters
nameThe name of the channel.
channel_urlThe channel URL. If the length of url is zero, channel url will be determined randomly.
cover_image_file_pathThe cover image file path.
file_mime_typeThe file mime type.
dataThe data for channel.
operator_user_idsThe operator userIds of channel.
custom_typeThe custom type for channel.
completion_handlerThe handler interface to execute.

◆ CreateChannel() [2/3]

static void SBDOpenChannel::CreateChannel ( const std::wstring &  name,
const std::wstring &  channel_url,
const std::wstring &  cover_url,
const std::wstring &  data,
const std::vector< std::wstring > &  operator_user_ids,
const std::wstring &  custom_type,
std::function< void(SBDOpenChannel *, SBDError *)>  completion_handler 
)
static

Updates an open channel with properties.

Parameters
nameThe name of the channel.
channel_urlThe channel URL. If the length of url is zero, channel url will be determined randomly.
cover_urlThe cover image URL.
dataThe data for channel.
operator_user_idsThe operator userIds of channel.
custom_typeThe custom type for channel.
completion_handlerThe handler interface to execute.

◆ CreateChannel() [3/3]

static void SBDOpenChannel::CreateChannel ( SBDOpenChannelParams params,
std::function< void(SBDOpenChannel *, SBDError *)>  completion_handler 
)
static

Create a open channel with GroupChannelParams.

Parameters
paramsSBDOpenChannelParams.
completion_handlerThe handler interface to execute.
Since
3.0.37

◆ CreateMutedUserListQuery()

SBDUserListQuery * SBDOpenChannel::CreateMutedUserListQuery ( )

Creates a query instance for getting muted user list of the channel instance.

Returns
SBDUserListQuery instance for the muted user list.

◆ CreateOpenChannelListQuery()

static SBDOpenChannelListQuery * SBDOpenChannel::CreateOpenChannelListQuery ( )
static

Creates a query instance for open channel list.

Returns
The query instance for open channel list.

◆ CreateParticipantListQuery()

SBDUserListQuery * SBDOpenChannel::CreateParticipantListQuery ( )

Creates a query instance for getting participant list of the channel instance.

Returns
SBDUserListQuery instance for the participant list of the channel instance.

◆ DeleteChannel()

void SBDOpenChannel::DeleteChannel ( std::function< void(SBDError *)>  completion_handler)

Deletes an OpenChannel. Note that only operators of a channel are able to delete it or else, an error will be returned to the handler.

Parameters
handlerThe callback handler.
Since
3.0.37

◆ Enter()

void SBDOpenChannel::Enter ( std::function< void(SBDError *)>  completion_handler)

Enters the channel.

Parameters
completion_handlerThe handler interface to execute.

◆ Exit()

void SBDOpenChannel::Exit ( std::function< void(SBDError *)>  completion_handler)

Exits the channel.

Parameters
completion_handlerThe handler interface to execute.

◆ GetChannel()

static void SBDOpenChannel::GetChannel ( const std::wstring &  channel_url,
std::function< void(SBDOpenChannel *, SBDError *)>  completion_handler 
)
static

Gets an open channel instance from channel URL.

Parameters
channel_urlThe channel URL.
completion_handlerThe handler interface to execute.

◆ IsOperator()

bool SBDOpenChannel::IsOperator ( const SBDUser user)

Returns the user is an operator or not.

Parameters
userThe user object.
Returns
If true, the user is an operator.

◆ MuteUser()

void SBDOpenChannel::MuteUser ( const SBDUser user,
std::function< void(SBDError *)>  completion_handler 
)

Mutes auser with the user object.

Parameters
userThe user object.
completion_handlerThe handler block to execute.

◆ RefreshChannel()

void SBDOpenChannel::RefreshChannel ( std::function< void(SBDError *)>  completion_handler)

Refreshes the channel information.

Parameters
completion_handlerThe handler interface to execute.

◆ UnbanUser()

void SBDOpenChannel::UnbanUser ( const SBDUser user,
std::function< void(SBDError *)>  completion_handler 
)

Unbans a user with the user object.

Parameters
userThe user object.
completion_handlerThe handler interface to execute.

◆ UnmuteUser()

void SBDOpenChannel::UnmuteUser ( const SBDUser user,
std::function< void(SBDError *)>  completion_handler 
)

Unmutes a user with the user object.

Parameters
userThe user object.
completion_handlerThe handler block to execute.

◆ UpdateChannel() [1/2]

void SBDOpenChannel::UpdateChannel ( const std::wstring &  new_name,
const std::wstring &  new_cover_image_file_path,
const std::wstring &  new_cover_file_mime_type,
const std::wstring &  new_data,
const std::vector< std::wstring > &  new_operator_user_ids,
const std::wstring &  new_custom_type,
std::function< void(SBDOpenChannel *, SBDError *)>  completion_handler 
)

Updates an open channel.

Parameters
new_nameThe name of the channel.
new_cover_image_file_pathThe cover image file path.
new_cover_file_mime_typeThe file mime type.
new_dataThe data for channel.
new_operator_user_idsThe operator user IDs of channel.
new_custom_typeThe custom type for channel.
completion_handlerThe handler interface to execute.

◆ UpdateChannel() [2/2]

void SBDOpenChannel::UpdateChannel ( const std::wstring &  new_name,
const std::wstring &  new_cover_url,
const std::wstring &  new_data,
const std::vector< std::wstring > &  new_operator_user_ids,
const std::wstring &  new_custom_type,
std::function< void(SBDOpenChannel *, SBDError *)>  completion_handler 
)

Updates an open channel.

Parameters
new_nameThe name of the channel.
new_cover_urlThe cover image URL.
new_dataThe data for channel.
new_operator_user_idsThe operator user IDs of channel.
new_custom_typeThe custom type for channel.
completion_handlerThe handler interface to execute.

Member Data Documentation

◆ is_frozen

bool SBDOpenChannel::is_frozen

The frozen state of this channel.

◆ operators

std::vector<SBDUser> SBDOpenChannel::operators

The operators of this channel.

◆ participant_count

int64_t SBDOpenChannel::participant_count

The number of participants in this channel.