Twitch SDK (Internal)
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
ttv::chat::ChatAPI Class Reference

#include <chatapi.h>

Inheritance diagram for ttv::chat::ChatAPI:
ttv::ModuleBase ttv::IModule

Classes

class  CoreApiClient
 

Public Types

using FetchUserListCallback = std::function< void(TTV_ErrorCode ec, UserList &&userList)>
 
using BlockChangeCallback = std::function< void(TTV_ErrorCode ec)>
 
using FetchEmoticonSetsCallback = std::function< void(TTV_ErrorCode ec, const std::vector< EmoticonSet > &sets)>
 
using FetchBadgesCallback = std::function< void(TTV_ErrorCode ec, BadgeSet &&badges)>
 
using FetchBitsConfigurationCallback = std::function< void(TTV_ErrorCode ec, const std::shared_ptr< BitsConfiguration > &bitsConfig)>
 
using SetBroadcasterLanguageChatEnabledCallback = std::function< void(TTV_ErrorCode ec)>
 
using SendMessageCallback = std::function< void(TTV_ErrorCode ec, MessageId messageID)>
 
using FetchThreadDataPageCallback = std::function< void(TTV_ErrorCode ec, const std::vector< ThreadData > &threadPage, uint32_t total)>
 
using FetchThreadDataCallback = std::function< void(TTV_ErrorCode ec, const ThreadData &threadData)>
 
using FetchThreadMessagesCallback = std::function< void(TTV_ErrorCode ec, const std::vector< WhisperMessage > &message)>
 
using SetLastMessageReadIdCallback = std::function< void(TTV_ErrorCode ec)>
 
using SetThreadMutedCallback = std::function< void(TTV_ErrorCode ec)>
 
using SetThreadArchivedCallback = std::function< void(TTV_ErrorCode ec)>
 
using FetchThreadUnreadCountsCallback = std::function< void(TTV_ErrorCode ec, const UnreadThreadCounts &counts)>
 
using FetchBlockedUsersCallback = std::function< void(TTV_ErrorCode ec, const std::vector< UserInfo > &blockedUsers)>
 
using BanUserCallback = std::function< void(TTV_ErrorCode ec, BanUserError &&error)>
 
using UnbanUserCallback = std::function< void(TTV_ErrorCode ec, UnbanUserError &&error)>
 
using ModUserCallback = std::function< void(TTV_ErrorCode ec, ModUserError &&error)>
 
using UnmodUserCallback = std::function< void(TTV_ErrorCode ec, UnmodUserError &&error)>
 
using UpdateUserColorCallback = std::function< void(TTV_ErrorCode ec)>
 
using FetchChannelModeratorsCallback = std::function< void(TTV_ErrorCode ec, const std::vector< std::string > &modNames, const std::string &nextCursor)>
 
enum  State { State::Uninitialized, State::Initializing, State::Initialized, State::ShuttingDown }
 
using InitializeCallback = std::function< void(TTV_ErrorCode ec)>
 
using ShutdownCallback = std::function< void(TTV_ErrorCode ec)>
 

Public Member Functions

 ChatAPI ()
 
virtual ~ChatAPI ()
 
virtual std::string GetModuleName () const override
 
virtual TTV_ErrorCode Initialize (const InitializeCallback &callback) override
 
virtual TTV_ErrorCode Shutdown (const ShutdownCallback &callback) override
 
virtual TTV_ErrorCode Update () override
 
TTV_ErrorCode SetCoreApi (const std::shared_ptr< CoreAPI > &coreApi)
 
TTV_ErrorCode SetListener (const std::shared_ptr< IChatAPIListener > &listener)
 
TTV_ErrorCode SetEnabledFeatures (const FeatureFlags &features)
 
TTV_ErrorCode SetTokenizationOptions (const TokenizationOptions &options)
 
TTV_ErrorCode SetUserThreadsListener (UserId userId, const std::shared_ptr< IChatUserThreadsListener > &listener)
 
TTV_ErrorCode Connect (UserId userId, ChannelId channelId, const std::shared_ptr< IChatChannelListener > &listener)
 
TTV_ErrorCode Disconnect (UserId userId, ChannelId channelId)
 
TTV_ErrorCode SendChatMessage (UserId userId, ChannelId channelId, const std::string &message)
 
TTV_ErrorCode FetchUserListForChannel (UserId userId, ChannelId channelId, const FetchUserListCallback &callback)
 
TTV_ErrorCode BlockUser (UserId userId, UserId blockUserId, const std::string &reason, bool whisper, const BlockChangeCallback &callback)
 
TTV_ErrorCode UnblockUser (UserId userId, UserId blockUserId, const BlockChangeCallback &callback)
 
TTV_ErrorCode GetUserBlocked (UserId userId, UserId blockUserId, bool &blocked)
 
TTV_ErrorCode FetchBlockedUsers (UserId userId, const FetchBlockedUsersCallback &callback)
 
TTV_ErrorCode FetchUserEmoticonSets (UserId userId, bool forceRefetch, const FetchEmoticonSetsCallback &callback)
 
TTV_ErrorCode FetchGlobalBadges (const FetchBadgesCallback &callback)
 
TTV_ErrorCode FetchChannelBadges (ChannelId channelId, const FetchBadgesCallback &callback)
 
TTV_ErrorCode FetchGlobalBitsConfiguration (const FetchBitsConfigurationCallback &callback)
 
TTV_ErrorCode FetchChannelBitsConfiguration (ChannelId channelId, const FetchBitsConfigurationCallback &callback)
 
TTV_ErrorCode SetBroadcasterLanguageChatEnabled (UserId userId, ChannelId channelId, bool enabled, const SetBroadcasterLanguageChatEnabledCallback &callback)
 
TTV_ErrorCode OptInToBroadcasterLanguageChat (UserId userId, ChannelId channelId, const std::string &language)
 
TTV_ErrorCode GenerateThreadId (UserId userId, UserId otherUserId, std::string &threadId)
 
TTV_ErrorCode SendMessageToUser (UserId userId, UserId otherUserId, const std::string &message, WhisperMessage &placeholderMessage, const SendMessageCallback &callback)
 
TTV_ErrorCode FetchThreadDataPage (UserId userId, uint32_t offset, uint32_t pageSize, const FetchThreadDataPageCallback &callback)
 
TTV_ErrorCode FetchUserThreadData (UserId userId, const std::string &threadId, const FetchThreadDataCallback &callback)
 
TTV_ErrorCode FetchThreadMessages (UserId userId, const std::string &threadId, MessageId start, uint32_t beforeCount, const FetchThreadMessagesCallback &callback)
 
TTV_ErrorCode SetLastMessageReadId (UserId userId, const std::string &threadId, MessageId lastReadMessageId, const SetLastMessageReadIdCallback &callback)
 
TTV_ErrorCode SetThreadMuted (UserId userId, const std::string &threadId, bool muted, const SetThreadMutedCallback &callback)
 
TTV_ErrorCode SetThreadArchived (UserId userId, const std::string &threadId, bool archived, const SetThreadArchivedCallback &callback)
 
TTV_ErrorCode FetchThreadUnreadCounts (UserId userId, const FetchThreadUnreadCountsCallback &callback)
 
TTV_ErrorCode SetMessageFlushInterval (uint64_t milliseconds)
 
uint64_t GetMessageFlushInterval () const
 
TTV_ErrorCode GetEmoticonUrl (uint32_t emoticonId, float scale, std::string &result)
 
TTV_ErrorCode CreateChatChannel (UserId userId, ChannelId channelId, const std::shared_ptr< IChatChannelListener > &listener, std::shared_ptr< IChatChannel > &result)
 
TTV_ErrorCode CreateChatChannelProperties (UserId userId, ChannelId channelId, const std::shared_ptr< IChatChannelPropertyListener > &listener, std::shared_ptr< IChatChannelProperties > &result)
 
TTV_ErrorCode CreateChatReplay (UserId userId, const std::string &vodId, const std::shared_ptr< IChatReplayListener > &listener, std::shared_ptr< IChatReplay > &result)
 
TTV_ErrorCode CreateChannelChatRoomManager (UserId userId, ChannelId channelId, const std::shared_ptr< IChannelChatRoomManagerListener > &listener, std::shared_ptr< IChannelChatRoomManager > &result)
 
TTV_ErrorCode CreateChatRoom (UserId userId, const std::string &roomId, ChannelId channelId, const std::shared_ptr< IChatRoomListener > &listener, std::shared_ptr< IChatRoom > &result)
 
TTV_ErrorCode CreateChatRoomNotifications (UserId userId, const std::shared_ptr< IChatRoomNotificationsListener > &listener, std::shared_ptr< IChatRoomNotifications > &result)
 
TTV_ErrorCode CreateChatRaid (UserId userId, ChannelId channelId, const std::shared_ptr< IChatRaidListener > &listener, std::shared_ptr< IChatRaid > &result)
 
TTV_ErrorCode CreateBitsStatus (UserId userId, ChannelId channelId, const std::shared_ptr< IBitsListener > &listener, std::shared_ptr< IBitsStatus > &result)
 
TTV_ErrorCode CreateFollowersStatus (UserId userId, ChannelId channelId, const std::shared_ptr< IFollowersListener > &listener, std::shared_ptr< IFollowersStatus > &result)
 
TTV_ErrorCode CreateSubscribersStatus (UserId userId, ChannelId channelId, const std::shared_ptr< ISubscribersListener > &listener, std::shared_ptr< ISubscribersStatus > &result)
 
TTV_ErrorCode BanUser (UserId userId, ChannelId channelId, const std::string &bannedUserName, uint32_t durationSeconds, const BanUserCallback &callback)
 
TTV_ErrorCode UnbanUser (UserId userId, ChannelId channelId, const std::string &bannedUserName, const UnbanUserCallback &callback)
 
TTV_ErrorCode ModUser (UserId userId, ChannelId channelId, const std::string &modUserName, const ModUserCallback &callback)
 
TTV_ErrorCode UnmodUser (UserId userId, ChannelId channelId, const std::string &unmodUserName, const UnmodUserCallback &callback)
 
TTV_ErrorCode UpdateUserColor (UserId userId, const std::string &color, const UpdateUserColorCallback &callback)
 
TTV_ErrorCode FetchChannelModerators (ChannelId channelId, const std::string &cursor, const FetchChannelModeratorsCallback &callback)
 
void SetChatObjectFactory (const std::shared_ptr< IChatObjectFactory > &factory)
 
virtual State GetState () const override
 

Static Public Member Functions

static void GetRequiredAuthScopes (std::vector< std::string > &scopes)
 

Protected Member Functions

void NotifyStateChange ()
 
void RegisterInitializeCallback (const InitializeCallback &callback)
 
void RegisterShutdownCallback (const ShutdownCallback &callback)
 
template<typename T >
void Invoke (std::function< void(std::shared_ptr< T >)> callback)
 
std::shared_ptr< ComponentContainerGetComponentContainer ()
 

Protected Attributes

EventSource< IModuleListenermListeners
 
State mState
 
State mLastReportedState
 

Private Member Functions

TTV_ErrorCode GetChannelSet (UserId userId, std::shared_ptr< ChatChannelSet > &channelSet)
 
std::shared_ptr< ChatUserBlockListCreateUserBlockList (const std::shared_ptr< User > &user)
 
void CoreUserLoggedIn (std::shared_ptr< User > user)
 
void CoreUserLoggedOut (std::shared_ptr< User > user)
 
void CoreLocalLanguageChanged (const std::string &language)
 
virtual bool CheckShutdown () override
 
virtual void CompleteShutdown () override
 
TTV_ErrorCode GetBlockListForUser (UserId userId, std::shared_ptr< ChatUserBlockList > &blockList)
 
TTV_ErrorCode GetUserThreadsForUser (UserId userId, std::shared_ptr< ChatUserThreads > &userThreads)
 
TTV_ErrorCode GetThreadForUser (UserId userId, const std::string &threadId, std::shared_ptr< ChatUserThread > &thread)
 
TTV_ErrorCode DisposeChatChannel (const std::shared_ptr< IChatChannel > &chatChannel)
 
TTV_ErrorCode DisposeChatChannelProperties (const std::shared_ptr< IChatChannelProperties > &chatChannelProperties)
 
TTV_ErrorCode DisposeChatReplay (const std::shared_ptr< IChatReplay > &chatReplay)
 
TTV_ErrorCode DisposeChatRaid (const std::shared_ptr< IChatRaid > &chatRaid)
 
TTV_ErrorCode DisposeChannelChatRoomManager (const std::shared_ptr< IChannelChatRoomManager > &channelChatRoomManager)
 
TTV_ErrorCode DisposeChatRoom (const std::shared_ptr< IChatRoom > &chatRoom)
 
TTV_ErrorCode DisposeChatRoomNotifications (const std::shared_ptr< IChatRoomNotifications > &chatRoomNotifications)
 
TTV_ErrorCode DisposeBitsStatus (const std::shared_ptr< IBitsStatus > &bitsStatus)
 
TTV_ErrorCode DisposeFollowersStatus (const std::shared_ptr< IFollowersStatus > &followersStatus)
 
TTV_ErrorCode DisposeSubscribersStatus (const std::shared_ptr< ISubscribersStatus > &subscribersStatus)
 

Private Attributes

std::shared_ptr< CoreAPImCoreApi
 
std::shared_ptr< CoreApiClientmCoreApiClient
 
std::shared_ptr< ChatAPIInternalData > mInternalData
 
std::shared_ptr< IChatObjectFactorymChatObjectFactory
 
std::shared_ptr< ChannelRepositorymChannelRepository
 

The internal chat object factory.

More...
 
std::shared_ptr< UserRepositorymUserRepository
 

The cache of channel info.

More...
 
std::shared_ptr< SettingRepositorymSettingRepository
 

The set of all local users.

More...
 
std::shared_ptr< BitsConfigRepositorymBitsConfigRepository
 
std::shared_ptr< ChatAPITaskHostmTaskHost
 
std::shared_ptr< TaskRunnermTaskRunner
 
std::shared_ptr< TaskRunnermUserBlocksTaskRunner
 

The general task runner to use for api calls.

More...
 
FeatureFlags mEnabledFeatures
 

The task runner to use for block lists. Once we rework the way httprequest queueing and retried works we can use the general one.

More...
 
TokenizationOptions mTokenizationOptions
 

Detailed Description

Provides the main chat service functionality.

The following properties must be set before calling Initialize().

Member Typedef Documentation

◆ BanUserCallback

using ttv::chat::ChatAPI::BanUserCallback = std::function<void(TTV_ErrorCode ec, BanUserError&& error)>

Used with BanUser().

Parameters
[in]ec
  • TTV_EC_SUCCESS: The ban was successfully passed.
  • TTV_EC_WEBAPI_RESULT_INVALID_JSON: Unable to parse the API response.
  • TTV_EC_GRAPHQL_ERROR: Received an error code from the back-end.
  • TTV_EC_API_REQUEST_FAILED: Unable to reach the API endpoint.
[in]errorError object received from GraphQL describing why banning the user failed.

◆ BlockChangeCallback

using ttv::chat::ChatAPI::BlockChangeCallback = std::function<void(TTV_ErrorCode ec)>

Used with BlockUser(), UnblockUser()

Parameters
[in]ec
  • TTV_EC_SUCCESS: The user list was successfully blocked/unblocked.
  • TTV_EC_WEBAPI_RESULT_INVALID_JSON: Unable to parse the response.
  • TTV_EC_REQUEST_ABORTED: The request was aborted.
  • TTV_EC_API_REQUEST_FAILED: Unable to reach the API endpoint.

◆ FetchBadgesCallback

using ttv::chat::ChatAPI::FetchBadgesCallback = std::function<void(TTV_ErrorCode ec, BadgeSet&& badges)>

Used with FetchGlobalBadges() and FetchChannelBadges()

Parameters
[in]ec
  • TTV_EC_SUCCESS: The badges were successfully fetched.
  • TTV_EC_WEBAPI_RESULT_INVALID_JSON: Unable to parse the response.
  • TTV_EC_REQUEST_ABORTED: The request was aborted.
  • TTV_EC_API_REQUEST_FAILED: Unable to reach the API endpoint.
[in]badgesThe badges that were fetched.

◆ FetchBitsConfigurationCallback

using ttv::chat::ChatAPI::FetchBitsConfigurationCallback = std::function<void(TTV_ErrorCode ec, const std::shared_ptr<BitsConfiguration>& bitsConfig)>

Used with FetchGlobalBitsConfiguration() and FetchChannelBitsConfiguration()

Parameters
[in]ec
  • TTV_EC_SUCCESS: The bits configuration was successfully fetched.
  • TTV_EC_WEBAPI_RESULT_INVALID_JSON: Unable to parse the response.
  • TTV_EC_REQUEST_ABORTED: The request was aborted.
  • TTV_EC_API_REQUEST_FAILED: Unable to reach the API endpoint.
[in]bitsConfigA shared pointer to the fetched bits configuration object.

◆ FetchBlockedUsersCallback

using ttv::chat::ChatAPI::FetchBlockedUsersCallback = std::function<void(TTV_ErrorCode ec, const std::vector<UserInfo>& blockedUsers)>

Used with FetchBlockedUsers()

Parameters
[in]ec
  • TTV_EC_SUCCESS: The blocked users were fetched successfully.
  • TTV_EC_WEBAPI_RESULT_INVALID_JSON: Unable to parse the response.
  • TTV_EC_REQUEST_ABORTED: The request was aborted.
  • TTV_EC_API_REQUEST_FAILED: Unable to reach the API endpoint.
[in]blockedUsersThe list of blocked users.

◆ FetchChannelModeratorsCallback

using ttv::chat::ChatAPI::FetchChannelModeratorsCallback = std::function<void(TTV_ErrorCode ec, const std::vector<std::string>& modNames, const std::string& nextCursor)>

Used with FetchChannelModerators().

Parameters
[in]ec
  • TTV_EC_SUCCESS: The channel's moderators were successfully retrieved.
  • TTV_EC_WEBAPI_RESULT_INVALID_JSON: Unable to parse the API response.
  • TTV_EC_API_REQUEST_FAILED: Unable to reach the API endpoint.
[in]modNamesList of moderator names, up the GraphQL pagination limit (currently 100).
[in]nextCursorThe cursor to fetch the next batch of moderator names. Is empty string if no more mods to fetch.

◆ FetchEmoticonSetsCallback

using ttv::chat::ChatAPI::FetchEmoticonSetsCallback = std::function<void(TTV_ErrorCode ec, const std::vector<EmoticonSet>& sets)>

Used with FetchUserEmoticonSets()

Parameters
[in]ec
  • TTV_EC_SUCCESS: The emoticon sets were successfully fetched.
  • TTV_EC_WEBAPI_RESULT_INVALID_JSON: Unable to parse the response.
  • TTV_EC_REQUEST_ABORTED: The request was aborted.
  • TTV_EC_API_REQUEST_FAILED: Unable to reach the API endpoint.
[in]setsA list of the emoticon sets available to the user.

◆ FetchThreadDataCallback

using ttv::chat::ChatAPI::FetchThreadDataCallback = std::function<void(TTV_ErrorCode ec, const ThreadData& threadData)>

Used with FetchThreadData()

Parameters
[in]ec
  • TTV_EC_SUCCESS: The thread data was successfully fetched.
  • TTV_EC_WEBAPI_RESULT_INVALID_JSON: Unable to parse the response.
  • TTV_EC_REQUEST_ABORTED: The request was aborted.
  • TTV_EC_API_REQUEST_FAILED: Unable to reach the API endpoint.
[in]threadDataThe data for the fetched thread.

◆ FetchThreadDataPageCallback

using ttv::chat::ChatAPI::FetchThreadDataPageCallback = std::function<void(TTV_ErrorCode ec, const std::vector<ThreadData>& threadPage, uint32_t total)>

Used with FetchThreadDataPage()

Parameters
[in]ec
  • TTV_EC_SUCCESS: The page of thread data was successfully fetched.
  • TTV_EC_WEBAPI_RESULT_INVALID_JSON: Unable to parse the response.
  • TTV_EC_REQUEST_ABORTED: The request was aborted.
  • TTV_EC_API_REQUEST_FAILED: Unable to reach the API endpoint.
[in]threadPageA page of thread data for the user.
[in]totalThe total number of threads for the user.

◆ FetchThreadMessagesCallback

using ttv::chat::ChatAPI::FetchThreadMessagesCallback = std::function<void(TTV_ErrorCode ec, const std::vector<WhisperMessage>& message)>

Used with FetchThreadMessages()

Parameters
[in]ec
  • TTV_EC_SUCCESS: The thread messages were successfully fetched.
  • TTV_EC_WEBAPI_RESULT_INVALID_JSON: Unable to parse the response.
  • TTV_EC_REQUEST_ABORTED: The request was aborted.
  • TTV_EC_API_REQUEST_FAILED: Unable to reach the API endpoint.
[in]messageThe list of messages in the thread.

◆ FetchThreadUnreadCountsCallback

Used with FetchThreadUnreadCounts()

Parameters
[in]ec
  • TTV_EC_SUCCESS: The thread unread counts were fetched successfully.
  • TTV_EC_WEBAPI_RESULT_INVALID_JSON: Unable to parse the response.
  • TTV_EC_REQUEST_ABORTED: The request was aborted.
  • TTV_EC_API_REQUEST_FAILED: Unable to reach the API endpoint.
[in]countsContains the number of unread threads and messages.

◆ FetchUserListCallback

using ttv::chat::ChatAPI::FetchUserListCallback = std::function<void(TTV_ErrorCode ec, UserList&& userList)>

Used with FetchUserListForChannel()

Parameters
[in]ec
  • TTV_EC_SUCCESS: The user list was successfully fetched.
  • TTV_EC_WEBAPI_RESULT_INVALID_JSON: Unable to parse the response.
  • TTV_EC_REQUEST_ABORTED: The request was aborted.
  • TTV_EC_API_REQUEST_FAILED: Unable to reach the API endpoint.
[in]userListThe list of users in the channel.

◆ InitializeCallback

using ttv::IModule::InitializeCallback = std::function<void(TTV_ErrorCode ec)>
inherited

◆ ModUserCallback

using ttv::chat::ChatAPI::ModUserCallback = std::function<void(TTV_ErrorCode ec, ModUserError&& error)>

Used with ModUser().

Parameters
[in]ec
  • TTV_EC_SUCCESS: The user successfully became a mod.
  • TTV_EC_WEBAPI_RESULT_INVALID_JSON: Unable to parse the API response.
  • TTV_EC_GRAPHQL_ERROR: Received an error code from the back-end.
  • TTV_EC_API_REQUEST_FAILED: Unable to reach the API endpoint.
[in]errorError object received from GraphQL describing why the modding failed.

◆ SendMessageCallback

using ttv::chat::ChatAPI::SendMessageCallback = std::function<void(TTV_ErrorCode ec, MessageId messageID)>

Used with SendMessageToUser()

Parameters
[in]ec
  • TTV_EC_SUCCESS: The message was successfully sent.
  • TTV_EC_WEBAPI_RESULT_INVALID_JSON: Unable to parse the response.
  • TTV_EC_REQUEST_ABORTED: The request was aborted.
  • TTV_EC_API_REQUEST_FAILED: Unable to reach the API endpoint.
[in]messageIDThe ID of the sent message.

◆ SetBroadcasterLanguageChatEnabledCallback

Used with SetBroadcasterLanguageChatEnabled()

Parameters
[in]ec
  • TTV_EC_SUCCESS: The broadcaster language settings was successfully changed.
  • TTV_EC_WEBAPI_RESULT_INVALID_JSON: Unable to parse the response.
  • TTV_EC_REQUEST_ABORTED: The request was aborted.
  • TTV_EC_API_REQUEST_FAILED: Unable to reach the API endpoint.

◆ SetLastMessageReadIdCallback

Used with SetLastMessageReadId()

Parameters
[in]ec
  • TTV_EC_SUCCESS: The last message read was set successfully.
  • TTV_EC_WEBAPI_RESULT_INVALID_JSON: Unable to parse the response.
  • TTV_EC_REQUEST_ABORTED: The request was aborted.
  • TTV_EC_API_REQUEST_FAILED: Unable to reach the API endpoint.

◆ SetThreadArchivedCallback

Used with SetThreadArchived()

Parameters
[in]ec
  • TTV_EC_SUCCESS: The thread was archived successfully.
  • TTV_EC_WEBAPI_RESULT_INVALID_JSON: Unable to parse the response.
  • TTV_EC_REQUEST_ABORTED: The request was aborted.
  • TTV_EC_API_REQUEST_FAILED: Unable to reach the API endpoint.

◆ SetThreadMutedCallback

Used with SetThreadMuted()

Parameters
[in]ec
  • TTV_EC_SUCCESS: The thread was muted successfully.
  • TTV_EC_WEBAPI_RESULT_INVALID_JSON: Unable to parse the response.
  • TTV_EC_REQUEST_ABORTED: The request was aborted.
  • TTV_EC_API_REQUEST_FAILED: Unable to reach the API endpoint.

◆ ShutdownCallback

using ttv::IModule::ShutdownCallback = std::function<void(TTV_ErrorCode ec)>
inherited

◆ UnbanUserCallback

using ttv::chat::ChatAPI::UnbanUserCallback = std::function<void(TTV_ErrorCode ec, UnbanUserError&& error)>

Used with UnbanUser().

Parameters
[in]ec
  • TTV_EC_SUCCESS: The unban was successfully passed.
  • TTV_EC_WEBAPI_RESULT_INVALID_JSON: Unable to parse the API response.
  • TTV_EC_GRAPHQL_ERROR: Received an error code from the back-end.
  • TTV_EC_API_REQUEST_FAILED: Unable to reach the API endpoint.
[in]errorError object received from GraphQL describing why the unbanning failed.

◆ UnmodUserCallback

using ttv::chat::ChatAPI::UnmodUserCallback = std::function<void(TTV_ErrorCode ec, UnmodUserError&& error)>

Used with UnmodUser().

Parameters
[in]ec
  • TTV_EC_SUCCESS: The user successfully became unmodded.
  • TTV_EC_WEBAPI_RESULT_INVALID_JSON: Unable to parse the API response.
  • TTV_EC_GRAPHQL_ERROR: Received an error code from the back-end.
  • TTV_EC_API_REQUEST_FAILED: Unable to reach the API endpoint.
[in]errorError object received from GraphQL describing why the unmodding failed.

◆ UpdateUserColorCallback

Used with UpdateUserColor().

Parameters
[in]ec
  • TTV_EC_SUCCESS: The user's chat color was successfully changed.
  • TTV_EC_WEBAPI_RESULT_INVALID_JSON: Unable to parse the API response.
  • TTV_EC_API_REQUEST_FAILED: Unable to reach the API endpoint.

Member Enumeration Documentation

◆ State

enum ttv::IModule::State
stronginherited
Enumerator
Uninitialized 
Initializing 
Initialized 
ShuttingDown 

Constructor & Destructor Documentation

◆ ChatAPI()

ttv::chat::ChatAPI::ChatAPI ( )

◆ ~ChatAPI()

virtual ttv::chat::ChatAPI::~ChatAPI ( )
virtual

Member Function Documentation

◆ BanUser()

TTV_ErrorCode ttv::chat::ChatAPI::BanUser ( UserId  userId,
ChannelId  channelId,
const std::string &  bannedUserName,
uint32_t  durationSeconds,
const BanUserCallback callback 
)

Bans or timeouts the given user name from the given channel.

Parameters
[in]userIdThe id of the user who is issuing the ban. Must be owner or moderator of the channel.
[in]channelIdThe id of the channel the user is being banned from.
[in]bannedUserNameThe name of the user who is being banned.
[in]durationSecondsThe duration of the ban/timeout in seconds. Value is 0 for a permanent ban.
[in]callbackReceives an error code indicating the ban's success.
Returns
  • TTV_EC_SUCCESS: We've sent the ban request successfully.
  • TTV_EC_NOT_INITIALIZED: We haven't initialized properly.
  • TTV_EC_NEED_TO_LOGIN: We aren't logged in properly.
  • TTV_EC_INVALID_ARG: If any input arguments are invalid.

◆ BlockUser()

TTV_ErrorCode ttv::chat::ChatAPI::BlockUser ( UserId  userId,
UserId  blockUserId,
const std::string &  reason,
bool  whisper,
const BlockChangeCallback callback 
)

Block another user.

Parameters
[in]userIdThe currently logged in user.
[in]blockUserIdThe user being blocked.
[in]reasonThe reason for blocking the user.
[in]whisperTrue if blocking due to a whisper.
[in]callbackFunction that receives whether the blocking was successful.
Returns
  • TTV_EC_SUCCESS: Successfully sent the request to block the user.
  • TTV_EC_NOT_INITIALIZED: Chat API is not initialized.
  • TTV_EC_INVALID_USERID: There is not a properly logged in user.
  • TTV_EC_SHUT_DOWN: The chat module is shut down.

◆ CheckShutdown()

virtual bool ttv::chat::ChatAPI::CheckShutdown ( )
overrideprivatevirtual

Reimplemented from ttv::ModuleBase.

◆ CompleteShutdown()

virtual void ttv::chat::ChatAPI::CompleteShutdown ( )
overrideprivatevirtual

Reimplemented from ttv::ModuleBase.

◆ Connect()

TTV_ErrorCode ttv::chat::ChatAPI::Connect ( UserId  userId,
ChannelId  channelId,
const std::shared_ptr< IChatChannelListener > &  listener 
)

Connect to the channel's chat.

Parameters
[in]userIdThe currently logged in user that is connecting to chat. Can be the anonymous user with ID of 0.
[in]channelIdThe channel of the chat the user is connecting to.
[in]listenerReceives unsolicited events regarding the channel's chat.
Returns
  • TTV_EC_SUCCESS: Connected to chat successfully.
  • TTV_EC_NOT_INITIALIZED: Chat API is not initialized.
  • TTV_EC_INVALID_LOGIN: The user is not logged in.
  • TTV_EC_NEED_TO_LOGIN: Chat channel not found for user.
  • TTV_EC_INVALID_ARG: The listener cannot be null.
  • TTV_EC_INVALID_CALLBACK: If the channel already exists, the same listener must be passed in.
  • TTV_EC_CHAT_LEAVING_CHANNEL: We are currently disconnecting from the channel.
  • TTV_EC_CHAT_NO_HOSTS: No chat hosts were configured.
  • TTV_EC_NO_FACTORIES_REGISTERED: No factories registered.
  • TTV_EC_UNIMPLEMENTED: Registered factories unable to create socket for allowed chat protocols.

◆ CoreLocalLanguageChanged()

void ttv::chat::ChatAPI::CoreLocalLanguageChanged ( const std::string &  language)
private

◆ CoreUserLoggedIn()

void ttv::chat::ChatAPI::CoreUserLoggedIn ( std::shared_ptr< User user)
private

◆ CoreUserLoggedOut()

void ttv::chat::ChatAPI::CoreUserLoggedOut ( std::shared_ptr< User user)
private

◆ CreateBitsStatus()

TTV_ErrorCode ttv::chat::ChatAPI::CreateBitsStatus ( UserId  userId,
ChannelId  channelId,
const std::shared_ptr< IBitsListener > &  listener,
std::shared_ptr< IBitsStatus > &  result 
)

Returns an implementation of IBitsStatus for the user/channel. This object is used to recieve bits updates for a user/channel. Bits updates that can be listened for:

  • When a bits event occurs on the current channel (BitsReceived) - only relevant for partners/affiliates who are able to receive bits.
  • When the current user cheers bits on a different channel (BitsSent)
Parameters
[in]userIdThe currently logged in user creating the bits status.
[in]channelIdShould be the same as userId.
[in]listenerThe listener to receive bits updates for a user/channel.
[out]resultBitsStatus object for the given user/channel to receive bits updates on. This object maintains the lifetime of the listener associated it.
Returns
  • TTV_EC_SUCCESS: We've initialized and created BitsStatus successfully.
  • TTV_EC_NOT_INITIALIZED: We haven't initialized properly.
  • TTV_EC_NEED_TO_LOGIN: We aren't logged in properly.
  • TTV_EC_INVALID_ARG: Cannot be the anonymous user. Channel ID cannot be 0. Listener cannot be null.

◆ CreateChannelChatRoomManager()

TTV_ErrorCode ttv::chat::ChatAPI::CreateChannelChatRoomManager ( UserId  userId,
ChannelId  channelId,
const std::shared_ptr< IChannelChatRoomManagerListener > &  listener,
std::shared_ptr< IChannelChatRoomManager > &  result 
)

Returns an implementation of IChannelChatRoomManager for the given user. This object handles any functions that aren't associated with a specific chat room, such as what rooms a user is connected to.

Parameters
[in]userIdThe id of the user we're creating the ChannelChatRoomManager object for.
[in]channelIdThe id of the channel that owns the chat rooms that the user is entering.
[in]listenerListener for user chat rooms. Called when a user is kicked/banned/timed out of a room, is mentioned, or has their view changed.
[out]resultStores the resulting ChannelChatRoomManager object.
Returns
  • TTV_EC_SUCCESS: The result has been populated with a IChannelChatRoomManager object to use.
  • TTV_EC_NOT_INITIALIZED: If chat hasn't been initialized properly yet.
  • TTV_EC_NEED_TO_LOGIN: If there is not a properly logged in user.

◆ CreateChatChannel()

TTV_ErrorCode ttv::chat::ChatAPI::CreateChatChannel ( UserId  userId,
ChannelId  channelId,
const std::shared_ptr< IChatChannelListener > &  listener,
std::shared_ptr< IChatChannel > &  result 
)

Returns an implementation of IChatChannel for connecting to a channel on behalf of a user.

Parameters
[in]userIdThe currently logged in user. Can be the anonymous user with ID of 0.
[in]channelIdThe channel the user wants the object for.
[in]listenerListener for unsolicited events on the chat channel (raids, hosting, subscriptions, info changes, etc.)
[out]resultThe chat channel object for the channel.
Returns
  • TTV_EC_SUCCESS: The chat channel object was returned in result.
  • TTV_EC_NOT_INITIALIZED: Chat API is not initialized.
  • TTV_EC_INVALID_ARG: Channel ID cannot be 0. Listener cannot be null.
  • TTV_EC_NEED_TO_LOGIN: There is not a properly logged in user.

◆ CreateChatChannelProperties()

TTV_ErrorCode ttv::chat::ChatAPI::CreateChatChannelProperties ( UserId  userId,
ChannelId  channelId,
const std::shared_ptr< IChatChannelPropertyListener > &  listener,
std::shared_ptr< IChatChannelProperties > &  result 
)

Returns an implementation of IChatChannelProperties for a given channelId. This object is used to receive unsolicited chat channel property updates for a channel. Property updates that can be listened for:

  • Whether or not rituals is enabled/disabled (RitualsEnabled)
  • Whenever the host target changes (HostTargetChange)
Parameters
[in]userIdThe id of the user creating the ChatChannelProperties object. Can be the anonymous user with ID of 0.
[in]channelIdThe id of the channel we are receiving property updates for.
[in]listenerListener for the user. Called when certain properties (listed above) are updated on a channel.
[out]resultStores the resulting ChatChannelProperties object.
Returns
  • TTV_EC_SUCCESS: The result has been populated with a ChatChannelProperties object to use.
  • TTV_EC_NOT_INITIALIZED: If chat hasn't been initialized properly yet.
  • TTV_EC_INVALID_ARG: Channel ID cannot be 0. Listener cannot be null.
  • TTV_EC_NEED_TO_LOGIN: If there is not a properly logged in user.

◆ CreateChatRaid()

TTV_ErrorCode ttv::chat::ChatAPI::CreateChatRaid ( UserId  userId,
ChannelId  channelId,
const std::shared_ptr< IChatRaidListener > &  listener,
std::shared_ptr< IChatRaid > &  result 
)

Returns an implementation of IChatRaid for the given owning user and channel, which is used later to start, join, leave, or cancel a raid.

Parameters
[in]userIdThe id of the user creating the raid object. If the anonymous user is passed in, you can listen for raid updates but not start or join a raid. To start a raid after creation, the user must be the broadcaster or moderator of the channel.
[in]channelIdThe source channel id that the raid is starting from.
[in]listenerListener for the raid with callback functions when the raid is started, updated, completed, and cancelled.
[out]resultStores the resulting ChatRaid object.
Returns
  • TTV_EC_SUCCESS: The result has been populated with an IChatRaid object to use.
  • TTV_EC_NOT_INITIALIZED: If chat hasn't been initialized properly yet.
  • TTV_EC_NEED_TO_LOGIN: If there is not a properly logged in user.

◆ CreateChatReplay()

TTV_ErrorCode ttv::chat::ChatAPI::CreateChatReplay ( UserId  userId,
const std::string &  vodId,
const std::shared_ptr< IChatReplayListener > &  listener,
std::shared_ptr< IChatReplay > &  result 
)

Returns an implementation of IChatReplay for the given owning user and vod.

Parameters
[in]userIdThe currently logged in user creating the ChatReplay object. Can be the anonymous user with ID of 0.
[in]vodIdThe VOD to create the chat replay for.
[in]listenerListener for the chat replay. Called for unsolicited changes to the chat replay.
[out]resultStores the resulting ChatReplay object.
Returns
  • TTV_EC_SUCCESS: The chat replay object was returned in result.
  • TTV_EC_NOT_INITIALIZED: Chat API is not initialized.
  • TTV_EC_INVALID_ARG: Vod ID cannot be the empty string. Listener cannot be null.

◆ CreateChatRoom()

TTV_ErrorCode ttv::chat::ChatAPI::CreateChatRoom ( UserId  userId,
const std::string &  roomId,
ChannelId  channelId,
const std::shared_ptr< IChatRoomListener > &  listener,
std::shared_ptr< IChatRoom > &  result 
)

Returns an implementation of IChatRoom for the given room id. This object is used to manage a specific chat room.

Parameters
[in]userIdThe id of the user creating the chat room object.
[in]roomIdThe id of the room that the ChatRoom object is representing.
[in]channelIdThe channel that owns the created chat room.
[in]listenerListener for the chat room. Called when a message is sent/edited/deleted, or when the room information has been updated.
[out]resultStores the resulting ChatRoom object.
Returns
  • TTV_EC_SUCCESS: The result has been populated with a IChatRoom object to use.
  • TTV_EC_NOT_INITIALIZED: If chat hasn't been initialized properly yet.
  • TTV_EC_NEED_TO_LOGIN: If there is not a properly logged in user.

◆ CreateChatRoomNotifications()

