Twitch SDK (Internal)
Public Types | Public Member Functions | List of all members
ttv::chat::IChannelChatRoomManager Class Referenceabstract

#include <ichannelchatroommanager.h>

Inheritance diagram for ttv::chat::IChannelChatRoomManager:
ttv::chat::ChannelChatRoomManager

Public Types

using JoinCallback = std::function< void(TTV_ErrorCode ec)>
 
using LeaveCallback = std::function< void(TTV_ErrorCode ec)>
 
using AddRoomCallback = std::function< void(TTV_ErrorCode ec, CreateRoomError &&error, ChatRoomInfo &&info)>
 
using FetchRoomsInfoCallback = std::function< void(TTV_ErrorCode ec, std::vector< ChatRoomInfo > &&infos)>
 

Public Member Functions

virtual ~IChannelChatRoomManager ()=default
 
virtual TTV_ErrorCode Dispose ()=0
 
virtual TTV_ErrorCode AddNewChatRoom (const std::string &roomName, const std::string &topic, bool isPreviewable, RoomRole minimumAllowedRole, const AddRoomCallback &callback)=0
 
virtual TTV_ErrorCode JoinChatRooms (const JoinCallback &callback)=0
 
virtual TTV_ErrorCode LeaveChatRooms (const LeaveCallback &callback)=0
 
virtual TTV_ErrorCode FetchChatRoomsInfo (const FetchRoomsInfoCallback &callback)=0
 

Detailed Description

The interface to manage a channel's chat rooms.

Member Typedef Documentation

◆ AddRoomCallback

Used with AddNewChatRoom().

Parameters
[in]ec
  • TTV_EC_SUCCESS: The channel has created a new chat room.
  • TTV_EC_WEBAPI_RESULT_INVALID_JSON: Something went wrong when trying to create a new chat room.
  • TTV_EC_GRAPHQL_ERROR: Received an error code from the back-end.
[in]errorError object describing the reason why creating the room failed.
[in]infoThe information of the newly created room.

◆ FetchRoomsInfoCallback

using ttv::chat::IChannelChatRoomManager::FetchRoomsInfoCallback = std::function<void(TTV_ErrorCode ec, std::vector<ChatRoomInfo>&& infos)>

Used with FetchRoomsInfo().

Parameters
[in]ec
  • TTV_EC_SUCCESS: The channel has created a new chat room.
  • TTV_EC_WEBAPI_RESULT_INVALID_JSON: Something went wrong when trying to create a new chat room.
[in]infosA list of the information for chat rooms on the channel.

◆ JoinCallback

Used with JoinChatRooms().

Parameters
[in]ec
  • TTV_EC_SUCCESS: The rooms was successfully joined.
  • TTV_EC_WEBAPI_RESULT_INVALID_JSON: Something went wrong when trying to join the rooms.

◆ LeaveCallback

Used with LeaveChatRooms().

Parameters
[in]ec
  • TTV_EC_SUCCESS: The rooms was successfully left.
  • TTV_EC_WEBAPI_RESULT_INVALID_JSON: Something went wrong when trying to leave the rooms.

Constructor & Destructor Documentation

◆ ~IChannelChatRoomManager()

virtual ttv::chat::IChannelChatRoomManager::~IChannelChatRoomManager ( )
virtualdefault

Member Function Documentation

◆ AddNewChatRoom()

virtual TTV_ErrorCode ttv::chat::IChannelChatRoomManager::AddNewChatRoom ( const std::string &  roomName,
const std::string &  topic,
bool  isPreviewable,
RoomRole  minimumAllowedRole,
const AddRoomCallback callback 
)
pure virtual

Adds a new chat room for the channel. Currently to create a new room, the user must own the channel (userId and channelId must be the same).

Parameters
[in]roomNameThe name of the newly created room.
[in]topicThe topic of the newly created room.
[in]isPreviewableWhether the newly created room will be previewable.
[in]minimumAllowedRoleThe minimum required role for a user to join the room.
[in]callbackCallback when API call returns, receives an error code and the newly created room's information.
Returns
  • TTV_EC_SUCCESS: We've sent the request to add a new chat room.
  • TTV_EC_SHUT_DOWN: The chat room object is not initialized.
  • TTV_EC_NEED_TO_LOGIN: The user is not properly logged in.
  • TTV_EC_INVALID_CHANNEL_ID: ChannelChatRoomManager's user id does not match channel id (currently the user must own the channel to add a new room)

Implemented in ttv::chat::ChannelChatRoomManager.

◆ Dispose()

virtual TTV_ErrorCode ttv::chat::IChannelChatRoomManager::Dispose ( )
pure virtual

This should be called when the application is done with the instance.

Returns
  • TTV_EC_SUCCESS: Instance has been disposed.

Implemented in ttv::chat::ChannelChatRoomManager.

◆ FetchChatRoomsInfo()

virtual TTV_ErrorCode ttv::chat::IChannelChatRoomManager::FetchChatRoomsInfo ( const FetchRoomsInfoCallback callback)
pure virtual

Return all of the information for chat rooms on this channel.

Parameters
[in]callbackCallback when the API call returns, receives an error code and a list of information for the chat rooms of the channel.
Returns
  • TTV_EC_SUCCESS: We've sent the request to fetch the chat rooms information.
  • TTV_EC_SHUT_DOWN: The chat room object is not initialized.
  • TTV_EC_NEED_TO_LOGIN: The user is not properly logged in.

Implemented in ttv::chat::ChannelChatRoomManager.

◆ JoinChatRooms()

virtual TTV_ErrorCode ttv::chat::IChannelChatRoomManager::JoinChatRooms ( const JoinCallback callback)
pure virtual

Join the chat rooms for a channel.

Parameters
[in]callbackCallback when the API call returns, receives an error code.
Returns
  • TTV_EC_SUCCESS: We've sent the request to join the channel.
  • TTV_EC_SHUT_DOWN: The chat room object is not initialized.
  • TTV_EC_NEED_TO_LOGIN: The user is not properly logged in.

Implemented in ttv::chat::ChannelChatRoomManager.

◆ LeaveChatRooms()

virtual TTV_ErrorCode ttv::chat::IChannelChatRoomManager::LeaveChatRooms ( const LeaveCallback callback)
pure virtual

Leave the chat rooms for a channel.

Parameters
[in]callbackCallback when the API call returns, receives an error code.
Returns
  • TTV_EC_SUCCESS: We've sent the request to leave the channel.
  • TTV_EC_SHUT_DOWN: The chat room object is not initialized.
  • TTV_EC_NEED_TO_LOGIN: The user is not properly logged in.

Implemented in ttv::chat::ChannelChatRoomManager.


The documentation for this class was generated from the following file: