3#ifndef SENDBIRD_SBDBASECHANNEL_H_
4#define SENDBIRD_SBDBASECHANNEL_H_
7#include "SBDBaseMessage.h"
8#include "SBDUserMessage.h"
9#include "SBDAdminMessage.h"
10#include "SBDFileMessage.h"
11#include "SBDUserMessageParams.h"
12#include "SBDFileMessageParams.h"
175 virtual void ChannelDeleted(
const std::wstring& channel_url, SBDChannelType channel_type) {};
336 std::vector<SBDThumbnailSize> thumbnail_sizes,
const std::wstring&
data,
const std::wstring&
custom_type,
392 std::function<
void(
const std::map<std::wstring, int64_t>& meta_counters,
SBDError*)> completion_handler);
401 std::function<
void(
const std::map<std::wstring, int64_t>& meta_counters,
SBDError*)> completion_handler);
417 std::function<
void(
const std::map<std::wstring, int64_t>& meta_counters,
SBDError*)> completion_handler);
426 std::function<
void(
const std::map<std::wstring, int64_t>& meta_counters,
SBDError*)> completion_handler);
435 std::function<
void(
const std::map<std::wstring, int64_t>& meta_counters,
SBDError*)> completion_handler);
459 std::function<
void(
const std::map<std::wstring, std::wstring>& meta_data,
SBDError*)> completion_handler);
468 std::function<
void(
const std::map<std::wstring, std::wstring>& meta_data,
SBDError* error)> completion_handler);
475 void GetAllMetaData(std::function<
void(
const std::map<std::wstring, std::wstring>& meta_data,
SBDError* error)> completion_handler);
484 std::function<
void(
const std::map<std::wstring, std::wstring>& meta_data,
SBDError*)> completion_handler);
512 const std::wstring&
custom_type, std::function<
void(
const std::vector<SBDBaseMessage*>&,
SBDError*)> completion_handler);
525 const std::wstring&
custom_type, std::function<
void(
const std::vector<SBDBaseMessage*>&,
SBDError*)> completion_handler);
538 void GetMessagesByTimestamp(int64_t timestamp, int64_t prev_limit, int64_t next_limit,
bool reverse, SBDMessageTypeFilter message_type,
539 const std::wstring&
custom_type, std::function<
void(
const std::vector<SBDBaseMessage*>&,
SBDError*)> completion_handler);
552 std::function<
void(
const std::vector<SBDBaseMessage*>&,
SBDError*)> completion_handler);
565 std::function<
void(
const std::vector<SBDBaseMessage*>&,
SBDError*)> completion_handler);
578 void GetMessagesByMessageId(int64_t message_id, int64_t prev_limit, int64_t next_limit,
bool reverse, SBDMessageTypeFilter message_type,
579 const std::wstring&
custom_type, std::function<
void(
const std::vector<SBDBaseMessage*>&,
SBDError*)> completion_handler);
644 void AddOperators(
const std::vector<std::wstring>& user_ids, std::function<
void(
SBDError*)> completion_handler);
679 void Report(SBDReportCategory report_category, std::wstring report_description, std::function<
void(
SBDError*)> completion_handler);
690 void ReportUser(
SBDUser& offending_user, SBDReportCategory report_category, std::wstring report_description, std::function<
void(
SBDError*)> completion_handler);
709 static std::queue<int64_t> message_id_queue;
710 static std::queue<std::wstring> message_req_id_queue;
711 static std::map<int64_t, std::shared_ptr<SBDBaseMessage>> message_id_map;
712 static std::map<std::wstring, std::shared_ptr<SBDBaseMessage>> message_req_id_map;
713 static std::mutex message_map_mutex;
716 static void DeallocateAllMessages();
719 const std::vector<std::wstring>& target_languages, std::function<
void(
SBDUserMessage*,
SBDError*)> completion_handler);
722 SBDFileMessage* SendFileMessageWithPath(
const std::wstring& file_path,
const std::wstring& type,
723 std::vector<SBDThumbnailSize> thumbnail_sizes,
const std::wstring&
data,
const std::wstring&
custom_type,
726 friend FSBDBaseChannel;
Definition: SBDBaseChannel.h:271
std::wstring name
Definition: SBDBaseChannel.h:281
SBDPreviousMessageListQuery * CreatePreviousMessageListQuery()
void ReportUser(SBDUser &offending_user, SBDReportCategory report_category, std::wstring report_description, std::function< void(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 AddMessageMetaArrayValues(const std::wstring &channel_url, int64_t message_id, const std::vector< SBDMessageMetaArray > &metaarrays, std::function< void(SBDBaseMessage *, SBDError *)> completion_handler)
std::wstring data
Definition: SBDBaseChannel.h:296
std::wstring channel_url
Definition: SBDBaseChannel.h:276
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 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)
SBDFileMessage * CopyFileMessage(SBDFileMessage *message, SBDBaseChannel *target_channel, std::function< void(SBDFileMessage *, SBDError *)> completion_handler)
std::wstring custom_type
Definition: SBDBaseChannel.h:301
SBDFileMessage * SendFileMessage(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)
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 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)
SBDUserMessage * SendUserMessage(SBDUserMessageParams ¶ms, std::function< void(SBDUserMessage *, SBDError *)> completion_handler)
void Report(SBDReportCategory report_category, std::wstring report_description, std::function< void(SBDError *)> completion_handler)
void RemoveOperators(const std::vector< std::wstring > &user_ids, std::function< void(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 AddOperators(const std::vector< std::wstring > &user_ids, std::function< void(SBDError *)> completion_handler)
void DeleteMessage(SBDBaseMessage *message, 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 DeleteMessageMetaArrayKeys(const std::wstring &channel_url, int64_t message_id, const std::vector< std::wstring > &metaarray_keys, std::function< void(SBDBaseMessage *, SBDError *)> completion_handler)
bool is_group_channel
Definition: SBDBaseChannel.h:306
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)
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)
bool is_open_channel
Definition: SBDBaseChannel.h:311
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 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 RemoveAllOperators(std::function< void(SBDError *)> completion_handler)
void GetAllMetaCounters(std::function< void(const std::map< std::wstring, int64_t > &meta_counters, 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 ReportMessage(SBDBaseMessage *message, SBDReportCategory report_category, std::wstring report_description, std::function< void(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 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 RemoveMessageMetaArrayValues(const std::wstring &channel_url, int64_t message_id, const std::vector< SBDMessageMetaArray > &metaarrays, std::function< void(SBDBaseMessage *, SBDError *)> completion_handler)
void DeleteMetaCounter(const std::wstring &key, std::function< void(SBDError *)> completion_handler)
void UpdateFileMessage(SBDFileMessage *message, const std::wstring &data, const std::wstring &custom_type, std::function< void(SBDFileMessage *, SBDError *)> completion_handler)
void DeleteAllMetaData(std::function< void(SBDError *)> completion_handler)
int64_t created_at
Definition: SBDBaseChannel.h:291
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)
SBDOperatorListQuery * CreateOperatorListQuery()
void DeleteAllMetaCounters(std::function< void(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 GetAllMetaData(std::function< void(const std::map< std::wstring, std::wstring > &meta_data, SBDError *error)> completion_handler)
SBDFileMessage * SendFileMessage(SBDFileMessageParams ¶ms, std::function< void(SBDFileMessage *, SBDError *)> completion_handler)
std::wstring cover_url
Definition: SBDBaseChannel.h:286
SBDUserMessage * CopyUserMessage(SBDUserMessage *message, SBDBaseChannel *target_channel, std::function< void(SBDUserMessage *, 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 DeleteMetaData(const std::wstring &key, std::function< void(SBDError *)> completion_handler)
Definition: SBDBaseMessage.h:19
Definition: SBDBaseChannel.h:42
virtual void ChannelMetaDataDeleted(SBDBaseChannel *channel, const std::vector< std::wstring > &deleted_meta_data)
Definition: SBDBaseChannel.h:207
virtual void MessageReceived(SBDBaseChannel *channel, SBDBaseMessage *message)
Definition: SBDBaseChannel.h:50
virtual void ChannelMetaCountersUpdated(SBDBaseChannel *channel, const std::map< std::wstring, int64_t > &updated_meta_counters)
Definition: SBDBaseChannel.h:223
virtual void UserLeft(SBDGroupChannel *channel, SBDUser &user)
Definition: SBDBaseChannel.h:99
virtual void ChannelMetaDataCreated(SBDBaseChannel *channel, const std::map< std::wstring, std::wstring > &created_meta_data)
Definition: SBDBaseChannel.h:191
virtual void ChannelMetaCountersDeleted(SBDBaseChannel *channel, const std::vector< std::wstring > &deleted_meta_counters)
Definition: SBDBaseChannel.h:231
virtual void UserMuted(SBDOpenChannel *channel, SBDUser &user)
Definition: SBDBaseChannel.h:123
virtual void MessageDeleted(SBDBaseChannel *channel, uint64_t message_id)
Definition: SBDBaseChannel.h:183
virtual void MessageUpdated(SBDBaseChannel *channel, SBDBaseMessage *message)
Definition: SBDBaseChannel.h:58
virtual void ChannelMetaDataUpdated(SBDBaseChannel *channel, const std::map< std::wstring, std::wstring > &updated_meta_data)
Definition: SBDBaseChannel.h:199
virtual void OperatorUpdated(SBDBaseChannel *channel)
Definition: SBDBaseChannel.h:254
virtual void ChannelDeleted(const std::wstring &channel_url, SBDChannelType channel_type)
Definition: SBDBaseChannel.h:175
virtual void InvitationDeclined(SBDGroupChannel *channel, SBDUser &invitee, SBDUser &inviter)
Definition: SBDBaseChannel.h:83
virtual void InvitationReceived(SBDGroupChannel *channel, const std::vector< SBDUser > &invitees, SBDUser &inviter)
Definition: SBDBaseChannel.h:74
virtual void UserUnbanned(SBDOpenChannel *channel, SBDUser &user)
Definition: SBDBaseChannel.h:147
virtual void UserBanned(SBDOpenChannel *channel, SBDUser &user)
Definition: SBDBaseChannel.h:139
virtual void ChannelWasHidden(SBDGroupChannel *channel)
Definition: SBDBaseChannel.h:246
virtual void UserExited(SBDOpenChannel *channel, SBDUser &user)
Definition: SBDBaseChannel.h:115
virtual void MentionReceived(SBDBaseChannel *channel, SBDBaseMessage *message)
Definition: SBDBaseChannel.h:239
virtual void UserEntered(SBDOpenChannel *channel, SBDUser &user)
Definition: SBDBaseChannel.h:107
virtual void UserUnmuted(SBDOpenChannel *channel, SBDUser &user)
Definition: SBDBaseChannel.h:131
virtual void ChannelChanged(SBDBaseChannel *channel)
Definition: SBDBaseChannel.h:168
virtual void ReadReceiptUpdated(SBDGroupChannel *channel)
Definition: SBDBaseChannel.h:65
virtual void ChannelUnfrozen(SBDOpenChannel *channel)
Definition: SBDBaseChannel.h:161
virtual void UserJoined(SBDGroupChannel *channel, SBDUser &user)
Definition: SBDBaseChannel.h:91
virtual void ChannelMetaCountersCreated(SBDBaseChannel *channel, const std::map< std::wstring, int64_t > &created_meta_counters)
Definition: SBDBaseChannel.h:215
virtual void ChannelFrozen(SBDOpenChannel *channel)
Definition: SBDBaseChannel.h:154
Definition: SBDError.h:13
Definition: SBDFileMessage.h:52
Definition: SBDFileMessageParams.h:17
Definition: SBDGroupChannel.h:39
Definition: SBDOpenChannel.h:25
Definition: SBDOperatorListQuery.h:19
Definition: SBDPreviousMessageListQuery.h:14
Definition: SBDFileMessage.h:26
Definition: SBDFileMessage.h:15
Definition: SBDUserMessage.h:17
Definition: SBDUserMessageParams.h:16