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

#include <SBDGroupChannel.h>

Inheritance diagram for SBDGroupChannel:
SBDBaseChannel

Public Member Functions

void UpdateChannel (const std::wstring &name, bool is_distinct, const std::wstring &cover_url, const std::wstring &data, const std::wstring &custom_type, std::function< void(SBDGroupChannel *, SBDError *)> completion_handler)
 
void UpdateChannel (const std::wstring &name, bool is_distinct, const std::wstring &cover_image_file_path, const std::wstring &file_mime_type, const std::wstring &data, const std::wstring &custom_type, std::function< void(SBDGroupChannel *, SBDError *)> completion_handler)
 
void DeleteChannel (std::function< void(SBDError *)> completion_handler)
 
void RefreshChannel (std::function< void(SBDError *)> completion_handler)
 
void InviteUsers (const std::vector< SBDUser > &users, std::function< void(SBDError *)> completion_handler)
 
void HideChannel (bool hide_prev_messages, std::function< void(SBDError *)> completion_handler)
 
void HideChannel (bool hide_prev_messages, bool allow_auto_unhide, std::function< void(SBDError *)> completion_handler)
 
void UnhideChannel (std::function< void(SBDError *)> completion_handler)
 
void JoinChannel (std::function< void(SBDError *)> completion_handler)
 
void LeaveChannel (std::function< void(SBDError *)> completion_handler)
 
void MarkAsRead ()
 
int GetReadReceipt (SBDBaseMessage *message)
 
int64_t GetLastSeenAt (const SBDUser &user)
 
std::vector< SBDMemberGetReadMembers (SBDBaseMessage *message)
 
std::vector< SBDMemberGetUnreadMembers (SBDBaseMessage *message)
 
std::map< std::wstring, SBDReadStatusGetReadStatus ()
 
bool HasMember (const std::wstring &user_id)
 
SBDMember GetMember (const std::wstring &user_id, bool *member_exist)
 
void AcceptInvitation (std::function< void(SBDError *)> completion_handler)
 
void DeclineInvitation (std::function< void(SBDError *)> completion_handler)
 
void ResetMyHistory (std::function< void(SBDError *)> completion_handler)
 
const SBDBaseMessageGetLastMessage ()
 
- 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 void CreateChannel (std::vector< std::wstring > user_ids, const std::wstring &name, bool is_distinct, const std::wstring &cover_url, const std::wstring &data, const std::wstring &custom_type, std::function< void(SBDGroupChannel *, SBDError *)> completion_handler)
 
static void CreateChannel (const std::vector< std::wstring > user_ids, const std::wstring &name, bool is_distinct, const std::wstring &cover_image_file_path, const std::wstring &file_mime_type, const std::wstring &data, const std::wstring &custom_type, std::function< void(SBDGroupChannel *, SBDError *)> completion_handler)
 
static void CreateChannel (SBDGroupChannelParams &params, std::function< void(SBDGroupChannel *, SBDError *)> completion_handler)
 
static SBDGroupChannelListQueryCreateMyGroupChannelListQuery ()
 
static void GetChannelFromServer (const std::wstring &channel_url, std::function< void(SBDGroupChannel *, SBDError *)> completion_handler)
 
static void GetChannel (const std::wstring &channel_url, std::function< void(SBDGroupChannel *, SBDError *)> completion_handler)
 
static void MarkAllAsRead (std::function< void(SBDError *)> completion_handler)
 
static void GetChannelCount (SBDMemberStateFilter member_state_filter, std::function< void(uint64_t group_chanel_count, SBDError *error)> completion_handler)
 

Public Attributes

int64_t last_message_id
 
bool is_distinct
 
bool is_public
 
uint64_t unread_message_count
 
std::vector< SBDMembermembers
 
uint64_t member_count
 
SBDUser inviter
 
bool has_inviter
 
bool is_hidden
 
SBDGroupChannelHiddenState hidden_state
 
- 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 SBDGroupChannel class represents a group channel which is a private chat. The user who wants to join the group channel has to be invited by another user who is already joined the channel. This class is derived from SBDBaseChannel. If the SBDChannelHandler is added, the user will automatically receive all messages from the group channels where the user belongs after connection. The SBDGroupChannel provides the features of general messaging apps.

The SBDGroupChannel has a special property, is_distinct. The distinct property enabled group channel is always reuesd for same channel members. If a new member gets invited or the member left from the channel, then the distinct property disabled automatically. If you don't set distinct property on the channel, it always create new channel for the same members.

For more information, see Group Channel.

Member Function Documentation

◆ AcceptInvitation()

void SBDGroupChannel::AcceptInvitation ( std::function< void(SBDError *)>  completion_handler)

Accpets the invitation.

Parameters
completion_handlerThe handler interface to execute.

◆ CreateChannel() [1/3]

