Twitch SDK (Internal)
Classes | Typedefs | Enumerations | Functions
ttv::social Namespace Reference

Classes

struct  BroadcastingActivity
 
struct  FeatureFlags
 
struct  Friend
 
class  FriendList
 
class  FriendListListenerProxy
 
struct  FriendRequest
 
class  ISocialAPIListener
 
struct  PlayingActivity
 
class  Presence
 
struct  PresenceActivity
 
class  PresenceListenerProxy
 
struct  PresenceSettings
 
struct  PresenceStatus
 
class  SocialAPI
 
class  SocialFriendRequestsTask
 
class  SocialGetFriendsPresenceTask
 
class  SocialPostPresenceTask
 
class  SocialPresenceSettingsTask
 
class  SocialRecommendedFriendsTask
 
class  SocialUpdateFriendTask
 
struct  WatchingActivity
 

Typedefs

using PresenceActivityToken = uint32_t
 

Enumerations

enum  PresenceUserAvailability { PresenceUserAvailability::Offline, PresenceUserAvailability::Online, PresenceUserAvailability::Away, PresenceUserAvailability::Busy }
 
enum  PresenceSessionAvailability { PresenceSessionAvailability::Offline, PresenceSessionAvailability::Online, PresenceSessionAvailability::Idle }
 
enum  FriendAction { FriendAction::SendRequest, FriendAction::AcceptRequest, FriendAction::RejectRequest, FriendAction::DeleteFriend }
 
enum  UpdateFriendResult {
  UpdateFriendResult::RequestSent, UpdateFriendResult::RequestAccepted, UpdateFriendResult::RequestNotAllowed, UpdateFriendResult::RequestNotFound,
  UpdateFriendResult::RequestRejected, UpdateFriendResult::RequestDeleted, UpdateFriendResult::FriendDeleted, UpdateFriendResult::FriendNotFound,
  UpdateFriendResult::AlreadyExists, UpdateFriendResult::Unknown
}
 
enum  FriendRequestRemovalReason {
  FriendRequestRemovalReason::Invalid, FriendRequestRemovalReason::SelfAccepted, FriendRequestRemovalReason::TargetAccepted, FriendRequestRemovalReason::SelfRejected,
  FriendRequestRemovalReason::TargetRejected
}
 
enum  FriendStatus {
  FriendStatus::NoRelation, FriendStatus::Blocked, FriendStatus::Blocks, FriendStatus::SentRequest,
  FriendStatus::ReceivedRequest, FriendStatus::Friends, FriendStatus::Unknown
}
 

Functions

bool ParsePresenceUserAvailability (const std::string &str, PresenceUserAvailability &result)
 
bool ParsePresenceSettingsAvailabilityOverride (const std::string &str, PresenceSettings::AvailabilityOverride &result)
 
TTV_ErrorCode GenerateActivityJson (const PresenceActivity &activity, json::Value &value)
 
TTV_ErrorCode CreatePresenceActivity (const json::Value &jObject, std::unique_ptr< PresenceActivity > &activity)
 
TTV_ErrorCode ToErrorCode (TTV_SocialErrorId errorId)
 
const char * SocialErrorToString (TTV_ErrorCode ec)
 
void GetSocialErrorCodeValues (std::vector< EnumValue > &result)
 

Typedef Documentation

◆ PresenceActivityToken

using ttv::social::PresenceActivityToken = typedef uint32_t

A unique token that is associated with an added presence activity. This is vended by the API when adding an activity, and the client passes this in when removing the activity.

Enumeration Type Documentation

◆ FriendAction

The type of action to take when updating friendship.

Enumerator
SendRequest 
AcceptRequest 
RejectRequest 
DeleteFriend 

◆ FriendRequestRemovalReason

Enumerator
Invalid 

The request doesn't exist.

SelfAccepted 

The local user accepted.

TargetAccepted 

The other user accepted.

SelfRejected 

The local user rejected.

TargetRejected 

The other user rejected.

◆ FriendStatus

Enumerator
NoRelation 

The users have no friendship, no blocking relationship, and no pending friend requests in either direction.

Blocked 

The target user is blocked by the client user.

Blocks 

The client user is blocked by the target user.

SentRequest 

The client user has a pending friend request out to the target user.

ReceivedRequest 

The target user has a pending friend request out to the client user.

Friends 

The users are in each others' friends list.

Unknown 

Some other unknown state.

◆ PresenceSessionAvailability

Represents a user's specific session's availability.

Enumerator
Offline 
Online 
Idle 

◆ PresenceUserAvailability

Represents a user's current availability. "Idle" is a deprecated user availability and will be parsed as Away.

Enumerator
Offline 
Online 
Away 
Busy 

◆ UpdateFriendResult

The outcome of a given friendship update.

Enumerator
RequestSent 

In response to sending a request. The request was successfully sent.

RequestAccepted 

In response to accepting a request. The request was successfuly accepted.

RequestNotAllowed 

In response to sending a request. Request could not be sent, due to one of the following: 1) The requesting user has too many friend requests in flight. 2) The requesting user has a full friends list. 3) The receiving user has blocked the requesting user.

RequestNotFound 

In response to accepting or rejecting a request. The request itself does not exist.

RequestRejected 

In response to rejecting a request. The request was successfully rejected.

RequestDeleted 

In response to deleting a request. The request was successfully deleted.

FriendDeleted 

In response to deleting a friend. The friend was successfully deleted.

FriendNotFound 

In response to deleting a friend. The friend was not found in the deleting user's friend list.

AlreadyExists 

In response to sending a friend request. The target user is already in the sender's friend list.

Unknown 

Some other unkown response.

Function Documentation

◆ CreatePresenceActivity()

TTV_ErrorCode ttv::social::CreatePresenceActivity ( const json::Value jObject,
std::unique_ptr< PresenceActivity > &  activity 
)

◆ GenerateActivityJson()

TTV_ErrorCode ttv::social::GenerateActivityJson ( const PresenceActivity activity,
json::Value value 
)

◆ GetSocialErrorCodeValues()

void ttv::social::GetSocialErrorCodeValues ( std::vector< EnumValue > &  result)

◆ ParsePresenceSettingsAvailabilityOverride()

bool ttv::social::ParsePresenceSettingsAvailabilityOverride ( const std::string &  str,
PresenceSettings::AvailabilityOverride result 
)

◆ ParsePresenceUserAvailability()

bool ttv::social::ParsePresenceUserAvailability ( const std::string &  str,
PresenceUserAvailability result 
)

◆ SocialErrorToString()

const char* ttv::social::SocialErrorToString ( TTV_ErrorCode  ec)

The error code string lookup for social. This is not normally used directly by clients. Use ttv::ErrorToString() instead.

◆ ToErrorCode()

TTV_ErrorCode ttv::social::ToErrorCode ( TTV_SocialErrorId  errorId)
inline

Converts a strongly typed TTV_SocialErrorId to TTV_ErrorCode so it can be handled generically.