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

Namespaces

 graphql
 
 json
 

Classes

struct  Badge
 
struct  BadgeEntitlement
 
struct  BadgeImage
 
struct  BadgeSet
 
struct  BadgeVersion
 
struct  BanUserError
 
class  BitsConfigRepository
 
class  BitsConfiguration
 
struct  BitsRange
 
struct  BitsReceivedEvent
 
struct  BitsSentEvent
 
class  BitsStatus
 
struct  BitsToken
 
class  ChannelChatRoomManager
 
class  ChatAddNewRoomTask
 
class  ChatAPI
 
class  ChatApiTask
 
class  ChatAPITaskHost
 
class  ChatBanUserTask
 
class  ChatChangeUserBlockTask
 
class  ChatChannel
 
struct  ChatChannelInfo
 
struct  ChatChannelListenerProxy
 
class  ChatChannelProperties
 
class  ChatChannelPropertyListenerProxy
 
struct  ChatChannelRestrictions
 
class  ChatChannelSet
 
class  ChatChannelUsersTask
 
class  ChatChannelWrapper
 
class  ChatConnection
 
class  ChatConnectionListenerProxy
 
class  ChatFetchChannelModeratorsTask
 
class  ChatFetchChannelRoomsTask
 
class  ChatGetBadgesTask
 
class  ChatGetBitsConfigTask
 
class  ChatGetBlockListTask
 
class  ChatGetDisplayInfoTask
 
class  ChatGetEmoticonsTask
 
class  ChatGetThreadMessagesTask
 
class  ChatGetUnreadMessageCountTask
 
class  ChatGetUserThreadsTask
 
class  ChatMessageHandler
 
class  ChatMessagePacer
 
struct  ChatModeInfo
 
class  ChatModUserTask
 
class  ChatNetworkEvent
 
class  ChatPropertiesTask
 
class  ChatRaid
 
class  ChatRaidTask
 
class  ChatReader
 
class  ChatReplay
 
class  ChatReplayDeleteTask
 
class  ChatReplayTask
 
class  ChatRoom
 
class  ChatRoomDeleteMessageTask
 
class  ChatRoomDeleteRoomTask
 
class  ChatRoomEditMessageTask
 
class  ChatRoomFetchInfoTask
 
class  ChatRoomFetchMessagesTask
 
struct  ChatRoomInfo
 
class  ChatRoomJoinChannelTask
 
class  ChatRoomLeaveChannelTask
 
struct  ChatRoomMessage
 
class  ChatRoomMessageHandler
 
class  ChatRoomNotifications
 
struct  ChatRoomPermissions
 
class  ChatRoomSendMessageTask
 
class  ChatRoomUpdateInfoTask
 
class  ChatRoomUpdateModeTask
 
class  ChatRoomUpdateViewTask
 
struct  ChatRoomView
 
class  ChatSendWhisperTask
 
class  ChatSession
 
class  ChatSetBroadcasterLanguageEnabledTask
 
class  ChatSocketTransport
 
class  ChatUnbanUserTask
 
class  ChatUpdateColorTask
 
class  ChatUpdateUserThreadTask
 
class  ChatUserBadges
 
class  ChatUserBlockList
 
struct  ChatUserInfo
 
class  ChatUserThread
 
class  ChatUserThreads
 
class  ChatWriter
 
struct  CreateRoomError
 
class  DefaultChatObjectFactory
 
struct  EmoteRange
 
struct  Emoticon
 
struct  EmoticonRange
 
struct  EmoticonSet
 
struct  EmoticonToken
 
struct  FeatureFlags
 
struct  FirstTimeChatterNotice
 
struct  FollowerAddedEvent
 
class  FollowersStatus
 
struct  HostTargetChange
 
class  IBitsListener
 
class  IBitsStatus
 
class  IChannelChatRoomManager
 
class  IChannelChatRoomManagerListener
 
class  IChatAPIListener
 
class  IChatChannel
 
class  IChatChannelListener
 
class  IChatChannelProperties
 
class  IChatChannelPropertyListener
 
class  IChatObjectFactory
 
class  IChatRaid
 
class  IChatRaidListener
 
class  IChatReceiveNetworkEvent
 
class  IChatReplay
 
class  IChatReplayListener
 
class  IChatRoom
 
class  IChatRoomListener
 
class  IChatRoomNotifications
 
class  IChatRoomNotificationsListener
 
class  IChatTransport
 
class  IChatTransportReader
 
class  IChatUserThreadsListener
 
class  IChatWriteNetworkEvent
 
class  IFollowersListener
 
class  IFollowersStatus
 
class  ISubscribersListener
 
class  ISubscribersStatus
 
struct  LiveChatMessage
 
struct  MentionRange
 
struct  MentionToken
 
struct  MessageBadge
 
