|
Twitch SDK (Internal)
|
#include <chatuserthreads.h>
Classes | |
| class | InternalThreadListener |
| class | PubSubTopicListener |
Public Types | |
| using | SendMessageCallback = std::function< void(TTV_ErrorCode ec, MessageId messageId)> |
| using | FetchThreadDataPageCallback = std::function< void(TTV_ErrorCode ec, const std::vector< ThreadData > &page, uint32_t total)> |
| using | FetchThreadDataCallback = std::function< void(TTV_ErrorCode ec, const ThreadData &data)> |
| using | FetchUnreadCountsCallback = std::function< void(TTV_ErrorCode ec, const UnreadThreadCounts &counts)> |
| enum | State { State::Uninitialized, State::Initialized, State::ShuttingDown, State::Inert } |
Public Member Functions | |
| ChatUserThreads (std::shared_ptr< User > user) | |
| virtual | ~ChatUserThreads () |
| void | SetTokenizationOptions (const TokenizationOptions &options) |
| void | SetUserRepository (std::shared_ptr< UserRepository > repository) |
| void | SetSettingRepository (std::shared_ptr< SettingRepository > settings) |
| void | SetBitsConfigRepository (std::shared_ptr< BitsConfigRepository > repository) |
| void | SetListener (std::shared_ptr< IChatUserThreadsListener > listener) |
| virtual TTV_ErrorCode | Initialize () override |
| virtual void | Update () override |
| virtual TTV_ErrorCode | Shutdown () override |
| virtual std::string | GetLoggerName () const override |
| virtual void | OnUserInfoFetchComplete (TTV_ErrorCode ec) override |
| TTV_ErrorCode | SendMessageToUser (UserId userId, const std::string &message, WhisperMessage &placeholderMessage, const SendMessageCallback &callback) |
| TTV_ErrorCode | FetchThreadDataPage (uint32_t offset, uint32_t pageSize, const FetchThreadDataPageCallback &callback) |
| TTV_ErrorCode | FetchThreadData (const std::string &threadId, const FetchThreadDataCallback &callback) |
| TTV_ErrorCode | RemoveThread (const std::string &threadId) |
| TTV_ErrorCode | RemoveThreadWithUser (UserId userId) |
| TTV_ErrorCode | FetchUnreadCounts (const FetchUnreadCountsCallback &callback) |
| TTV_ErrorCode | FetchChatDisplayInfo () |
| TTV_ErrorCode | FetchEmoteSets () |
| std::shared_ptr< ChatUserThread > | GetThread (const std::string &threadId) |
| virtual void | SetTaskRunner (std::shared_ptr< TaskRunner > taskRunner) |
| std::shared_ptr< TaskRunner > | GetTaskRunner () |
| virtual State | GetState () const override |
Static Public Member Functions | |
| static std::string | GenerateThreadId (UserId a, UserId b) |
| static std::string | GetComponentName () |
Protected Member Functions | |
| virtual bool | CheckShutdown () override |
| virtual void | CompleteShutdown () override |
| virtual void | OnUserLogInComplete (TTV_ErrorCode ec) |
| virtual void | OnUserLogOutComplete (TTV_ErrorCode ec) |
| virtual void | OnUserAuthenticationIssue (std::shared_ptr< const OAuthToken > oauthToken, TTV_ErrorCode ec) |
| void | Log (TTV_MessageLevel level, const char *format,...) |
| 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) |
Protected Attributes | |
| std::weak_ptr< User > | mUser |
| bool | mOAuthIssue |
| Whether or not the internal updates of the component are on hold because of an issue with the OAuth token. More... | |
| ClientServerValue< State > | mState |
| std::shared_ptr< TaskRunner > | mTaskRunner |
| std::vector< std::shared_ptr< Task > > | mRunningTasks |
| std::mutex | mTaskMutex |
| uint64_t | mShutdownTimeMilliseconds |
Private Member Functions | |
| void | OnTopicSubscribeStateChanged (const std::string &topic, PubSubClient::SubscribeState::Enum state, TTV_ErrorCode ec) |
| void | OnTopicMessageReceived (const std::string &topic, const json::Value &msg) |
| void | OnMetadataFetchComplete (ChatUserThread *source, TTV_ErrorCode ec) |
| void | OnRealtimeMessageReceived (ChatUserThread *source, const WhisperMessage &message) |
| void | OnParticipantsUpdated (ChatUserThread *source, const std::vector< ChatUserInfo > &participants) |
| void | OnMuteStatusChanged (ChatUserThread *source, bool muted) |
| void | OnUnreadMessageWindowChanged (ChatUserThread *source, MessageId lastMessageId, MessageId lastReadMessageId) |
| TTV_ErrorCode | SubscribeTopics () |
| TTV_ErrorCode | SendMessageWithThread (const std::shared_ptr< ChatUserThread > &thread, UserId otherUserId, const std::string &message, const SendMessageCallback &callback) |
| void | ProcessSentNonce (const std::string &nonce, MessageId messageId, TTV_ErrorCode ec) |
| void | UpdateCachedThreadWithLiveMessage (const WhisperMessage &message) |
| void | MergeThreads (const std::vector< ThreadData > &threadList) |
| std::shared_ptr< ChatUserThread > | CreateThread (const std::string &threadId, const ThreadData *data) |
| void | BumpThread (const std::string &threadId) |
| TTV_ErrorCode | SyncCachedThreads () |
| TTV_ErrorCode | TokenizeLocalMessage (const std::shared_ptr< User > &user, const std::string &message, const std::string &threadId, WhisperMessage &chatMessage) |
| TTV_ErrorCode | FetchBitsConfig () |
| void | RequestUnreadCounts () |
The collection of conversation threads from the perspective of a user.
| using ttv::chat::ChatUserThreads::FetchThreadDataCallback = std::function<void(TTV_ErrorCode ec, const ThreadData& data)> |
| using ttv::chat::ChatUserThreads::FetchThreadDataPageCallback = std::function<void(TTV_ErrorCode ec, const std::vector<ThreadData>& page, uint32_t total)> |
| using ttv::chat::ChatUserThreads::FetchUnreadCountsCallback = std::function<void(TTV_ErrorCode ec, const UnreadThreadCounts& counts)> |
| using ttv::chat::ChatUserThreads::SendMessageCallback = std::function<void(TTV_ErrorCode ec, MessageId messageId)> |
|
stronginherited |
| ttv::chat::ChatUserThreads::ChatUserThreads | ( | std::shared_ptr< User > | user | ) |
|
virtual |
|
private |
|
overrideprotectedvirtual |
Reimplemented from ttv::Component.
|
overrideprotectedvirtual |
Reimplemented from ttv::UserComponent.
|
protectedinherited |
|
private |
|
private |
| TTV_ErrorCode ttv::chat::ChatUserThreads::FetchChatDisplayInfo | ( | ) |
Forces a fetch of the user's color and enabled badges.
| TTV_ErrorCode ttv::chat::ChatUserThreads::FetchEmoteSets | ( | ) |
Forces a fetch of the user's avaiable emote set ids.
| TTV_ErrorCode ttv::chat::ChatUserThreads::FetchThreadData | ( | const std::string & | threadId, |
| const FetchThreadDataCallback & | callback | ||
| ) |
Asynchronously fetches the named thread. The OnThreadFetchComplete callback will be called with the result.
| TTV_ErrorCode ttv::chat::ChatUserThreads::FetchThreadDataPage | ( | uint32_t | offset, |
| uint32_t | pageSize, | ||
| const FetchThreadDataPageCallback & | callback | ||
| ) |
Asynchronously fetches the specified page. The OnPageFetchComplete callback will be called with the result.
| TTV_ErrorCode ttv::chat::ChatUserThreads::FetchUnreadCounts | ( | const FetchUnreadCountsCallback & | callback | ) |
Forces a fetch of the most recent unread counts.
|
inlinestatic |
|
overridevirtual |
Implements ttv::Component.
|
overridevirtualinherited |
Implements ttv::IComponent.
|
inlineinherited |
| std::shared_ptr<ChatUserThread> ttv::chat::ChatUserThreads::GetThread | ( | const std::string & | threadId | ) |
|
overridevirtual |
Reimplemented from ttv::UserComponent.
|
protectedinherited |
|
protectedinherited |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
protectedvirtualinherited |
|
overridevirtual |
Reimplemented from ttv::UserComponent.
|
protectedvirtualinherited |
|
protectedvirtualinherited |
|
private |
| TTV_ErrorCode ttv::chat::ChatUserThreads::RemoveThread | ( | const std::string & | threadId | ) |
Removes the thread from the cache, if it exists.
| TTV_ErrorCode ttv::chat::ChatUserThreads::RemoveThreadWithUser | ( | UserId | userId | ) |
Removes the 1:1 thread with the given user from the cache, if it exists.
|
private |
| TTV_ErrorCode ttv::chat::ChatUserThreads::SendMessageToUser | ( | UserId | userId, |
| const std::string & | message, | ||
| WhisperMessage & | placeholderMessage, | ||
| const SendMessageCallback & | callback | ||
| ) |
Sends a whisper to the given user. nonce: The unique id for the message which is used in other callbacks to confirm sending and deduplication.
|
private |
|
inline |
|
protectedvirtualinherited |
| void ttv::chat::ChatUserThreads::SetListener | ( | std::shared_ptr< IChatUserThreadsListener > | listener | ) |
|
protectedvirtualinherited |
| void ttv::chat::ChatUserThreads::SetSettingRepository | ( | std::shared_ptr< SettingRepository > | settings | ) |
|
protectedvirtualinherited |
|
virtualinherited |
Reimplemented in ttv::broadcast::Streamer, and ttv::social::FriendList.
|
inline |
|
inline |
|
overridevirtual |
Reimplemented from ttv::Component.
|
protectedinherited |
|
private |
|
private |
|
private |
|
overridevirtual |
Reimplemented from ttv::Component.
|
private |
|
private |
|
private |
|
private |
|
private |
When to refresh the content of cached threads.
|
private |
|
private |
|
private |
The cached user info for the local user.
|
private |
|
private |
|
private |
|
private |
|
private |
The maximum offset for loaded thread pages.
|
protectedinherited |
Whether or not the internal updates of the component are on hold because of an issue with the OAuth token.
|
private |
Sent message nonces on which we are waiting for an acknowledgement from the server.
|
private |
|
private |
|
private |
|
protectedinherited |
|
private |
|
protectedinherited |
|
protectedinherited |
|
mutableprotectedinherited |
|
protectedinherited |
|
private |
The ordered list of cached threads, sorted by decreasing timestamp.
|
private |
The mapping of thread id to thread.
|
private |
|
private |
|
private |
|
private |
When to update the unread count information from the backend.
|
private |
|
protectedinherited |
|
private |
When to fetch the enabled badges and user color info from the backend.
|
private |
|
private |
The topic used to subscribe for realtime whisper events.
1.8.13