static void SBDGroupChannel::CreateChannel ( const std::vector< std::wstring >  user_ids,
const std::wstring &  name,
bool  is_distinct,
const std::wstring &  cover_image_file_path,
const std::wstring &  file_mime_type,
const std::wstring &  data,
const std::wstring &  custom_type,
std::function< void(SBDGroupChannel *, SBDError *)>  completion_handler 
)
static

Create a group channel with user IDs with cover image file. The group channel is distinct.

Parameters
user_idsThe user IDs to be members of the channel.
nameThe name of group channel.
is_distinctIf true, the channel which has the same users is returned.
cover_image_file_pathThe cover image file path of group channel.
file_mime_typeThe file mime type.
dataThe custom data of group channel.
custom_typeThe custom type of group channel.
completion_handlerThe handler interface to execute.

◆ CreateChannel() [2/3]

static void SBDGroupChannel::CreateChannel ( SBDGroupChannelParams params,
std::function< void(SBDGroupChannel *, SBDError *)>  completion_handler 
)
static

Create a group channel with GroupChannelParams.

Parameters
paramsGroupChannelParams.
completion_handlerThe handler interface to execute.
Since
3.0.3

◆ CreateChannel() [3/3]

static void SBDGroupChannel::CreateChannel ( std::vector< std::wstring >  user_ids,
const std::wstring &  name,
bool  is_distinct,
const std::wstring &  cover_url,
const std::wstring &  data,
const std::wstring &  custom_type,
std::function< void(SBDGroupChannel *, SBDError *)>  completion_handler 
)
static

Create a group channel with user IDs. The group channel is distinct.

Parameters
user_idsThe user IDs to be members of the channel.
nameThe name of group channel.
is_distinctIf true, the channel which has the same users is returned.
cover_urlThe cover image url of group channel.
dataThe custom data of group channel.
custom_typeThe custom type of group channel.
completion_handlerThe handler interface to execute.

◆ CreateMyGroupChannelListQuery()

static SBDGroupChannelListQuery * SBDGroupChannel::CreateMyGroupChannelListQuery ( )
static

Creates a query for my group channel list.

Returns
SBDGroupChannelListQuery instance for the current user.

◆ DeclineInvitation()

void SBDGroupChannel::DeclineInvitation ( std::function< void(SBDError *)>  completion_handler)

Declines the invitation.

Parameters
completion_handlerThe handler interface to execute.

◆ DeleteChannel()

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

Deletes this GroupChannel. 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

◆ GetChannel()

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

Gets a group channel instance from channel URL asynchronously.

Parameters
channel_urlThe channel URL.
completion_handlerThe handler interface to execute.

◆ GetChannelCount()

static void SBDGroupChannel::GetChannelCount ( SBDMemberStateFilter  member_state_filter,
std::function< void(uint64_t group_chanel_count, SBDError *error)>  completion_handler 
)
static

Gets the group channel count.

Parameters
member_state_filterThe member state of the current user in the channels that are counted.
completion_handlerThe handler interface to execute.

◆ GetChannelFromServer()

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

Gets a group channel instance with channel URL from server asynchronously.

Parameters
channel_urlThe channel URL.
completion_handlerThe handler interface to execute.

◆ GetLastMessage()

const SBDBaseMessage * SBDGroupChannel::GetLastMessage ( )

Gets the last message of this channel. If there is not the last message, nullptr will be returned.

Returns
The last message object.

◆ GetLastSeenAt()

int64_t SBDGroupChannel::GetLastSeenAt ( const SBDUser user)

Returns the timestamp of the last seen at the channel by user.

Parameters
userThe user
Returns
the timestamp of the last seen at.

◆ GetMember()

SBDMember SBDGroupChannel::GetMember ( const std::wstring &  user_id,
bool *  member_exist 
)

Gets member in the channel.

Parameters
user_idUser ID.
member_existIf the member exists, it is true.
Returns
SBDUser object as a member.

◆ GetReadMembers()

std::vector< SBDMember > SBDGroupChannel::GetReadMembers ( SBDBaseMessage message)

Returns the members who read the message.

Parameters
messageThe message.
Returns
Members who read the message.

◆ GetReadReceipt()

int SBDGroupChannel::GetReadReceipt ( SBDBaseMessage message)

Returns how many members haven't been read the given message yet.

Parameters
messageThe message.
Returns
Number of unread member count. Zero if all members read the message.

◆ GetReadStatus()

std::map< std::wstring, SBDReadStatus > SBDGroupChannel::GetReadStatus ( )

Returns the read status.

Returns
The read status. If there's no data, it will be empty.

◆ GetUnreadMembers()

std::vector< SBDMember > SBDGroupChannel::GetUnreadMembers ( SBDBaseMessage message)

Returns the members who didn't read the message.

Parameters
messageThe message.
Returns
Members who don't read the message.

◆ HasMember()

bool SBDGroupChannel::HasMember ( const std::wstring &  user_id)

Checks if the channel has a member that has user_id.

Parameters
user_idUser ID.
Returns
If true, the channel has the member.

◆ HideChannel() [1/2]

void SBDGroupChannel::HideChannel ( bool  hide_prev_messages,
bool  allow_auto_unhide,
std::function< void(SBDError *)>  completion_handler 
)

Hides the group channel with the auto unhide option. The channel will be hid from the channel list. If the allowAutoUnhide is YES, the channel will be appeared again when the other user send a message in the channel. However, if the allowAutoUnhide is NO, the channel will be appeared by UnhideChannel method.

◆ HideChannel() [2/2]

void SBDGroupChannel::HideChannel ( bool  hide_prev_messages,
std::function< void(SBDError *)>  completion_handler 
)

Hides the group channel. The channel will be hid from the channel list, but it will be appeared again when the other user send a message in the channel.

Parameters
hide_prev_messagesThe option to hide the previous message of this channel when the channel will be appeared again.
completion_handlerThe handler interface to execute.

◆ InviteUsers()

void SBDGroupChannel::InviteUsers ( const std::vector< SBDUser > &  users,
std::function< void(SBDError *)>  completion_handler 
)

Invites multiple users to the group channel.

Parameters
usersThe users to be invited.
completion_handlerThe handler interface to execute.

◆ JoinChannel()

void SBDGroupChannel::JoinChannel ( std::function< void(SBDError *)>  completion_handler)

Joins the group channel if this channel is public.

Since
3.0.3

◆ LeaveChannel()

void SBDGroupChannel::LeaveChannel ( std::function< void(SBDError *)>  completion_handler)

Leaves the group channel. The channel will be disappeared from the channel list. If join the channel, the invitation is required.

Parameters
completion_handlerThe handler block to execute.

◆ MarkAllAsRead()

static void SBDGroupChannel::MarkAllAsRead ( std::function< void(SBDError *)>  completion_handler)
static

Marks as read all group channels of the current user.

Parameters
completion_handlerThe handler interface to execute.

◆ MarkAsRead()

void SBDGroupChannel::MarkAsRead ( )

Sends mark as read. The other members in the channel will receive an event. The event will be received in ReadReceiptUpdated() of SBDChannelHandler.

◆ RefreshChannel()

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

Refreshes this channel instance.

Parameters
completion_handlerThe handler interface to execute.

◆ ResetMyHistory()

void SBDGroupChannel::ResetMyHistory ( std::function< void(SBDError *)>  completion_handler)

Resets the history in this channel.

Parameters
completion_handlerThe handler block to execute.

◆ UnhideChannel()

void SBDGroupChannel::UnhideChannel ( std::function< void(SBDError *)>  completion_handler)

Unhides the group channel.

Parameters
completion_handlerThe handler interface to execute.

◆ UpdateChannel() [1/2]

void SBDGroupChannel::UpdateChannel ( const std::wstring &  name,
bool  is_distinct,
const std::wstring &  cover_image_file_path,
const std::wstring &  file_mime_type,
const std::wstring &  data,
const std::wstring &  custom_type,
std::function< void(SBDGroupChannel *, SBDError *)>  completion_handler 
)

Updates a group channel with file path.

Parameters
nameThe name of group channel.
is_distinctIf true, the channel which has the same users is returned.
cover_image_file_pathThe cover image file path of group channel.
file_mime_typeThe file mime type.
dataThe custom data of group channel.
custom_typeThe custom type of group channel.
completion_handlerThe handler interface to execute.

◆ UpdateChannel() [2/2]

void SBDGroupChannel::UpdateChannel ( const std::wstring &  name,
bool  is_distinct,
const std::wstring &  cover_url,
const std::wstring &  data,
const std::wstring &  custom_type,
std::function< void(SBDGroupChannel *, SBDError *)>  completion_handler 
)

Updates a group channel.

Parameters
nameThe name of group channel.
is_distinctIf true, the channel which has the same users is returned.
cover_urlThe cover image url of group channel.
dataThe custom data of group channel.
custom_typeThe custom type of group channel.
completion_handlerThe handler interface to execute.

Member Data Documentation

◆ has_inviter

bool SBDGroupChannel::has_inviter

If there is a inviter, true.

◆ hidden_state

SBDGroupChannelHiddenState SBDGroupChannel::hidden_state

The hidden state

◆ inviter

SBDUser SBDGroupChannel::inviter

The inviter.

◆ is_distinct

bool SBDGroupChannel::is_distinct

Represents the channel is distinct or not.

◆ is_hidden

bool SBDGroupChannel::is_hidden

Checks this channel is hidden

◆ is_public

bool SBDGroupChannel::is_public

Represents the channel is public or not.

Since
3.0.3

◆ last_message_id

int64_t SBDGroupChannel::last_message_id

The Last message's ID of the channel.

◆ member_count

uint64_t SBDGroupChannel::member_count

The number of members.

◆ members

std::vector<SBDMember> SBDGroupChannel::members

Channel members.

◆ unread_message_count

uint64_t SBDGroupChannel::unread_message_count

Unread message count of the channel.