struct  MessageInfo
 
class  MessageToken
 
struct  ModUserError
 
struct  RaidNotice
 
struct  RaidStatus
 
struct  ReplayMessage
 
struct  RestrictionReason
 
struct  RoomMentionInfo
 
struct  SendRoomMessageError
 
struct  SubscriberAddedEvent
 
class  SubscribersStatus
 
struct  SubscriptionNotice
 
struct  SubscriptionStatus
 
struct  TextToken
 
struct  ThreadData
 
struct  TokenizationOptions
 
struct  TokenRange
 
union  TokenRange.data
 
struct  UnbanUserError
 
struct  UnmodUserError
 
struct  UnraidNotice
 
class  UnreadThreadCache
 
struct  UnreadThreadCounts
 
struct  UpdateRoomError
 
struct  UpdateRoomModesError
 
struct  UrlRange
 
struct  UrlToken
 
class  UserEmoticonSets
 
class  UserEmoticonSetsListener
 
class  UserEmoticonSetsListenerProxy
 
struct  UserList
 
struct  UserMode
 
struct  WhisperMessage
 

Typedefs

using EmoticonId = uint32_t
 
using EmoticonSetId = uint32_t
 
using MessageId = uint32_t
 

Enumerations

enum  GraphQLErrorCode {
  GraphQLErrorCode::SUCCESS, GraphQLErrorCode::UNKNOWN, GraphQLErrorCode::AUTO_MOD_ENFORCEMENT_FAILED, GraphQLErrorCode::CHANNEL_NOT_FOUND,
  GraphQLErrorCode::DURATION_INVALID, GraphQLErrorCode::EMOTE_ONLY_MODE_ENFORCEMENT_FAILED, GraphQLErrorCode::FORBIDDEN, GraphQLErrorCode::MAX_ROOMS_LIMIT_EXCEEDED,
  GraphQLErrorCode::NAME_CONTAINS_INVALID_CHARACTERS, GraphQLErrorCode::NAME_INAPPROPRIATE, GraphQLErrorCode::NAME_LENGTH_INVALID, GraphQLErrorCode::R9K_MODE_ENFORCEMENT_FAILED,
  GraphQLErrorCode::RATE_LIMIT_FAILED, GraphQLErrorCode::ROOM_NOT_FOUND, GraphQLErrorCode::SLOW_MODE_DURATION_INVALID, GraphQLErrorCode::SLOW_MODE_ENFORCEMENT_FAILED,
  GraphQLErrorCode::SPAM_ENFORCEMENT_FAILED, GraphQLErrorCode::TARGET_ALREADY_BANNED, GraphQLErrorCode::TARGET_ALREADY_MOD, GraphQLErrorCode::TARGET_IS_ADMIN,
  GraphQLErrorCode::TARGET_IS_ANONYMOUS, GraphQLErrorCode::TARGET_IS_BROADCASTER, GraphQLErrorCode::TARGET_IS_CHAT_BANNED, GraphQLErrorCode::TARGET_IS_GLOBAL_MOD,
  GraphQLErrorCode::TARGET_IS_MOD, GraphQLErrorCode::TARGET_IS_SELF, GraphQLErrorCode::TARGET_IS_STAFF, GraphQLErrorCode::TARGET_NOT_BANNED,
  GraphQLErrorCode::TARGET_NOT_FOUND, GraphQLErrorCode::TARGET_NOT_MOD, GraphQLErrorCode::TOPIC_INAPPROPRIATE, GraphQLErrorCode::TOPIC_LENGTH_INVALID,
  GraphQLErrorCode::USER_CHAT_BANNED, GraphQLErrorCode::USER_CHAT_TIMED_OUT, GraphQLErrorCode::USER_SUSPENDED, GraphQLErrorCode::ZALGO_ENFORCEMENT_FAILED
}
 
enum  ChatChannelState { ChatChannelState::Disconnected, ChatChannelState::Connecting, ChatChannelState::Connected, ChatChannelState::Disconnecting }
 
enum  ChatMode { ChatMode::Slow, ChatMode::R9k, ChatMode::EmotesOnly }
 
enum  ChatReplayState { ChatReplayState::Paused, ChatReplayState::Playing, ChatReplayState::Buffering, ChatReplayState::NoMessagesForVod }
 
enum  RoomRole { RoomRole::Unknown, RoomRole::Everyone, RoomRole::Subscriber, RoomRole::Moderator }
 
enum  TokenRangeEnum { TOKEN_RANGE_TYPE_URL, TOKEN_RANGE_TYPE_MENTION, TOKEN_RANGE_TYPE_EMOTICON, TOKEN_RANGE_TYPE_BITS }
 

Functions

const char * ChatErrorToString (TTV_ErrorCode ec)
 
