3#ifndef SENDBIRD_SBDGROUPCHANNEL_H_
4#define SENDBIRD_SBDGROUPCHANNEL_H_
6#include "SBDBaseChannel.h"
7#include "SBDBaseMessage.h"
10#include "SBDReadStatus.h"
12#include "SBDGroupChannelListQuery.h"
13#include "SBDGroupChannelParams.h"
18class FSBDGroupChannel;
119 static void CreateChannel(
const std::vector<std::wstring> user_ids,
const std::wstring&
name,
bool is_distinct,
const std::wstring& cover_image_file_path,
120 const std::wstring& file_mime_type,
const std::wstring&
data,
const std::wstring&
custom_type,
218 void HideChannel(
bool hide_prev_messages,
bool allow_auto_unhide, std::function<
void(
SBDError*)> completion_handler);
338 std::function<
void(uint64_t group_chanel_count,
SBDError* error)> completion_handler);
348 int64_t last_start_typing_ts;
349 int64_t last_end_typing_ts;
350 int64_t last_manual_mark_as_read_ts;
351 std::map<std::wstring, SBDMember> member_map;
352 static std::mutex member_mutex;
353 std::map<std::wstring, int64_t> cached_read_receipt_status;
354 std::map<std::wstring, int64_t> cached_typing_status;
355 static std::vector<std::unique_ptr<SBDGroupChannelListQuery>> group_channel_list_queries;
356 bool has_been_updated;
361 void UpdateTypingStatus(
const SBDUser& user,
bool start);
364 void TypingStatusTimeout();
365 void UpdateReadReceipt(
const std::wstring& user_id, int64_t timestamp);
366 void SetChannelHiddenState(SBDGroupChannelHiddenState
hidden_state);
367 void UpdateMyReadReceipt(int64_t ts);
368 static std::map<std::wstring, std::unique_ptr<SBDGroupChannel>> cached_channels;
369 static std::mutex cached_channel_mutex;
370 static int64_t last_mark_all_as_read_ts;
372 static void UpdateTypingStatus();
373 static void ClearCache();
374 static void RemoveChannelFromCache(
const std::wstring&
channel_url);
376 static bool HasChannelInCache(
const std::wstring&
channel_url);
382 std::vector<SBDMember> GetTypingMembers();
384 friend FSBDGroupChannel;
Definition: SBDBaseChannel.h:271
std::wstring name
Definition: SBDBaseChannel.h:281
std::wstring data
Definition: SBDBaseChannel.h:296
std::wstring channel_url
Definition: SBDBaseChannel.h:276
std::wstring custom_type
Definition: SBDBaseChannel.h:301
std::wstring cover_url
Definition: SBDBaseChannel.h:286
Definition: SBDBaseMessage.h:19
Definition: SBDError.h:13
Definition: SBDGroupChannel.h:39
void AcceptInvitation(std::function< void(SBDError *)> completion_handler)
SBDUser inviter
Definition: SBDGroupChannel.h:76
static SBDGroupChannelListQuery * CreateMyGroupChannelListQuery()
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 HideChannel(bool hide_prev_messages, bool allow_auto_unhide, std::function< void(SBDError *)> completion_handler)
std::vector< SBDMember > GetUnreadMembers(SBDBaseMessage *message)
static void GetChannelFromServer(const std::wstring &channel_url, std::function< void(SBDGroupChannel *, SBDError *)> completion_handler)
void ResetMyHistory(std::function< void(SBDError *)> completion_handler)
void DeleteChannel(std::function< void(SBDError *)> completion_handler)
static void GetChannel(const std::wstring &channel_url, std::function< void(SBDGroupChannel *, SBDError *)> completion_handler)
void LeaveChannel(std::function< void(SBDError *)> completion_handler)
bool HasMember(const std::wstring &user_id)
void DeclineInvitation(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)
static void MarkAllAsRead(std::function< void(SBDError *)> completion_handler)
int64_t GetLastSeenAt(const SBDUser &user)
const SBDBaseMessage * GetLastMessage()
SBDMember GetMember(const std::wstring &user_id, bool *member_exist)
std::vector< SBDMember > members
Definition: SBDGroupChannel.h:66
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)
SBDGroupChannelHiddenState hidden_state
Definition: SBDGroupChannel.h:91
std::map< std::wstring, SBDReadStatus > GetReadStatus()
int64_t last_message_id
Definition: SBDGroupChannel.h:44
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 RefreshChannel(std::function< void(SBDError *)> completion_handler)
int GetReadReceipt(SBDBaseMessage *message)
void InviteUsers(const std::vector< SBDUser > &users, std::function< void(SBDError *)> completion_handler)
std::vector< SBDMember > GetReadMembers(SBDBaseMessage *message)
void HideChannel(bool hide_prev_messages, std::function< void(SBDError *)> completion_handler)
bool is_public
Definition: SBDGroupChannel.h:56
static void CreateChannel(SBDGroupChannelParams ¶ms, std::function< void(SBDGroupChannel *, SBDError *)> completion_handler)
uint64_t unread_message_count
Definition: SBDGroupChannel.h:61
void JoinChannel(std::function< void(SBDError *)> completion_handler)
bool is_hidden
Definition: SBDGroupChannel.h:86
uint64_t member_count
Definition: SBDGroupChannel.h:71
bool has_inviter
Definition: SBDGroupChannel.h:81
bool is_distinct
Definition: SBDGroupChannel.h:49
void UnhideChannel(std::function< void(SBDError *)> completion_handler)
Definition: SBDGroupChannelListQuery.h:15
Definition: SBDGroupChannelParams.h:16
Definition: SBDMember.h:16