|
Twitch SDK (Internal)
|
#include <socialapi.h>
Classes | |
| class | CoreApiClient |
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< ComponentContainer > | GetComponentContainer () |
Protected Attributes | |
| EventSource< IModuleListener > | mListeners |
| State | mState |
| State | mLastReportedState |
Private Member Functions | |
| void | CoreUserLoggedIn (std::shared_ptr< User > user) |
| void | CoreUserLoggedOut (std::shared_ptr< User > user) |
| TTV_ErrorCode | GetPresenceForUser (UserId userId, std::shared_ptr< Presence > &presence) |
| TTV_ErrorCode | GetFriendListForUser (UserId userId, std::shared_ptr< FriendList > &friendList) |
| void | CreateFriendListListener () |
| void | CreatePresenceListener () |
| virtual bool | CheckShutdown () override |
| virtual void | CompleteShutdown () override |
Private Attributes | |
| std::shared_ptr< CoreAPI > | mCoreApi |
| std::shared_ptr< ICoreApiClient > | mCoreApiClient |
| std::shared_ptr< SocialAPIInternalData > | mInternalData |
| std::shared_ptr< UserRepository > | mUserRepository |
| std::shared_ptr< TaskRunner > | mTaskRunner |
| FeatureFlags | mEnabledFeatures |
Provides the main social functionality.
The following properties must be set before calling Initialize().
| using ttv::social::SocialAPI::DismissRecommendedFriendCallback = std::function<void(TTV_ErrorCode ec)> |
| using ttv::social::SocialAPI::FetchFriendListCallback = std::function<void(TTV_ErrorCode ec, const std::vector<Friend>& friends)> |
| using ttv::social::SocialAPI::FetchFriendRequestsCallback = std::function<void(TTV_ErrorCode ec, const std::vector<FriendRequest>& requests)> |
| using ttv::social::SocialAPI::FetchFriendStatusCallback = std::function<void(TTV_ErrorCode ec, FriendStatus status)> |
| using ttv::social::SocialAPI::FetchPresenceSettingsCallback = std::function<void(TTV_ErrorCode ec, const PresenceSettings& settings)> |
| using ttv::social::SocialAPI::FetchRecommendedFriendsCallback = std::function<void(TTV_ErrorCode ec, const std::vector<UserInfo>& recommendedFriends)> |
| using ttv::social::SocialAPI::FetchUnreadFriendRequestCountCallback = std::function<void(TTV_ErrorCode ec, uint32_t requestCount)> |
|
inherited |
| using ttv::social::SocialAPI::MarkAllFriendRequestsReadCallback = std::function<void(TTV_ErrorCode ec)> |
| using ttv::social::SocialAPI::PostPresenceCallback = std::function<void(TTV_ErrorCode ec)> |
| using ttv::social::SocialAPI::SetPresenceSettingsCallback = std::function<void(TTV_ErrorCode ec)> |
|
inherited |
| using ttv::social::SocialAPI::UpdateFriendshipCallback = std::function<void(TTV_ErrorCode ec, UpdateFriendResult result, FriendStatus status)> |
|
stronginherited |
| ttv::social::SocialAPI::SocialAPI | ( | ) |
|
virtual |
| TTV_ErrorCode ttv::social::SocialAPI::AddPlayingActivity | ( | UserId | userId, |
| GameId | gameId, | ||
| const std::string & | gameDisplayContext, | ||
| PresenceActivityToken & | activityToken | ||
| ) |
Adds a playing activity to the user's list of activities. gameId is the id of the game being played. gameDisplayContext is an optional string that specifies additional context about the game. Returns a unique token that corresponds to that activity.
| TTV_ErrorCode ttv::social::SocialAPI::AddWatchingActivity | ( | UserId | userId, |
| ChannelId | channelId, | ||
| PresenceActivityToken & | activityToken | ||
| ) |
Adds a watching activity to the user's list of activities. channelId is the id of the channel being watched. Returns a unique token that corresponds to that activity.
|
overrideprivatevirtual |
Reimplemented from ttv::ModuleBase.
|
overrideprivatevirtual |
Reimplemented from ttv::ModuleBase.
|
private |
|
private |
|
private |
|
private |
| TTV_ErrorCode ttv::social::SocialAPI::DismissRecommendedFriend | ( | UserId | userId, |
| UserId | dismissUserId, | ||
| const DismissRecommendedFriendCallback & | callback | ||
| ) |
Initiates an async dimissal of the named user from the recommended friend list. The result will be notified via ISocialAPIListener::SocialDismissRecommendedFriendComplete.
| TTV_ErrorCode ttv::social::SocialAPI::FetchFriendList | ( | UserId | userId, |
| const FetchFriendListCallback & | callback | ||
| ) |
Initiates an async retrieval of the friend list. The result will be notified via ISocialAPIListener::SocialFetchFriendListComplete.
| TTV_ErrorCode ttv::social::SocialAPI::FetchFriendRequests | ( | UserId | userId, |
| const FetchFriendRequestsCallback & | callback | ||
| ) |
Initiates an async retrieval of outstanding friend requests. The result will be notified via ISocialAPIListener::SocialFetchFriendRequestsComplete.
| TTV_ErrorCode ttv::social::SocialAPI::FetchFriendStatus | ( | UserId | userId, |
| UserId | otherUserId, | ||
| const FetchFriendStatusCallback & | callback | ||
| ) |
Initiates an async retrieval of the relationship between two users. The result will be notified via the passed-in callback. This does not update any internal cache.
| TTV_ErrorCode ttv::social::SocialAPI::FetchPresenceSettings | ( | UserId | userId, |
| const FetchPresenceSettingsCallback & | callback | ||
| ) |
Initiates an async retrieval of presence settings from the backend. The result will be returned via the passed-in callback.
| TTV_ErrorCode ttv::social::SocialAPI::FetchRecommendedFriends | ( | UserId | userId, |
| const FetchRecommendedFriendsCallback & | callback | ||
| ) |
Initiates an async retrieval of recommended friends. The result will be notified via ISocialAPIListener::SocialFetchRecommendedFriendsComplete.
| TTV_ErrorCode ttv::social::SocialAPI::FetchUnreadFriendRequestCount | ( | UserId | userId, |
| const FetchUnreadFriendRequestCountCallback & | callback | ||
| ) |
Initiates an async retrieval of the number of unread friend requests. The result will be notified via ISocialAPIListener::SocialFetchUnreadFriendRequestsCountComplete.
| TTV_ErrorCode ttv::social::SocialAPI::GetAutomaticPresencePostingEnabled | ( | UserId | userId, |
| bool & | enabled | ||
| ) |
Determines whether or not the presence system is automatically posting the user's presence.
|
inlineprotectedinherited |
Returns the common ComponentContainer which hosts all components which live at the module level.
|
private |
|
overridevirtual |
Returns the name of the module.
Implements ttv::IModule.
|
private |
|
overridevirtualinherited |
Returns the current state of the module.
Implements ttv::IModule.
|
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.
|
inlineprotectedinherited |
Invokes the callback for the module listeners.
| TTV_ErrorCode ttv::social::SocialAPI::MarkAllFriendRequestsRead | ( | UserId | userId, |
| const MarkAllFriendRequestsReadCallback & | callback | ||
| ) |
Asynchronously marks all friend requests as read. The result will be notified via ISocialAPIListener::SocialMarkAllFriendRequestsReadComplete. NOTE: This does not reject any requsts.
|
protectedinherited |
| TTV_ErrorCode ttv::social::SocialAPI::PostPresence | ( | UserId | userId, |
| const PostPresenceCallback & | callback | ||
| ) |
Manually pings the backend presence service to indicate that the client is still alive. This normally does not need to be done since presence is automatically maintained internally. Use this only in circumstances where the client was offline for a period of time. The result will be returned via the passed-in callback.
|
inlineprotectedinherited |
|
inlineprotectedinherited |
| TTV_ErrorCode ttv::social::SocialAPI::RemoveActivity | ( | UserId | userId, |
| PresenceActivityToken | activityToken | ||
| ) |
Removes the activity that corresponds to the passed in activity token.
| TTV_ErrorCode ttv::social::SocialAPI::SetAutomaticPresencePostingEnabled | ( | UserId | userId, |
| bool | enabled | ||
| ) |
Specifies whether or not the presence system should automatically posting the user's presence.
| TTV_ErrorCode ttv::social::SocialAPI::SetCoreApi | ( | const std::shared_ptr< CoreAPI > & | coreApi | ) |
| TTV_ErrorCode ttv::social::SocialAPI::SetEnabledFeatures | ( | const FeatureFlags & | features | ) |
| TTV_ErrorCode ttv::social::SocialAPI::SetListener | ( | const std::shared_ptr< ISocialAPIListener > & | listener | ) |
| TTV_ErrorCode ttv::social::SocialAPI::SetPresenceSessionAvailability | ( | UserId | userId, |
| PresenceSessionAvailability | availability | ||
| ) |
Sets the presence availability mode for the given user.
| TTV_ErrorCode ttv::social::SocialAPI::SetPresenceSettings | ( | UserId | userId, |
| const PresenceSettings & | settings, | ||
| const SetPresenceSettingsCallback & | callback | ||
| ) |
Applies the given presence settings.
| [in] | userId | The id of the user we're changing the presence settings of. |
| [in] | settings | Settings include a user's presence override and whether they're sharing their current activity. A presence override means that the user will appear as that presence availability to their friends regardless of the states of their sessions. If a user sets their presence as UserAvailability::None, then their sessions determine their availability. |
| [in] | callback | Callback that returns the result PresenceSettings. |
|
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.
|
overridevirtual |
Updates the internal state of the module and fires any pending callbacks.
Reimplemented from ttv::ModuleBase.
| TTV_ErrorCode ttv::social::SocialAPI::UpdateFriendship | ( | UserId | userId, |
| UserId | otherUserId, | ||
| FriendAction | action, | ||
| const UpdateFriendshipCallback & | callback | ||
| ) |
Initiates an async change of status with a friend. This is used to send, accept and reject friend requests and remove an existing friend. The result will be notified via ISocialAPIListener::SocialUpdateFriendshipComplete.
|
private |
|
private |
|
private |
|
private |
|
protectedinherited |
|
protectedinherited |
The registered listeners. These listeners extend IModuleListener and will be of the type required for the module.
|
protectedinherited |
|
private |
|
private |
1.8.13