void GetChatErrorCodeValues (std::vector< EnumValue > &result)
 
bool TokensEqual (const std::unique_ptr< MessageToken > &lhs, const std::unique_ptr< MessageToken > &rhs)
 
Color GetRandomUserColor (const std::string &username)
 
SubscriptionStatus ParseSubscriptionStatus (const std::string &str)
 
UserMode ParseUserType (const std::string &str)
 
void UnescapeEmoticonToken (std::string &token)
 
bool SortTokenRangesByTypeThenRangeNum (const TokenRange &a, const TokenRange &b)
 
bool SortTokenRangesByStartIndex (const TokenRange &a, const TokenRange &b)
 
bool SortEmoticonRangesByEmoticonId (const TokenRange &a, const TokenRange &b)
 
void RemoveOverlappingRanges (std::vector< TokenRange > &ranges)
 
void AdjustByteRangesToUtf8Ranges (std::vector< TokenRange > &ranges, const std::string &message)
 
void AdjustUtf8RangesToByteRanges (std::vector< TokenRange > &ranges, const std::string &message)
 
bool ParseEmotesMessageTag (const std::string &emotesMessageTag, std::map< EmoticonId, std::vector< EmoteRange >> &result)
 
bool ParseBadgesMessageTag (const std::string &messageTag, std::vector< std::pair< std::string, std::string >> &result)
 
bool GenerateBadgesMessageTag (const std::vector< std::pair< std::string, std::string >> &badges, std::string &result)
 
bool TokenizeLocalMessage (const std::shared_ptr< User > &user, ChannelId channelId, const std::string &message, std::string &emotesMessageTag, std::string &badgesMessageTag)
 
void TokenizeServerMessage (const std::string &message, const TokenizationOptions &tokenizationOptions, const std::string &messageTags, const std::shared_ptr< BitsConfiguration > &bitsConfig, const std::vector< std::string > &localUserNames, MessageInfo &tokenizedMessage)
 
void TokenizeServerMessage (const std::string &message, const TokenizationOptions &tokenizationOptions, const std::map< EmoticonId, std::vector< EmoteRange >> &emoticonRanges, const std::vector< std::string > &localUserNames, MessageInfo &tokenizedMessage)
 
void TokenizeServerMessage (const std::string &message, const TokenizationOptions &tokenizationOptions, const std::map< EmoticonId, std::vector< EmoteRange >> &emoticonRanges, const std::shared_ptr< BitsConfiguration > &bitsConfig, const std::vector< std::string > &localUserNames, MessageInfo &tokenizedMessage)
 
TTV_ErrorCode GetEmoticonUrl (uint32_t emoticonId, float scale, std::string &result)
 
int IrcStringGetWord (char *dst, const char *src, int maxLen, const char **ppEnd)
 
const char * IrcStringSkipSpaces (const char *psz)
 
bool IsChannelString (const std::string &channel)
 
std::string GetPrefixNick (const std::string &prefix)
 
std::string GetPrefixHost (const std::string &prefix)
 
std::string GetPrefixIdent (const std::string &prefix)
 
std::string StripNickModes (const std::string &nick, const std::string &modeChars)
 
std::string StripNickModesAndInvalidChars (const std::string &nick, const std::string &modeChars)
 
bool NickHasMode (const std::string &nick, char mode)
 
bool IsTwitchChatUrl (const std::string &url)
 
bool IsSimpleWordCharacter (char ch)
 
std::string GetWord (const std::string &str, uint32_t start, bool getRest, uint32_t &end)
 
std::string ReplaceSubstring (const std::string &source, const std::string &target, const std::string &with)
 
std::string UnescapeMessageTag (const std::string &escapedMessageTag)
 
bool Compare (const std::string &one, const std::string &two, bool caseSensitive)
 
bool IsSlashCommandMessage (const std::string &message)
 
bool ParseParticipantJson (const ttv::json::Value &jParticipant, ChatUserInfo &user)
 
bool ParseThreadJson (const ttv::json::Value &jThread, const TokenizationOptions &tokenizationOptions, const std::shared_ptr< BitsConfiguration > &bitsConfig, const std::vector< std::string > &localUserNames, ThreadData &result)
 
bool ParseRaidStatusJson (const ttv::json::Value &jRaid, RaidStatus &status)
 
bool ParseMessageJson (const ttv::json::Value &jMessage, const TokenizationOptions &tokenizationOptions, const std::shared_ptr< BitsConfiguration > &bitsConfig, const std::vector< std::string > &localUserNames, WhisperMessage &result)
 
bool ParseChatReplayMessageJson (const ttv::json::Value &jMessage, const TokenizationOptions &tokenizationOptions, const std::shared_ptr< BitsConfiguration > &bitsConfig, const std::vector< std::string > &localUserNames, ReplayMessage &result)
 