TTV_ErrorCode ttv::chat::ChatAPI::CreateChatRoomNotifications ( UserId  userId,
const std::shared_ptr< IChatRoomNotificationsListener > &  listener,
std::shared_ptr< IChatRoomNotifications > &  result 
)

Returns an implementation of IChatRoomNotifications for the given user id. This object is used to receive unsolicited chat room events for the user.

Parameters
[in]userIdThe id of the user creating the chat room notifications object. Cannot be the anonymous user.
[in]listenerListener for the user. Called when the user is banned/timed out, or when the user's room view has been updated.
[out]resultStores the resulting ChatRoomNotifications object.
Returns
  • TTV_EC_SUCCESS: The result has been populated with a IChatRoomNotifications object to use.
  • TTV_EC_NOT_INITIALIZED: If chat hasn't been initialized properly yet.
  • TTV_EC_NEED_TO_LOGIN: If there is not a properly logged in user.

◆ CreateFollowersStatus()

TTV_ErrorCode ttv::chat::ChatAPI::CreateFollowersStatus ( UserId  userId,
ChannelId  channelId,
const std::shared_ptr< IFollowersListener > &  listener,
std::shared_ptr< IFollowersStatus > &  result 
)

Returns an implementation of IFollowersStatus for the user.

Parameters
[in]userIdThe currently logged in user creating the followers status object. Can be the anonymous user with ID of 0.
[in]channelIdThe channel we care about listening to for follows.
[in]listenerThe listener to receive info about follows in the channel.
[out]resultFollowersStatus object for the given user/channel to receive follower updates on. This object maintains the lifetime of the listener associated it.
Returns
  • TTV_EC_SUCCESS: We've initialized and created FollowersStatus successfully.
  • TTV_EC_NOT_INITIALIZED: We haven't initialized properly.
  • TTV_EC_NEED_TO_LOGIN: We aren't logged in properly.
  • TTV_EC_INVALID_ARG: Channel ID cannot be 0. Listener cannot be null.

◆ CreateSubscribersStatus()

TTV_ErrorCode ttv::chat::ChatAPI::CreateSubscribersStatus ( UserId  userId,
ChannelId  channelId,
const std::shared_ptr< ISubscribersListener > &  listener,
std::shared_ptr< ISubscribersStatus > &  result 
)

Returns an implementation of ISubscribersStatus for the user. This is only relevant for partners/affiliates who are able to have subscribers.

Parameters
[in]userIdThe currently logged in user creating the subscribers status object.
[in]channelIdShould be the same as userId, since you can only check your own subscribers.
[in]listenerThe listener to receive info about subscribers in the channel.
[out]resultSubscribersStatus object for the given user/channel to receive subscriber updates on. This object maintains the lifetime of the listener associated it.
Returns
  • TTV_EC_SUCCESS: We've initialized and created SubscribersStatus successfully.
  • TTV_EC_NOT_INITIALIZED: We haven't initialized properly.
  • TTV_EC_NEED_TO_LOGIN: We aren't logged in properly.
  • TTV_EC_INVALID_ARG: User ID nor channel ID cannot be 0. Listener cannot be null.

◆ CreateUserBlockList()

std::shared_ptr<ChatUserBlockList> ttv::chat::ChatAPI::CreateUserBlockList ( const std::shared_ptr< User > &  user)
private

◆ Disconnect()

TTV_ErrorCode ttv::chat::ChatAPI::Disconnect ( UserId  userId,
ChannelId  channelId 
)

Disconnect from the channel's chat.

Parameters
[in]userIdThe currently logged in user that is disconneting from chat. Can be the anonymous user with ID of 0.
[in]channelIdThe channel of the chat the user is disconnecting from.
Returns
  • TTV_EC_SUCCESS: Disconnected from chat successfully.
  • TTV_EC_NOT_INITIALIZED: Chat API is not initialized.
  • TTV_EC_INVALID_LOGIN: The user is not logged in.
  • TTV_EC_NEED_TO_LOGIN: Chat channel not found for user.
  • TTV_EC_CHAT_NOT_IN_CHANNEL: We are not connected to the given channel.
  • TTV_EC_CHAT_LEAVING_CHANNEL: We are currently disconnecting from the channel, or the chat module is shutting down.

◆ DisposeBitsStatus()

TTV_ErrorCode ttv::chat::ChatAPI::DisposeBitsStatus ( const std::shared_ptr< IBitsStatus > &  bitsStatus)
private

◆ DisposeChannelChatRoomManager()

TTV_ErrorCode ttv::chat::ChatAPI::DisposeChannelChatRoomManager ( const std::shared_ptr< IChannelChatRoomManager > &  channelChatRoomManager)
private

◆ DisposeChatChannel()

TTV_ErrorCode ttv::chat::ChatAPI::DisposeChatChannel ( const std::shared_ptr< IChatChannel > &  chatChannel)
private

◆ DisposeChatChannelProperties()

TTV_ErrorCode ttv::chat::ChatAPI::DisposeChatChannelProperties ( const std::shared_ptr< IChatChannelProperties > &  chatChannelProperties)
private

◆ DisposeChatRaid()

TTV_ErrorCode ttv::chat::ChatAPI::DisposeChatRaid ( const std::shared_ptr< IChatRaid > &  chatRaid)
private

◆ DisposeChatReplay()

TTV_ErrorCode ttv::chat::ChatAPI::DisposeChatReplay ( const std::shared_ptr< IChatReplay > &  chatReplay)
private

◆ DisposeChatRoom()

TTV_ErrorCode ttv::chat::ChatAPI::DisposeChatRoom ( const std::shared_ptr< IChatRoom > &  chatRoom)
private

◆ DisposeChatRoomNotifications()

TTV_ErrorCode ttv::chat::ChatAPI::DisposeChatRoomNotifications ( const std::shared_ptr< IChatRoomNotifications > &  chatRoomNotifications)
private

◆ DisposeFollowersStatus()

TTV_ErrorCode ttv::chat::ChatAPI::DisposeFollowersStatus ( const std::shared_ptr< IFollowersStatus > &  followersStatus)
private

◆ DisposeSubscribersStatus()

TTV_ErrorCode ttv::chat::ChatAPI::DisposeSubscribersStatus ( const std::shared_ptr< ISubscribersStatus > &  subscribersStatus)
private

◆ FetchBlockedUsers()

TTV_ErrorCode ttv::chat::ChatAPI::FetchBlockedUsers ( UserId  userId,
const FetchBlockedUsersCallback callback 
)

Fetches the list of blocked users (UserInfo) for the given user. This will not use a cached value and will fetch whenever this is called.

Parameters
[in]userIdThe currently logged in user whose blocked users is being fetched.
[in]callbackFunction that receives a list of the blocked users.
Returns
  • TTV_EC_SUCCESS: Successfully added the request to fetch the blocked users.
  • TTV_EC_NOT_INITIALIZED: Chat API is not initialized.
  • TTV_EC_INVALID_USERID: There is not a properly logged in user.
  • TTV_EC_SHUT_DOWN: The chat module is shut down.

◆ FetchChannelBadges()

TTV_ErrorCode ttv::chat::ChatAPI::FetchChannelBadges ( ChannelId  channelId,
const FetchBadgesCallback callback 
)

Fetches the badge sets for the given channel. May use a cached value.

Parameters
[in]channelIdThe channel we're fetching badges for.
[in]callbackFunction that takes in the channel badge set information.
Returns
  • TTV_EC_SUCCESS: Successfully sent the request to fetch the channel badges.
  • TTV_EC_NOT_INITIALIZED: Chat API is not initialized.
  • TTV_EC_SHUTTING_DOWN: Unable to add the request as a task.

◆ FetchChannelBitsConfiguration()

TTV_ErrorCode ttv::chat::ChatAPI::FetchChannelBitsConfiguration ( ChannelId  channelId,
const FetchBitsConfigurationCallback callback 
)

Fetches the bits configuration object specifically for this channel. The BitsConfiguration object we get back may contain additional actions/cheers specifically for the channel. This value is cached for each channel.

Parameters
[in]channelIdThe channel we want to fetch the bits configuration for.
[in]callbackFunction that takes in the bits configuration information.
Returns
  • TTV_EC_SUCCESS: Successfully sent the request to fetch the channel bits configuration.
  • TTV_EC_NOT_INITIALIZED: Chat API is not initialized.

◆ FetchChannelModerators()

TTV_ErrorCode ttv::chat::ChatAPI::FetchChannelModerators ( ChannelId  channelId,
const std::string &  cursor,
const FetchChannelModeratorsCallback callback 
)

Fetches the names of moderators in a channel.

Parameters
[in]channelIdThe id of the channel we're fetching mdoerators for.
[in]cursorThe cursor to start fetching moderators names from. To start from the beginning, use empty string.
[in]callbackReceives an error code indicating the change's success and a list of the names of the moderators.
Returns
  • TTV_EC_SUCCESS: We've sent the ban request successfully.
  • TTV_EC_NOT_INITIALIZED: We haven't initialized properly.
  • TTV_EC_INVALID_ARG: If any input arguments are invalid.

◆ FetchGlobalBadges()

TTV_ErrorCode ttv::chat::ChatAPI::FetchGlobalBadges ( const FetchBadgesCallback callback)

Fetches the global badge sets. May use a cached value.

Parameters
[in]callbackFunction that receives the global badge set information.
Returns
  • TTV_EC_SUCCESS: Successfully sent the request to fetch the global badges.
  • TTV_EC_NOT_INITIALIZED: Chat API is not initialized.
  • TTV_EC_SHUTTING_DOWN: Unable to add the request as a task.

◆ FetchGlobalBitsConfiguration()

TTV_ErrorCode ttv::chat::ChatAPI::FetchGlobalBitsConfiguration ( const FetchBitsConfigurationCallback callback)

