|
Twitch SDK (Internal)
|
#include <chatapitaskhost.h>
Public Types | |
| 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, std::vector< std::string > &&modNames, std::string &&nextCursor)> |
| using | FetchBadgesCallback = std::function< void(TTV_ErrorCode ec, BadgeSet &&result)> |
| enum | State { State::Uninitialized, State::Initialized, State::ShuttingDown, State::Inert } |
Public Member Functions | |
| ChatAPITaskHost () | |
| TTV_ErrorCode | BanUser (UserId userId, ChannelId channelId, const std::string &bannedUserName, uint32_t duration, BanUserCallback &&callback) |
| TTV_ErrorCode | UnbanUser (UserId userId, ChannelId channelId, const std::string &unbannedUserName, UnbanUserCallback &&callback) |
| TTV_ErrorCode | ModUser (UserId userId, ChannelId channelId, const std::string &modUserName, ModUserCallback &&callback) |
| TTV_ErrorCode | UnmodUser (UserId userId, ChannelId channelId, const std::string &unmodUserName, UnmodUserCallback &&callback) |
| TTV_ErrorCode | UpdateUserColor (UserId userId, const std::string &color, UpdateUserColorCallback &&callback) |
| TTV_ErrorCode | FetchChannelModerators (ChannelId channelId, const std::string &cursor, FetchChannelModeratorsCallback &&callback) |
| TTV_ErrorCode | FetchGlobalBadges (const std::string &language, FetchBadgesCallback &&callback) |
| TTV_ErrorCode | FetchChannelBadges (ChannelId channelId, const std::string &language, FetchBadgesCallback &&callback) |
| void | SetUserRepository (const std::shared_ptr< UserRepository > &repository) |
| virtual std::string | GetLoggerName () const override |
| virtual void | SetTaskRunner (std::shared_ptr< TaskRunner > taskRunner) |
| std::shared_ptr< TaskRunner > | GetTaskRunner () |
| virtual State | GetState () const override |
| virtual TTV_ErrorCode | Initialize () override |
| virtual void | Update () override |
| virtual TTV_ErrorCode | Shutdown () override |
Protected Member Functions | |
| TTV_ErrorCode | StartTask (std::shared_ptr< Task > task) |
| void | CompleteTask (Task *task) |
| bool | IsTaskRunning (Task *task) const |
| virtual void | SetState (State state) |
| virtual void | SetClientState (State state) |
| virtual void | SetServerState (State state) |
| virtual bool | CheckShutdown () |
| virtual void | CompleteShutdown () |
Protected Attributes | |
| ClientServerValue< State > | mState |
| std::shared_ptr< TaskRunner > | mTaskRunner |
| std::vector< std::shared_ptr< Task > > | mRunningTasks |
| std::mutex | mTaskMutex |
| uint64_t | mShutdownTimeMilliseconds |
Private Attributes | |
| std::shared_ptr< UserRepository > | mUserRepository |
This class is used to call API endpoints for ChatAPI functions. A separate component is necessary to ensure we have properly finished running tasks when ChatAPI shuts down.
| using ttv::chat::ChatAPITaskHost::BanUserCallback = std::function<void(TTV_ErrorCode ec, BanUserError&& error)> |
| using ttv::chat::ChatAPITaskHost::FetchBadgesCallback = std::function<void(TTV_ErrorCode ec, BadgeSet&& result)> |
| using ttv::chat::ChatAPITaskHost::FetchChannelModeratorsCallback = std::function<void(TTV_ErrorCode ec, std::vector<std::string>&& modNames, std::string&& nextCursor)> |
| using ttv::chat::ChatAPITaskHost::ModUserCallback = std::function<void(TTV_ErrorCode ec, ModUserError&& error)> |
| using ttv::chat::ChatAPITaskHost::UnbanUserCallback = std::function<void(TTV_ErrorCode ec, UnbanUserError&& error)> |
| using ttv::chat::ChatAPITaskHost::UnmodUserCallback = std::function<void(TTV_ErrorCode ec, UnmodUserError&& error)> |
| using ttv::chat::ChatAPITaskHost::UpdateUserColorCallback = std::function<void(TTV_ErrorCode ec)> |
|
stronginherited |
| ttv::chat::ChatAPITaskHost::ChatAPITaskHost | ( | ) |
| TTV_ErrorCode ttv::chat::ChatAPITaskHost::BanUser | ( | UserId | userId, |
| ChannelId | channelId, | ||
| const std::string & | bannedUserName, | ||
| uint32_t | duration, | ||
| BanUserCallback && | callback | ||
| ) |
|
protectedvirtualinherited |
Reimplemented in ttv::PubSubClient, ttv::ComponentContainer, ttv::broadcast::Streamer, ttv::social::FriendList, ttv::chat::ChatUserThreads, ttv::UserRepository, ttv::social::Presence, ttv::broadcast::IngestTester, ttv::User, ttv::chat::ChatChannelSet, ttv::chat::BitsConfigRepository, ttv::chat::ChatUserBlockList, ttv::ChannelRepository, ttv::ChannelStatus, ttv::PubSubComponentBase, and ttv::ProfileImageStatus.
|
protectedvirtualinherited |
Reimplemented in ttv::PubSubClient, ttv::ComponentContainer, ttv::broadcast::Streamer, ttv::social::FriendList, ttv::chat::ChatUserThread, ttv::chat::ChatUserThreads, ttv::UserComponent, ttv::UserRepository, ttv::social::Presence, ttv::PubSubComponent< LISTENER >, ttv::PubSubComponent< IChatChannelPropertyListener >, ttv::PubSubComponent< IChannelChatRoomManagerListener >, ttv::PubSubComponent< IChannelListener >, ttv::PubSubComponent< IFollowersListener >, ttv::PubSubComponent< IChatRoomListener >, ttv::PubSubComponent< UserEmoticonSetsListener >, ttv::PubSubComponent< IChatRaidListener >, ttv::PubSubComponent< IBitsListener >, ttv::PubSubComponent< IChatRoomNotificationsListener >, ttv::PubSubComponent< ISubscribersListener >, ttv::broadcast::IngestTester, ttv::User, ttv::chat::ChatChannelSet, ttv::chat::BitsConfigRepository, ttv::chat::ChatRaid, ttv::ChannelRepository, ttv::chat::ChatReplay, ttv::ChannelStatus, and ttv::PubSubComponentBase.
|
protectedinherited |
| TTV_ErrorCode ttv::chat::ChatAPITaskHost::FetchChannelBadges | ( | ChannelId | channelId, |
| const std::string & | language, | ||
| FetchBadgesCallback && | callback | ||
| ) |
| TTV_ErrorCode ttv::chat::ChatAPITaskHost::FetchChannelModerators | ( | ChannelId | channelId, |
| const std::string & | cursor, | ||
| FetchChannelModeratorsCallback && | callback | ||
| ) |
| TTV_ErrorCode ttv::chat::ChatAPITaskHost::FetchGlobalBadges | ( | const std::string & | language, |
| FetchBadgesCallback && | callback | ||
| ) |
|
inlineoverridevirtual |
Implements ttv::Component.
|
overridevirtualinherited |
Implements ttv::IComponent.
|
inlineinherited |
|
overridevirtualinherited |
Implements ttv::IComponent.
Reimplemented in ttv::broadcast::Streamer, ttv::PubSubClient, ttv::ComponentContainer, ttv::UserComponent, ttv::UserRepository, ttv::social::FriendList, ttv::broadcast::IngestTester, ttv::User, ttv::chat::ChatUserThreads, ttv::social::Presence, ttv::chat::ChatReplay, ttv::chat::BitsStatus, ttv::chat::UserEmoticonSets, ttv::ChannelStatus, and ttv::PubSubComponentBase.
|
protectedinherited |
| TTV_ErrorCode ttv::chat::ChatAPITaskHost::ModUser | ( | UserId | userId, |
| ChannelId | channelId, | ||
| const std::string & | modUserName, | ||
| ModUserCallback && | callback | ||
| ) |
|
protectedvirtualinherited |
|
protectedvirtualinherited |
|
protectedvirtualinherited |
|
virtualinherited |
Reimplemented in ttv::broadcast::Streamer, and ttv::social::FriendList.
|
inline |
|
overridevirtualinherited |
Implements ttv::IComponent.
Reimplemented in ttv::PubSubClient, ttv::broadcast::Streamer, ttv::ComponentContainer, ttv::social::FriendList, ttv::UserRepository, ttv::social::Presence, ttv::broadcast::IngestTester, ttv::User, ttv::chat::ChatUserThreads, ttv::chat::BitsConfigRepository, ttv::chat::ChatUserBlockList, ttv::chat::ChatReplay, ttv::chat::ChatChannelSet, ttv::ChannelRepository, ttv::chat::BitsStatus, ttv::chat::UserEmoticonSets, and ttv::PubSubComponentBase.
|
protectedinherited |
| TTV_ErrorCode ttv::chat::ChatAPITaskHost::UnbanUser | ( | UserId | userId, |
| ChannelId | channelId, | ||
| const std::string & | unbannedUserName, | ||
| UnbanUserCallback && | callback | ||
| ) |
| TTV_ErrorCode ttv::chat::ChatAPITaskHost::UnmodUser | ( | UserId | userId, |
| ChannelId | channelId, | ||
| const std::string & | unmodUserName, | ||
| UnmodUserCallback && | callback | ||
| ) |
|
overridevirtualinherited |
Implements ttv::IComponent.
Reimplemented in ttv::PubSubClient, ttv::broadcast::Streamer, ttv::ComponentContainer, ttv::social::FriendList, ttv::chat::ChatUserThread, ttv::UserRepository, ttv::social::Presence, ttv::broadcast::IngestTester, ttv::User, ttv::chat::ChatUserThreads, ttv::chat::BitsConfigRepository, ttv::chat::ChatUserBlockList, ttv::chat::ChatReplay, ttv::chat::ChatChannelSet, ttv::ChannelRepository, ttv::chat::ChatRaid, ttv::chat::BitsStatus, ttv::chat::UserEmoticonSets, ttv::ChannelStatus, ttv::chat::ChatRoom, and ttv::ProfileImageStatus.
| TTV_ErrorCode ttv::chat::ChatAPITaskHost::UpdateUserColor | ( | UserId | userId, |
| const std::string & | color, | ||
| UpdateUserColorCallback && | callback | ||
| ) |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
mutableprotectedinherited |
|
protectedinherited |
|
private |
1.8.13