bool ParseMillisecondTimestampChatReplayMessageJson (const ttv::json::Value &jMessage, uint64_t &result)
 
bool ParseGraphQLErrorCode (const ttv::json::Value &jVal, const std::string &mutationName, GraphQLErrorCode &code)
 
bool ParseEditRoomMessage (const ttv::json::Value &jVal, ChatRoomMessage &result)
 
bool ParseSendRoomMessage (const ttv::json::Value &jVal, ChatRoomMessage &result, SendRoomMessageError &error)
 
bool ParseRoomMessages (const ttv::json::Value &jVal, std::vector< ChatRoomMessage > &result, std::string &resultCursor, bool &resultMoreMessages)
 
bool ParseCreateRoom (const ttv::json::Value &jVal, ChatRoomInfo &result, CreateRoomError &error)
 
bool ParseUpdateRoom (const ttv::json::Value &jVal, ChatRoomInfo &result, UpdateRoomError &error)
 
bool ParseUpdateRoomModes (const ttv::json::Value &jVal, ChatRoomInfo &result, UpdateRoomModesError &error)
 
bool ParseRoomInfo (const ttv::json::Value &jVal, ChatRoomInfo &result)
 
bool ParseGraphQLChatRooms (const ttv::json::Value &jVal, std::vector< ChatRoomInfo > &result)
 
bool ParseGraphQLChatRoomView (const ttv::json::Value &jVal, const std::string &mutationName, ChatRoomInfo &result)
 
bool ParseGraphQLUserMods (const ttv::json::Value &jVal, std::vector< std::string > &result, std::string &cursor)
 
bool ParseBanUser (const ttv::json::Value &jVal, BanUserError &error)
 
bool ParseUnbanUser (const ttv::json::Value &jVal, UnbanUserError &error)
 
bool ParseUserEmoticonSets (const ttv::json::Value &jVal, std::vector< EmoticonSet > &result)
 
JavaClassInfo & GetJavaClassInfo_IChatRoomCollection (JNIEnv *jEnv)
 
JavaClassInfo & GetJavaClassInfo_IChatRoomCollection_AddRoomCallback (JNIEnv *jEnv)
 
JavaClassInfo & GetJavaClassInfo_IChatRoomCollection_FetchRoomsInfoCallback (JNIEnv *jEnv)
 
JavaClassInfo & GetJavaClassInfo_IChatRoomCollection_JoinCallback (JNIEnv *jEnv)
 
JavaClassInfo & GetJavaClassInfo_IChatRoomCollection_LeaveCallback (JNIEnv *jEnv)
 
JavaClassInfo & GetJavaClassInfo_IChatRoomCollectionListener (JNIEnv *jEnv)
 

Class Documentation

◆ ttv::chat::Badge

struct ttv::chat::Badge

Badge - Information about a badge set which may have several versions.

Class Members
string name The unique name of the badge.
map< string, BadgeVersion > versions The versions available for rendering, keyed by version name.

◆ ttv::chat::BitsRange

struct ttv::chat::BitsRange
Class Members
uint32_t numBits
uint32_t prefixLength

◆ ttv::chat::BitsReceivedEvent

struct ttv::chat::BitsReceivedEvent

BitsReceivedEvent - A message indicating that the given channel received a bits cheer.

Class Members
BadgeEntitlement badge Information about the user's new badge level, if the user reached a new badge level with this cheer.
uint32_t bitsUsed Number of bits used.
ChannelId channelId User ID of the channel on which bits were used.
string channelName Name of the channel on which bits were used.
string context Event type associated with this use of bits.
MessageInfo message Chat message sent with the cheer.
uint32_t totalBitsUsed All-time total number of bits used on this channel by the specified user.

◆ ttv::chat::ChatChannelInfo

struct ttv::chat::ChatChannelInfo

ChatChannelInfo - Information about the state of a connected chat channel.

Class Members
string broadcasterLanguage The active broadcaster language code. Empty if there is no language filter enabled.
RestrictionReason localUserRestriction The active restriction for the local user.
string name The UTF-8 encoded name of the channel. Currently restricted to the ASCII subset.

◆ ttv::chat::ChatRoomMessage

struct ttv::chat::ChatRoomMessage

ChatRoomMessage - A message from a single user in a chat room.

Class Members
MessageInfo messageInfo The information about the message.
string roomId The room id the message is being sent to.
string roomMessageId The message id for the room.

◆ ttv::chat::EmoteRange

struct ttv::chat::EmoteRange
Class Members
int endIndex
int startIndex

◆ ttv::chat::EmoticonRange

struct ttv::chat::EmoticonRange
Class Members
EmoticonId emoticonId

◆ ttv::chat::FirstTimeChatterNotice

struct ttv::chat::FirstTimeChatterNotice

FirstTimeChatterNotice - A message indicating that a user has completed the first time chatter ritual.

Class Members
string messageId The id of the first time chatter notice.
string systemMessage Message generated by the system itself accompanying the user message.
MessageInfo userMessage Message the user provided when they completed their first chatter ritual.

◆ ttv::chat::FollowerAddedEvent

struct ttv::chat::FollowerAddedEvent

FollowerAddedEvent - Info received about a new follower to a channel

Class Members
string displayName Display name of the person who followed the channel.
UserId userId User Id of the person who followed the channel.
string userName Username of the person who followed the channel.

◆ ttv::chat::MentionRange

struct ttv::chat::MentionRange

◆ ttv::chat::MessageBadge

struct ttv::chat::MessageBadge

MessageBadge - A badge instance associated with a message.

Class Members
string name Corresponds to Badge::name.
string version Corresponds to BadgeVersion::name.

◆ ttv::chat::SubscriberAddedEvent

struct ttv::chat::SubscriberAddedEvent

SubscriberAddedEvent - Info received about a new subscriber to a channel

Class Members
ChannelId channelId User ID of the channel subscribed to.
string channelName Name of the channel subscribed to.
string displayName Display name of the person who subscribed to the channel.
SubscriptionNotice subNotice Details of the subscription.
Timestamp timestamp Time when subscribed event occured.
UserId userId User ID of the person who subscribed to the channel.
string userName Login name of the person who subscribed to the channel.

◆ ttv::chat::TokenRange

struct ttv::chat::TokenRange
Class Members
union TokenRange data
int endIndex
int rangeNum
int startIndex
TokenRangeEnum type

◆ ttv::chat::TokenRange.data

union ttv::chat::TokenRange.data
Class Members
BitsRange bits
EmoticonRange emoticon
MentionRange mention
UrlRange url

◆ ttv::chat::UnraidNotice

struct ttv::chat::UnraidNotice

UnraidNotice - A message indicating that the current channel has stopped raiding another channel.

Class Members
string systemMessage Message generated by the system accompanying the unraid.

◆ ttv::chat::UrlRange

struct ttv::chat::UrlRange

Typedef Documentation

◆ EmoticonId

using ttv::chat::EmoticonId = typedef uint32_t

◆ EmoticonSetId

using ttv::chat::EmoticonSetId = typedef uint32_t

◆ MessageId

using ttv::chat::MessageId = typedef uint32_t

Enumeration Type Documentation

◆ ChatChannelState

ChatChannelState - The current state of the chat connection.

Enumerator
Disconnected 
Connecting 
Connected 
Disconnecting 

◆ ChatMode

enum ttv::chat::ChatMode
strong

ChatMode - A mode a chat can be in. For use internally by the SDK.

Enumerator
Slow 

Slow mode.

R9k 

r9k mode.

EmotesOnly 

Emotes-only mode.

◆ ChatReplayState

Enumerator
Paused 
Playing 
Buffering 
NoMessagesForVod 

◆ GraphQLErrorCode

Enumerator
SUCCESS 

No error.

UNKNOWN 

Received an unrecognized error code.

AUTO_MOD_ENFORCEMENT_FAILED 

Message failed automod check. sendRoomMessage.

CHANNEL_NOT_FOUND 

Target channel does not exist. modUser, unmodUser.

DURATION_INVALID 

Duration provided was too short or too long. banUser.

EMOTE_ONLY_MODE_ENFORCEMENT_FAILED 

Room is in emotes only mode and message contained non-emote text. sendRoomMessage.

FORBIDDEN 

User is not allowed to perform the action.

MAX_ROOMS_LIMIT_EXCEEDED 

User cannot create any more rooms. createRoom.

NAME_CONTAINS_INVALID_CHARACTERS 

Name contains invalid characters (e.g. spaces). createRoom, updateRoom.

NAME_INAPPROPRIATE 

Name failed automod check. createRoom, updateRoom.

NAME_LENGTH_INVALID 

Name is too short or too long. createRoom, updateRoom.

R9K_MODE_ENFORCEMENT_FAILED 

Room is in R9K mode and message was not unique. sendRoomMessage.

RATE_LIMIT_FAILED 

User is rate limited. sendRoomMessage.

ROOM_NOT_FOUND 

Could not find a room with the given room ID. updateRoom. updateRoomModes.

SLOW_MODE_DURATION_INVALID 

Slow mode duration was too short, too long, or not a number. updateRoomModes.

SLOW_MODE_ENFORCEMENT_FAILED 

Room is in slow mode and user tried to send a message too quickly. sendRoomMessage.

SPAM_ENFORCEMENT_FAILED 

Message failed spam check. sendRoomMessage.

TARGET_ALREADY_BANNED 

User tried to ban already banned user. banUser.

TARGET_ALREADY_MOD 

Target is already a mod. modUser.

TARGET_IS_ADMIN 

User tried to ban admin. banUser.

TARGET_IS_ANONYMOUS 

User tried to ban anonymous user. banUser.

TARGET_IS_BROADCASTER 

User tried to ban broadcaster. banUser.

TARGET_IS_CHAT_BANNED 

User is banned from chat. modUser.

TARGET_IS_GLOBAL_MOD 

User tried to ban admin. banUser.

TARGET_IS_MOD 

User tried to ban moderator without permission. banUser.

TARGET_IS_SELF 

User tried to ban themselves. banUser.

TARGET_IS_STAFF 

User tried to ban staff. banUser.

TARGET_NOT_BANNED 

Target is not banned in channel. unbanUser.

TARGET_NOT_FOUND 

Target does not exist. banUser, unbanUser, modUser, unmodUser.

TARGET_NOT_MOD 

Target is not a mod. unmodUser.

TOPIC_INAPPROPRIATE 

Topic failed automod check. createRoom, updateRoom.

TOPIC_LENGTH_INVALID 

Topic is too short or too long. createRoom, updateRoom.

USER_CHAT_BANNED 

User is banned from the channel. sendRoomMessage.

USER_CHAT_TIMED_OUT 

User is timed out from the channel sendRoomMessage.

USER_SUSPENDED 

User is suspended from Twitch. sendRoomMessage.

ZALGO_ENFORCEMENT_FAILED 

Message contained zalgo characters. sendRoomMessage.

◆ RoomRole

enum ttv::chat::RoomRole
strong

Possible minimum allowed roles channel chat room, listed from lowest to highest in hierarchy

Enumerator
Unknown 
Everyone 
Subscriber 
Moderator 

◆ TokenRangeEnum

Enumerator
TOKEN_RANGE_TYPE_URL 
TOKEN_RANGE_TYPE_MENTION 
TOKEN_RANGE_TYPE_EMOTICON 
TOKEN_RANGE_TYPE_BITS 

Function Documentation

◆ AdjustByteRangesToUtf8Ranges()

void ttv::chat::AdjustByteRangesToUtf8Ranges ( std::vector< TokenRange > &  ranges,
const std::string &  message 
)

◆ AdjustUtf8RangesToByteRanges()

void ttv::chat::AdjustUtf8RangesToByteRanges ( std::vector< TokenRange > &  ranges,
const std::string &  message 
)

◆ ChatErrorToString()

const char* ttv::chat::ChatErrorToString ( TTV_ErrorCode  ec)

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

◆ Compare()

bool ttv::chat::Compare ( const std::string &  one,
const std::string &  two,
bool  caseSensitive 
)
inline

◆ GenerateBadgesMessageTag()

bool ttv::chat::GenerateBadgesMessageTag ( const std::vector< std::pair< std::string, std::string >> &  badges,
std::string &  result 
)

Creates a new IRC message tag string from the passed-in list of badges. The pairs should contain the badgeSet name and version name, respectively.

◆ GetChatErrorCodeValues()

void ttv::chat::GetChatErrorCodeValues ( std::vector< EnumValue > &  result)

◆ GetEmoticonUrl()

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

◆ GetJavaClassInfo_IChatRoomCollection()

JavaClassInfo& ttv::chat::GetJavaClassInfo_IChatRoomCollection ( JNIEnv *  jEnv)

◆ GetJavaClassInfo_IChatRoomCollection_AddRoomCallback()

JavaClassInfo& ttv::chat::GetJavaClassInfo_IChatRoomCollection_AddRoomCallback ( JNIEnv *  jEnv)

◆ GetJavaClassInfo_IChatRoomCollection_FetchRoomsInfoCallback()

JavaClassInfo& ttv::chat::GetJavaClassInfo_IChatRoomCollection_FetchRoomsInfoCallback ( JNIEnv *  jEnv)

◆ GetJavaClassInfo_IChatRoomCollection_JoinCallback()

JavaClassInfo& ttv::chat::GetJavaClassInfo_IChatRoomCollection_JoinCallback ( JNIEnv *  jEnv)

◆ GetJavaClassInfo_IChatRoomCollection_LeaveCallback()

JavaClassInfo& ttv::chat::GetJavaClassInfo_IChatRoomCollection_LeaveCallback ( JNIEnv *  jEnv)

◆ GetJavaClassInfo_IChatRoomCollectionListener()

JavaClassInfo& ttv::chat::GetJavaClassInfo_IChatRoomCollectionListener ( JNIEnv *  jEnv)

◆ GetPrefixHost()

std::string ttv::chat::GetPrefixHost ( const std::string &  prefix)

◆ GetPrefixIdent()

std::string ttv::chat::GetPrefixIdent ( const std::string &  prefix)

◆ GetPrefixNick()

std::string ttv::chat::GetPrefixNick ( const std::string &  prefix)

◆ GetRandomUserColor()

Color ttv::chat::GetRandomUserColor ( const std::string &  username)

◆ GetWord()

std::string ttv::chat::GetWord ( const std::string &  str,
uint32_t  start,
bool  getRest,
uint32_t &  end 
)

◆ IrcStringGetWord()

int ttv::chat::IrcStringGetWord ( char *  dst,
const char *  src,
int  maxLen,
const char **  ppEnd 
)

◆ IrcStringSkipSpaces()

const char* ttv::chat::IrcStringSkipSpaces ( const char *  psz)

◆ IsChannelString()

bool ttv::chat::IsChannelString ( const std::string &  channel)

◆ IsSimpleWordCharacter()

bool ttv::chat::IsSimpleWordCharacter ( char  ch)

◆ IsSlashCommandMessage()

bool ttv::chat::IsSlashCommandMessage ( const std::string &  message)
inline

◆ IsTwitchChatUrl()

bool ttv::chat::IsTwitchChatUrl ( const std::string &  url)

◆ NickHasMode()

bool ttv::chat::NickHasMode ( const std::string &  nick,
char  mode 
)

◆ ParseBadgesMessageTag()

bool ttv::chat::ParseBadgesMessageTag ( const std::string &  messageTag,
std::vector< std::pair< std::string, std::string >> &  result 
)

Parses the 'badges' IRC message tag into the list of badges in the message. The pairs contain badgeSet name and version name, respectively.

◆ ParseBanUser()

bool ttv::chat::ParseBanUser ( const ttv::json::Value jVal,
BanUserError error 
)

◆ ParseChatReplayMessageJson()

bool ttv::chat::ParseChatReplayMessageJson ( const ttv::json::Value jMessage,
const TokenizationOptions tokenizationOptions,
const std::shared_ptr< BitsConfiguration > &  bitsConfig,
const std::vector< std::string > &  localUserNames,
ReplayMessage result 
)

◆ ParseCreateRoom()

bool ttv::chat::ParseCreateRoom ( const ttv::json::Value jVal,
ChatRoomInfo result,
CreateRoomError error 
)

◆ ParseEditRoomMessage()

bool ttv::chat::ParseEditRoomMessage ( const ttv::json::Value jVal,
ChatRoomMessage result 
)

◆ ParseEmotesMessageTag()

bool ttv::chat::ParseEmotesMessageTag ( const std::string &  emotesMessageTag,
std::map< EmoticonId, std::vector< EmoteRange >> &  result 
)

Parses the 'emotes' IRC message tag into the ranges needed to parse the associated message.

◆ ParseGraphQLChatRooms()

bool ttv::chat::ParseGraphQLChatRooms ( const ttv::json::Value jVal,
std::vector< ChatRoomInfo > &  result 
)

◆ ParseGraphQLChatRoomView()

bool ttv::chat::ParseGraphQLChatRoomView ( const ttv::json::Value jVal,
const std::string &  mutationName,
ChatRoomInfo result 
)

◆ ParseGraphQLErrorCode()

bool ttv::chat::ParseGraphQLErrorCode ( const ttv::json::Value jVal,
const std::string &  mutationName,
GraphQLErrorCode code 
)

Parses the GraphQL payloads as json and populates the result with the information.

◆ ParseGraphQLUserMods()

bool ttv::chat::ParseGraphQLUserMods ( const ttv::json::Value jVal,
std::vector< std::string > &  result,
std::string &  cursor 
)

◆ ParseMessageJson()

bool ttv::chat::ParseMessageJson ( const ttv::json::Value jMessage,
const TokenizationOptions tokenizationOptions,
const std::shared_ptr< BitsConfiguration > &  bitsConfig,
const std::vector< std::string > &  localUserNames,
WhisperMessage result 
)

Parses the given json and returns a populated TTV_ChatMessage with dynamically allocated strings. Be sure to free the string fields.

◆ ParseMillisecondTimestampChatReplayMessageJson()

bool ttv::chat::ParseMillisecondTimestampChatReplayMessageJson ( const ttv::json::Value jMessage,
uint64_t &  result 
)

◆ ParseParticipantJson()

bool ttv::chat::ParseParticipantJson ( const ttv::json::Value jParticipant,
ChatUserInfo user 
)

◆ ParseRaidStatusJson()

bool ttv::chat::ParseRaidStatusJson ( const ttv::json::Value jRaid,
RaidStatus status 
)

◆ ParseRoomInfo()

bool ttv::chat::ParseRoomInfo ( const ttv::json::Value jVal,
ChatRoomInfo result 
)

◆ ParseRoomMessages()

bool ttv::chat::ParseRoomMessages ( const ttv::json::Value jVal,
std::vector< ChatRoomMessage > &  result,
std::string &  resultCursor,
bool &  resultMoreMessages 
)

◆ ParseSendRoomMessage()

bool ttv::chat::ParseSendRoomMessage ( const ttv::json::Value jVal,
ChatRoomMessage result,
SendRoomMessageError error 
)

◆ ParseSubscriptionStatus()

SubscriptionStatus ttv::chat::ParseSubscriptionStatus ( const std::string &  str)

◆ ParseThreadJson()

bool ttv::chat::ParseThreadJson ( const ttv::json::Value jThread,
const TokenizationOptions tokenizationOptions,
const std::shared_ptr< BitsConfiguration > &  bitsConfig,
const std::vector< std::string > &  localUserNames,
ThreadData result 
)

◆ ParseUnbanUser()

bool ttv::chat::ParseUnbanUser ( const ttv::json::Value jVal,
UnbanUserError error 
)

◆ ParseUpdateRoom()

bool ttv::chat::ParseUpdateRoom ( const ttv::json::Value jVal,
ChatRoomInfo result,
UpdateRoomError error 
)

◆ ParseUpdateRoomModes()

bool ttv::chat::ParseUpdateRoomModes ( const ttv::json::Value jVal,
ChatRoomInfo result,
UpdateRoomModesError error 
)

◆ ParseUserEmoticonSets()

bool ttv::chat::ParseUserEmoticonSets ( const ttv::json::Value jVal,
std::vector< EmoticonSet > &  result 
)

◆ ParseUserType()

UserMode ttv::chat::ParseUserType ( const std::string &  str)

◆ RemoveOverlappingRanges()

void ttv::chat::RemoveOverlappingRanges ( std::vector< TokenRange > &  ranges)

◆ ReplaceSubstring()

std::string ttv::chat::ReplaceSubstring ( const std::string &  source,
const std::string &  target,
const std::string &  with 
)

◆ SortEmoticonRangesByEmoticonId()

bool ttv::chat::SortEmoticonRangesByEmoticonId ( const TokenRange a,
const TokenRange b 
)

◆ SortTokenRangesByStartIndex()

bool ttv::chat::SortTokenRangesByStartIndex ( const TokenRange a,
const TokenRange b 
)

◆ SortTokenRangesByTypeThenRangeNum()

bool ttv::chat::SortTokenRangesByTypeThenRangeNum ( const TokenRange a,
const TokenRange b 
)

◆ StripNickModes()

std::string ttv::chat::StripNickModes ( const std::string &  nick,
const std::string &  modeChars 
)

◆ StripNickModesAndInvalidChars()

std::string ttv::chat::StripNickModesAndInvalidChars ( const std::string &  nick,
const std::string &  modeChars 
)

◆ TokenizeLocalMessage()

bool ttv::chat::TokenizeLocalMessage ( const std::shared_ptr< User > &  user,
ChannelId  channelId,
const std::string &  message,
std::string &  emotesMessageTag,
std::string &  badgesMessageTag 
)

◆ TokenizeServerMessage() [1/3]

void ttv::chat::TokenizeServerMessage ( const std::string &  message,
const TokenizationOptions tokenizationOptions,
const std::string &  messageTags,
const std::shared_ptr< BitsConfiguration > &  bitsConfig,
const std::vector< std::string > &  localUserNames,
MessageInfo tokenizedMessage 
)

◆ TokenizeServerMessage() [2/3]

void ttv::chat::TokenizeServerMessage ( const std::string &  message,
const TokenizationOptions tokenizationOptions,
const std::map< EmoticonId, std::vector< EmoteRange >> &  emoticonRanges,
const std::vector< std::string > &  localUserNames,
MessageInfo tokenizedMessage 
)

◆ TokenizeServerMessage() [3/3]

void ttv::chat::TokenizeServerMessage ( const std::string &  message,
const TokenizationOptions tokenizationOptions,
const std::map< EmoticonId, std::vector< EmoteRange >> &  emoticonRanges,
const std::shared_ptr< BitsConfiguration > &  bitsConfig,
const std::vector< std::string > &  localUserNames,
MessageInfo tokenizedMessage 
)

◆ TokensEqual()

bool ttv::chat::TokensEqual ( const std::unique_ptr< MessageToken > &  lhs,
const std::unique_ptr< MessageToken > &  rhs 
)

◆ UnescapeEmoticonToken()

void ttv::chat::UnescapeEmoticonToken ( std::string &  token)

◆ UnescapeMessageTag()

std::string ttv::chat::UnescapeMessageTag ( const std::string &  escapedMessageTag)

Parses an IRC escaped string into a normal string, according to the IRC spec here: http://ircv3.net/specs/core/message-tags-3.2.html