Fetches the global bits configuration object. This object contains info about the various bits actions (cheers). This value is cached over time, but the initial fetch can take some time.

Parameters
[in]callbackFunction that takes in the bits configuration information.
Returns
  • TTV_EC_SUCCESS: Successfully sent the request to fetch the global bits configuration.
  • TTV_EC_NOT_INITIALIZED: Chat API is not initialized.

◆ FetchThreadDataPage()

TTV_ErrorCode ttv::chat::ChatAPI::FetchThreadDataPage ( UserId  userId,
uint32_t  offset,
uint32_t  pageSize,
const FetchThreadDataPageCallback callback 
)

Fetch a page of thread data.

Parameters
[in]userIdThe currently logged in user who is fetching the page.
[in]offsetThe point to start fetching threads from.
[in]pageSizeHow many threads to fetch.
[in]callbackFunction that receives a list of thread data.
Returns
  • TTV_EC_SUCCESS: Successfully sent the request to fetch the page of thread data.
  • TTV_EC_NOT_INITIALIZED: Chat API is not initialized.
  • TTV_EC_FEATURE_DISABLED: Conversations are disabled.
  • TTV_EC_INVALID_USERID: There is not a properly logged in user.
  • TTV_EC_SHUT_DOWN: Unable to find the chat threads for the user.
  • TTV_EC_INVALID_ARG: Size of page cannot be 0.
  • TTV_EC_NEED_TO_LOGIN: User is not logged in.

◆ FetchThreadMessages()

TTV_ErrorCode ttv::chat::ChatAPI::FetchThreadMessages ( UserId  userId,
const std::string &  threadId,
MessageId  start,
uint32_t  beforeCount,
const FetchThreadMessagesCallback callback 
)

Fetch the messages for a thread.

Parameters
[in]userIdThe currently logged in user who is fetching their thread's messages.
[in]threadIdThe ID of the thread to fetch messages for.
[in]startThe ID of the message to start fetching messages from.
[in]beforeCountThe max number of messages to fetch.
[in]callbackFunction that receives the list of whispers.
Returns
  • TTV_EC_SUCCESS: Successfully sent the request to fetch the thread messages.
  • TTV_EC_NOT_INITIALIZED: Chat API is not initialized.
  • TTV_EC_FEATURE_DISABLED: Conversations are disabled.
  • TTV_EC_INVALID_USERID: There is not a properly logged in user.
  • TTV_EC_SHUT_DOWN: Unable to find the chat threads for the user.
  • TTV_EC_CHAT_INVALID_CHAT_THREAD_ID: Cannot find the thread ID for the user.
  • TTV_EC_NEED_TO_LOGIN: User is not logged in.

◆ FetchThreadUnreadCounts()

TTV_ErrorCode ttv::chat::ChatAPI::FetchThreadUnreadCounts ( UserId  userId,
const FetchThreadUnreadCountsCallback callback 
)

Fetch the number of unread threads a user has.

Parameters
[in]userIdThe currently logged in user who is fetching their unread counts.
[in]callbackFunction that receives the UnreadThreadCounts object
Returns
  • TTV_EC_SUCCESS: Successfully sent the request to fetch the unread counts.
  • TTV_EC_NOT_INITIALIZED: Chat API is not initialized.
  • TTV_EC_FEATURE_DISABLED: Conversations are disabled.
  • TTV_EC_INVALID_USERID: There is not a properly logged in user.
  • TTV_EC_SHUT_DOWN: Unable to find the chat threads for the user.
  • TTV_EC_CHAT_INVALID_CHAT_THREAD_ID: Cannot find the given thread for the user.
  • TTV_EC_NEED_TO_LOGIN: User is not logged in.

◆ FetchUserEmoticonSets()

TTV_ErrorCode ttv::chat::ChatAPI::FetchUserEmoticonSets ( UserId  userId,
bool  forceRefetch,
const FetchEmoticonSetsCallback callback 
)

Fetches the emoticon sets available to the user. Calling this function may potentially fire IChatAPIListener::ChatUserEmoticonSetsChanged()

Parameters
[in]userIdThe currently logged in user whose emoticons are being fetched.
[in]forceRefetchIf false, will potentially call the callback immediately with cached values. Otherwise will force a fetch for latest values.
[in]callbackFunction that receives a list of emoticon sets for the user.
Returns
  • TTV_EC_SUCCESS: Successfully sent the request to fetch the emoticon sets for the user.
  • TTV_EC_NOT_INITIALIZED: Chat API is not initialized.
  • TTV_EC_FEATURE_DISABLED: Emoticons are disabled.
  • TTV_EC_INVALID_LOGIN: The given user ID is not logged in.

◆ FetchUserListForChannel()

TTV_ErrorCode ttv::chat::ChatAPI::FetchUserListForChannel ( UserId  userId,
ChannelId  channelId,
const FetchUserListCallback callback 
)

Fetches the user list for the channel.

Parameters
[in]userIdThe currently logged in user who is fetching the user list.
[in]channelIdThe channel we're fetching the user list for.
[in]callbackFunction that receives the returned user list.
Returns
  • TTV_EC_SUCCESS: The user list was fetched successfully.
  • TTV_EC_NOT_INITIALIZED: Chat API is not initialized.
  • TTV_EC_INVALID_CHANNEL_ID: Channel id cannot be 0.
  • TTV_EC_CHAT_NOT_IN_CHANNEL: Not connected to the channel.
  • TTV_EC_AUTHENTICATION: The chat channel does not have an associated user.
  • TTV_EC_CHAT_LEAVING_CHANNEL: We are currently disconnecting from the channel, or the chat module is being shut down.

◆ FetchUserThreadData()

TTV_ErrorCode ttv::chat::ChatAPI::FetchUserThreadData ( UserId  userId,
const std::string &  threadId,
const FetchThreadDataCallback callback 
)

Fetch the data for a specific thread.

Parameters
[in]userIdThe currently logged in user who is fetching their thread's data.
[in]threadIdThe thread to retrieve the information for.
[in]callbackFunction that receives the data for the thread.
Returns
  • TTV_EC_SUCCESS: Successfully sent the request to fetch the thread data.
  • TTV_EC_NOT_INITIALIZED: Chat API is not initialized.
  • TTV_EC_FEATURE_DISABLED: Conversations are disabled.
  • TTV_EC_INVALID_USERID: There is not a properly logged in user.
  • TTV_EC_SHUT_DOWN: Unable to find the chat threads for the user.
  • TTV_EC_INVALID_ARG: Thread ID cannot be the empty string.
  • TTV_EC_NEED_TO_LOGIN: User is not logged in.

◆ GenerateThreadId()

TTV_ErrorCode ttv::chat::ChatAPI::GenerateThreadId ( UserId  userId,
UserId  otherUserId,
std::string &  threadId 
)

Returns the thread ID between two users.

Parameters
[in]userIdThe currently logged in user.
[in]otherUserIdThe other user participating in the thread.
[out]threadIdThe thread id of the two users.
Returns
  • TTV_EC_SUCCESS: Returned the thread id of the two users.
  • TTV_EC_INVALID_USERID: userId nor otherUserId can be 0.

◆ GetBlockListForUser()

TTV_ErrorCode ttv::chat::ChatAPI::GetBlockListForUser ( UserId  userId,
std::shared_ptr< ChatUserBlockList > &  blockList 
)
private

◆ GetChannelSet()

TTV_ErrorCode ttv::chat::ChatAPI::GetChannelSet ( UserId  userId,
std::shared_ptr< ChatChannelSet > &  channelSet 
)
private

◆ GetComponentContainer()

std::shared_ptr<ComponentContainer> ttv::ModuleBase::GetComponentContainer ( )
inlineprotectedinherited

Returns the common ComponentContainer which hosts all components which live at the module level.

◆ GetEmoticonUrl()

TTV_ErrorCode ttv::chat::ChatAPI::GetEmoticonUrl ( uint32_t  emoticonId,
float  scale,
std::string &  result 
)

Generate the url for an emoticon with given ID and scale factor.

Parameters
[in]emoticonIdThe emoticon we're generating the url for.
[in]scaleThe scale factor for the emoticon.
[out]resultThe url for the emoticon.
Returns
  • TTV_EC_SUCCESS: The url was returned in result.

◆ GetMessageFlushInterval()

uint64_t ttv::chat::ChatAPI::GetMessageFlushInterval ( ) const

Get the current interval duration for flushing messages.

Returns
0 if there was an error, otherwise, the interval duration in milliseconds.

◆ GetModuleName()

virtual std::string ttv::chat::ChatAPI::GetModuleName ( ) const
overridevirtual

Returns the name of the module.

Implements ttv::IModule.

◆ GetRequiredAuthScopes()

static void ttv::chat::ChatAPI::GetRequiredAuthScopes ( std::vector< std::string > &  scopes)
static

Adds to the scopes list the required scopes that Chat API requires.

Parameters
[in,out]scopesThe old values in scopes, with the new scopes required by Chat API appended to the end.

◆ GetState()

virtual State ttv::ModuleBase::GetState ( ) const
overridevirtualinherited

Returns the current state of the module.

Implements ttv::IModule.

◆ GetThreadForUser()

TTV_ErrorCode ttv::chat::ChatAPI::GetThreadForUser ( UserId  userId,
const std::string &  threadId,
std::shared_ptr< ChatUserThread > &  thread 
)
private

◆ GetUserBlocked()

TTV_ErrorCode ttv::chat::ChatAPI::GetUserBlocked ( UserId  userId,
UserId  blockUserId,
bool &  blocked 
)

Check whether a user is blocked or not.

Parameters
[in]userIdThe currently logged in user.
[in]blockedUserIdThe other user that we're checking if blocked.
[out]blockedTrue if blockUserId is blocked by userId.
Returns
  • TTV_EC_SUCCESS: Successfully returned the result in blocked.
  • TTV_EC_NOT_INITIALIZED: Chat API is not initialized.
  • TTV_EC_INVALID_USERID: There is not a properly logged in user.
  • TTV_EC_SHUT_DOWN: The chat module is shut down.

◆ GetUserThreadsForUser()

TTV_ErrorCode ttv::chat::ChatAPI::GetUserThreadsForUser ( UserId  userId,
std::shared_ptr< ChatUserThreads > &  userThreads 
)
private

◆ Initialize()

virtual TTV_ErrorCode ttv::chat::ChatAPI::Initialize ( const InitializeCallback callback)
overridevirtual

Initializes the module asynchronously. The module state will be reported in IModuleListener::ModuleStateChanged(). No other calls should be made into the module until the module state is either State::Initialized or State::Uninitialized. You should only expect changes to the module state if this method succeeds.

Reimplemented from ttv::ModuleBase.

◆ Invoke()

template<typename T >
void ttv::ModuleBase::Invoke ( std::function< void(std::shared_ptr< T >)>  callback)
inlineprotectedinherited

Invokes the callback for the module listeners.

◆ ModUser()

TTV_ErrorCode ttv::chat::ChatAPI::ModUser ( UserId  userId,
ChannelId  channelId,
const std::string &  modUserName,
const ModUserCallback callback 
)

Mods the given user name in the given channel.

Parameters
[in]userIdThe id of the user who is granting the mod privilege.
[in]channelIdThe id of the channel that the target user is becoming a mod of.
[in]modUserNameThe name of the user who is becoming a mod.
[in]callbackReceives an error code indicating the success of the modding.
Returns
  • TTV_EC_SUCCESS: We've sent the mod request successfully.
  • TTV_EC_NOT_INITIALIZED: We haven't initialized properly.
  • TTV_EC_NEED_TO_LOGIN: We aren't logged in properly.
  • TTV_EC_INVALID_ARG: If any input arguments are invalid.

◆ NotifyStateChange()

void ttv::ModuleBase::NotifyStateChange ( )
protectedinherited

◆ OptInToBroadcasterLanguageChat()

TTV_ErrorCode ttv::chat::ChatAPI::OptInToBroadcasterLanguageChat ( UserId  userId,
ChannelId  channelId,
const std::string &  language 
)

Opt into the channel's broadcaster chat language.

Parameters
[in]userIdThe currently logged in user that is opting into.
[in]channelIdThe channel that the user is opting into for the chat language.
[in]languageThe language of the channel.
Returns
  • TTV_EC_SUCCESS: Successfully opted into the broadcaster chat language.
  • TTV_EC_NOT_INITIALIZED: Chat API is not initialized.
  • TTV_EC_INVALID_LOGIN: User is not logged in.
  • TTV_EC_NEED_TO_LOGIN: Chat channel for user not found.
  • TTV_EC_INVALID_CHANNEL_ID: Channel ID cannot be 0.
  • TTV_EC_CHAT_NOT_IN_CHANNEL: We are not connected to the channel.
  • TTV_EC_INVALID_ARG: language cannot be the empty string.

◆ RegisterInitializeCallback()

void ttv::ModuleBase::RegisterInitializeCallback ( const InitializeCallback callback)
inlineprotectedinherited

◆ RegisterShutdownCallback()

void ttv::ModuleBase::RegisterShutdownCallback ( const ShutdownCallback callback)
inlineprotectedinherited

◆ SendChatMessage()

TTV_ErrorCode ttv::chat::ChatAPI::SendChatMessage ( UserId  userId,
ChannelId  channelId,
const std::string &  message 
)

Send a message to the channel's chat.

Parameters
[in]userIdThe currently logged in user that is sending the message.
[in]channelIdThe channel of the chat the user is sending a message to.
[in]messageThe content of the message being sent.
Returns
  • TTV_EC_SUCCESS: Sent message successfully.
  • TTV_EC_NOT_INITIALIZED: Chat API is not initialized.
  • TTV_EC_INVALID_CHANNEL_ID: Channel id cannot be 0.
  • TTV_EC_INVALID_ARG: Message cannot be the empty string.
  • TTV_EC_CHAT_NOT_IN_CHANNEL: Not connected to the channel.
  • TTV_EC_CHAT_ANON_DENIED: Anonymous user is not allowed to chat.
  • TTV_EC_CHAT_TOO_MANY_REQUESTS: Too many messages are already queued up to be sent.
  • TTV_EC_CHAT_RESTRICTED: Message does not follow broadcaster language restriction.
  • TTV_WRN_CHAT_MESSAGE_SPAM_DISCARDED: Messages are being sent to quickly.

◆ SendMessageToUser()

TTV_ErrorCode ttv::chat::ChatAPI::SendMessageToUser ( UserId  userId,
UserId  otherUserId,
const std::string &  message,
WhisperMessage placeholderMessage,
const SendMessageCallback callback 
)

Sends a private message from one user to another. Synchronously generates a placeholder message to use until the send is complete.

Parameters
[in]userIdThe currently logged in user that is sending the whisper.
[in]otherUserIdThe user the message is being sent to.
[in]messageThe message contents to send.
[out]placeholderMessageThe message object to be used as a placeholder until the callback returns the real message.
[in]callbackFunction that receives the ID of the new message.
Returns
  • TTV_EC_SUCCESS: Sent request to send the message successfully.
  • TTV_EC_NOT_INITIALIZED: Chat API is not initialized.
  • TTV_EC_INVALID_ARG: Message cannot be the empty string.
  • TTV_EC_FEATURE_DISABLED: Conversations are disabled.
  • TTV_EC_INVALID_USERID: There is not a properly logged in user / user cannot whisper themselves.
  • TTV_EC_NEED_TO_LOGIN: User is not properly logged in.
  • TTV_EC_SHUT_DOWN: Unable to find the chat threads for the user.
  • TTV_EC_USERINFO_NOT_AVAILABLE: User is the anonymous user.

◆ SetBroadcasterLanguageChatEnabled()

TTV_ErrorCode ttv::chat::ChatAPI::SetBroadcasterLanguageChatEnabled ( UserId  userId,
ChannelId  channelId,
bool  enabled,
const SetBroadcasterLanguageChatEnabledCallback callback 
)

Enables/disables the broadcaster language setting.

Parameters
[in]userIdThe currently logged in user that is changing the channel's broadcaster language chat settings.
[in]channelIdThe channel whose settings are being changed.
[in]enabledWhether to enable or disable the broadcaster language chat settings.
[in]callbackFunction that receives whether changing the broadcaster language chat settings was successful.
Returns
  • TTV_EC_SUCCESS: Successfully enabled/disabled the broadcaster language chat settings.
  • TTV_EC_NOT_INITIALIZED: Chat API is not initialized.
  • TTV_EC_INVALID_LOGIN: User is not logged in.
  • TTV_EC_NEED_TO_LOGIN: Chat channel for user not found.
  • TTV_EC_INVALID_CHANNEL_ID: Channel ID cannot be 0.
  • TTV_EC_CHAT_NOT_IN_CHANNEL: We are not connected to the channel.

◆ SetChatObjectFactory()

void ttv::chat::ChatAPI::SetChatObjectFactory ( const std::shared_ptr< IChatObjectFactory > &  factory)

Set the chat object factory.

Parameters
[in]factorySet the chat object factory. If factory is null, Chat API will use a default implementation.

◆ SetCoreApi()

TTV_ErrorCode ttv::chat::ChatAPI::SetCoreApi ( const std::shared_ptr< CoreAPI > &  coreApi)

Sets the pointer to the core API.

Precondition
Needs to be called before Initialize().
Parameters
[in]coreApiA non-null pointer to the core API.
Returns
  • TTV_EC_SUCCESS: The core api was set.
  • TTV_EC_ALREADY_INITIALIZED: Chat API is already initialized.

◆ SetEnabledFeatures()

TTV_ErrorCode ttv::chat::ChatAPI::SetEnabledFeatures ( const FeatureFlags features)

Set the enabled features for chat.

Precondition
Needs to be called before Initalize().
Parameters
[in]featuresRepresents the features that should be enabled.
Returns
  • TTV_EC_SUCCESS: The feature flags were set.
  • TTV_EC_ALREADY_INITIALIZED: Chat API is already initialized.

◆ SetLastMessageReadId()

TTV_ErrorCode ttv::chat::ChatAPI::SetLastMessageReadId ( UserId  userId,
const std::string &  threadId,
MessageId  lastReadMessageId,
const SetLastMessageReadIdCallback callback 
)

Set the last read message in a thread.

Parameters
[in]userIdThe currently logged in user who is setting the message as read.
[in]threadIdThe thread that is being set as read.
[in]lastReadMessageIdThe message in the thread that is being set as the last message read.
[in]callbackFunction that receives whether setting the last read was successful.
Returns
  • TTV_EC_SUCCESS: Successfully sent the request to set the last message read.
  • TTV_EC_NOT_INITIALIZED: Chat API is not initialized.
  • TTV_EC_FEATURE_DISABLED: Conversations are disabled.
  • TTV_EC_INVALID_USERID: There is not a properly logged in user.
  • TTV_EC_SHUT_DOWN: Unable to find the chat threads for the user.
  • TTV_EC_CHAT_INVALID_CHAT_THREAD_ID: Cannot find the given thread for the user.
  • TTV_EC_NEED_TO_LOGIN: User is not logged in.

◆ SetListener()

TTV_ErrorCode ttv::chat::ChatAPI::SetListener ( const std::shared_ptr< IChatAPIListener > &  listener)

Set the Chat API listener.

Precondition
Needs to be called before Initalize().
Parameters
[in]listenerA pointer to the chat API listener.
Returns
  • TTV_EC_SUCCESS: The listener was set.
  • TTV_EC_ALREADY_INITIALIZED: Chat API is already initialized.

◆ SetMessageFlushInterval()

TTV_ErrorCode ttv::chat::ChatAPI::SetMessageFlushInterval ( uint64_t  milliseconds)

Set how interval duration for flushing messages.

Parameters
[in]millisecondsThe interval duration to be set to.
Returns
  • TTV_EC_SUCCESS: Successfully set the new message flush interval duration.
  • TTV_EC_SHUTTING_DOWN: Chat module is shutting down.

◆ SetThreadArchived()

TTV_ErrorCode ttv::chat::ChatAPI::SetThreadArchived ( UserId  userId,
const std::string &  threadId,
bool  archived,
const SetThreadArchivedCallback callback 
)

Archive/unarchive a thread.

Parameters
[in]userIdThe currently logged in user who is archiving/unarchiving their thread.
[in]threadIdThe thread that is being archived/unarchived.
[in]archivedWhether we're archiving or unarchiving the thread.
[in]callbackFunction that receives whether archiving/unarchiving the thread was successful.
Returns
  • TTV_EC_SUCCESS: Successfully sent the request to archive/unarchive the thread.
  • TTV_EC_NOT_INITIALIZED: Chat API is not initialized.
  • TTV_EC_FEATURE_DISABLED: Conversations are disabled.
  • TTV_EC_INVALID_USERID: There is not a properly logged in user.
  • TTV_EC_SHUT_DOWN: Unable to find the chat threads for the user.
  • TTV_EC_CHAT_INVALID_CHAT_THREAD_ID: Cannot find the given thread for the user.
  • TTV_EC_NEED_TO_LOGIN: User is not logged in.

◆ SetThreadMuted()

TTV_ErrorCode ttv::chat::ChatAPI::SetThreadMuted ( UserId  userId,
const std::string &  threadId,
bool  muted,
const SetThreadMutedCallback callback 
)

Mute/unmute a thread.

Parameters
[in]userIdThe currently logged in user who is muting/unmuting their thread.
[in]threadIdThe thread that is being muted/unmuted.
[in]mutedWhether we're muting or unmuting the thread.
[in]callbackFunction that receives whether muting/unmuting the thread was successful.
Returns
  • TTV_EC_SUCCESS: Successfully sent the request to mute/unmute the thread.
  • TTV_EC_NOT_INITIALIZED: Chat API is not initialized.
  • TTV_EC_FEATURE_DISABLED: Conversations are disabled.
  • TTV_EC_INVALID_USERID: There is not a properly logged in user.
  • TTV_EC_SHUT_DOWN: Unable to find the chat threads for the user.
  • TTV_EC_CHAT_INVALID_CHAT_THREAD_ID: Cannot find the given thread for the user.
  • TTV_EC_NEED_TO_LOGIN: User is not logged in.

◆ SetTokenizationOptions()

TTV_ErrorCode ttv::chat::ChatAPI::SetTokenizationOptions ( const TokenizationOptions options)

Set the tokenization options for messages in chat.

Precondition
Needs to be called before Initalize().
Parameters
[in]featuresLists which tokenization options are set.
Returns
  • TTV_EC_SUCCESS: The tokenization options were set.
  • TTV_EC_ALREADY_INITIALIZED: Chat API is already initialized.

◆ SetUserThreadsListener()

TTV_ErrorCode ttv::chat::ChatAPI::SetUserThreadsListener ( UserId  userId,
const std::shared_ptr< IChatUserThreadsListener > &  listener 
)

Set the tokenization options for messages in chat.

Precondition
Needs to be called before Initalize().
Parameters
[in]featuresLists which tokenization options are set.
Returns
  • TTV_EC_SUCCESS: The tokenization options were set.
  • TTV_EC_ALREADY_INITIALIZED: Chat API is already initialized.

◆ Shutdown()

virtual TTV_ErrorCode ttv::chat::ChatAPI::Shutdown ( const ShutdownCallback callback)
overridevirtual

Initiates an asynchronous shutdown of the module. The module state will be reported in IModuleListener::ModuleStateChanged(). No other calls should be made into the module until the module state is either State::Initialized or State::Uninitialized. All modules that depend on this module need to be shutdown first. You should only expect changes to the module state if this method succeeds.

Reimplemented from ttv::ModuleBase.

◆ UnbanUser()

TTV_ErrorCode ttv::chat::ChatAPI::UnbanUser ( UserId  userId,
ChannelId  channelId,
const std::string &  bannedUserName,
const UnbanUserCallback callback 
)

Unbans or untimeouts the given user name from the given channel.

Parameters
[in]userIdThe id of the user who is reverting the ban. Must be owner or moderator of the channel.
[in]channelIdThe id of the channel the user is being unbanned from.
[in]bannedUserNameThe name of the user who is being unbanned.
[in]callbackReceives an error code indicating the unban's success.
Returns
  • TTV_EC_SUCCESS: We've sent the unban request successfully.
  • TTV_EC_NOT_INITIALIZED: We haven't initialized properly.
  • TTV_EC_NEED_TO_LOGIN: We aren't logged in properly.
  • TTV_EC_INVALID_ARG: If any input arguments are invalid.

◆ UnblockUser()

TTV_ErrorCode ttv::chat::ChatAPI::UnblockUser ( UserId  userId,
UserId  blockUserId,
const BlockChangeCallback callback 
)

Unblock another user.

Parameters
[in]userIdThe currently logged in user.
[in]blockUserIdThe user being unblocked.
[in]callbackFunction that receives whether the unblocking was successful.
Returns
  • TTV_EC_SUCCESS: Successfully sent the request to unblock the user.
  • TTV_EC_NOT_INITIALIZED: Chat API is not initialized.
  • TTV_EC_INVALID_USERID: There is not a properly logged in user.
  • TTV_EC_SHUT_DOWN: The chat module is shut down.

◆ UnmodUser()

TTV_ErrorCode ttv::chat::ChatAPI::UnmodUser ( UserId  userId,
ChannelId  channelId,
const std::string &  unmodUserName,
const UnmodUserCallback callback 
)

Unmods the given user name in the given channel.

Parameters
[in]userIdThe id of the user who is issuing the unmod request.
[in]channelIdThe id of the channel that the target user is being unmodded from.
[in]unmodUserNameThe name of the user who is being unmodded.
[in]callbackReceives an error code indicating the unmod's success.
Returns
  • TTV_EC_SUCCESS: We've sent the unmod request successfully.
  • TTV_EC_NOT_INITIALIZED: We haven't initialized properly.
  • TTV_EC_NEED_TO_LOGIN: We aren't logged in properly.
  • TTV_EC_INVALID_ARG: If any input arguments are invalid.

◆ Update()

virtual TTV_ErrorCode ttv::chat::ChatAPI::Update ( )
overridevirtual

Updates the internal state of the module and fires any pending callbacks.

Reimplemented from ttv::ModuleBase.

◆ UpdateUserColor()

TTV_ErrorCode ttv::chat::ChatAPI::UpdateUserColor ( UserId  userId,
const std::string &  color,
const UpdateUserColorCallback callback 
)

Changes the user's chat color.

Parameters
[in]userIdThe id of the user who is changing their color.
[in]colorThe new chat color of the user.
[in]callbackReceives an error code indicating the change's success.
Returns
  • TTV_EC_SUCCESS: We've sent the ban request successfully.
  • TTV_EC_NOT_INITIALIZED: We haven't initialized properly.
  • TTV_EC_NEED_TO_LOGIN: We aren't logged in properly.
  • TTV_EC_INVALID_ARG: If any input arguments are invalid.

Member Data Documentation

◆ mBitsConfigRepository

std::shared_ptr<BitsConfigRepository> ttv::chat::ChatAPI::mBitsConfigRepository
private

◆ mChannelRepository

std::shared_ptr<ChannelRepository> ttv::chat::ChatAPI::mChannelRepository
private

The internal chat object factory.

◆ mChatObjectFactory

std::shared_ptr<IChatObjectFactory> ttv::chat::ChatAPI::mChatObjectFactory
private

◆ mCoreApi

std::shared_ptr<CoreAPI> ttv::chat::ChatAPI::mCoreApi
private

◆ mCoreApiClient

std::shared_ptr<CoreApiClient> ttv::chat::ChatAPI::mCoreApiClient
private

◆ mEnabledFeatures

FeatureFlags ttv::chat::ChatAPI::mEnabledFeatures
private

The task runner to use for block lists. Once we rework the way httprequest queueing and retried works we can use the general one.

◆ mInternalData

std::shared_ptr<ChatAPIInternalData> ttv::chat::ChatAPI::mInternalData
private

◆ mLastReportedState

State ttv::ModuleBase::mLastReportedState
protectedinherited

◆ mListeners

EventSource<IModuleListener> ttv::ModuleBase::mListeners
protectedinherited

The registered listeners. These listeners extend IModuleListener and will be of the type required for the module.

◆ mSettingRepository

std::shared_ptr<SettingRepository> ttv::chat::ChatAPI::mSettingRepository
private

The set of all local users.

◆ mState

State ttv::ModuleBase::mState
protectedinherited

◆ mTaskHost

std::shared_ptr<ChatAPITaskHost> ttv::chat::ChatAPI::mTaskHost
private

◆ mTaskRunner

std::shared_ptr<TaskRunner> ttv::chat::ChatAPI::mTaskRunner
private

◆ mTokenizationOptions

TokenizationOptions ttv::chat::ChatAPI::mTokenizationOptions
private

◆ mUserBlocksTaskRunner

std::shared_ptr<TaskRunner> ttv::chat::ChatAPI::mUserBlocksTaskRunner
private

The general task runner to use for api calls.

◆ mUserRepository

std::shared_ptr<UserRepository> ttv::chat::ChatAPI::mUserRepository
private

The cache of channel info.


The documentation for this class was generated from the following file: