|
Twitch SDK (Internal)
|
#include <ichatroom.h>
Public Types | |
| using | DeleteRoomCallback = std::function< void(TTV_ErrorCode ec)> |
| using | SendMessageCallback = std::function< void(TTV_ErrorCode ec, SendRoomMessageError &&error, ChatRoomMessage &&message)> |
| using | EditMessageCallback = std::function< void(TTV_ErrorCode ec, ChatRoomMessage &&message)> |
| using | DeleteMessageCallback = std::function< void(TTV_ErrorCode ec)> |
| using | FetchMessagesCallback = std::function< void(TTV_ErrorCode ec, std::vector< ChatRoomMessage > &&messages, std::string &&nextCursor, bool moreMessages)> |
| using | UpdateRoomInfoCallback = std::function< void(TTV_ErrorCode ec, UpdateRoomError &&error, ChatRoomInfo &&info)> |
| using | UpdateRoomModesCallback = std::function< void(TTV_ErrorCode ec, UpdateRoomModesError &&error, ChatRoomInfo &&info)> |
| using | UpdateRoomViewCallback = std::function< void(TTV_ErrorCode ec, ChatRoomInfo &&info)> |
| using | FetchRoomInfoCallback = std::function< void(TTV_ErrorCode ec, ChatRoomInfo &&info)> |
Public Member Functions | |
| virtual | ~IChatRoom ()=default |
| virtual TTV_ErrorCode | Dispose ()=0 |
| virtual TTV_ErrorCode | DeleteRoom (const DeleteRoomCallback &callback)=0 |
| virtual TTV_ErrorCode | SendMessage (const std::string &message, ChatRoomMessage &placeholderMessage, const SendMessageCallback &callback)=0 |
| virtual TTV_ErrorCode | EditMessage (const std::string &messageId, const std::string &message, ChatRoomMessage &placeholderMessage, const EditMessageCallback &callback)=0 |
| virtual TTV_ErrorCode | DeleteMessage (const std::string &messageId, const DeleteMessageCallback &callback)=0 |
| virtual TTV_ErrorCode | FetchMessagesBeforeCursor (const std::string &cursor, uint32_t limit, const FetchMessagesCallback &callback)=0 |
| virtual TTV_ErrorCode | FetchMessagesAfterCursor (const std::string &cursor, uint32_t limit, const FetchMessagesCallback &callback)=0 |
| virtual TTV_ErrorCode | FetchMessagesBeforeTimestamp (Timestamp timestamp, uint32_t limit, const FetchMessagesCallback &callback)=0 |
| virtual TTV_ErrorCode | FetchMessagesAfterTimestamp (Timestamp timestamp, uint32_t limit, const FetchMessagesCallback &callback)=0 |
| virtual TTV_ErrorCode | FetchRoomInfo (const FetchRoomInfoCallback &callback)=0 |
| virtual TTV_ErrorCode | SetRoomName (const std::string &name, const UpdateRoomInfoCallback &callback)=0 |
| virtual TTV_ErrorCode | SetTopic (const std::string &topic, const UpdateRoomInfoCallback &callback)=0 |
| virtual TTV_ErrorCode | SetPreviewable (bool isPreviewable, const UpdateRoomInfoCallback &callback)=0 |
| virtual TTV_ErrorCode | SetMinimumAllowedRole (RoomRole minimumAllowedRole, const UpdateRoomInfoCallback &callback)=0 |
| virtual TTV_ErrorCode | EnableSlowMode (uint32_t durationSeconds, const UpdateRoomModesCallback &callback)=0 |
| virtual TTV_ErrorCode | DisableSlowMode (const UpdateRoomModesCallback &callback)=0 |
| virtual TTV_ErrorCode | EnableR9kMode (const UpdateRoomModesCallback &callback)=0 |
| virtual TTV_ErrorCode | DisableR9kMode (const UpdateRoomModesCallback &callback)=0 |
| virtual TTV_ErrorCode | EnableEmotesOnlyMode (const UpdateRoomModesCallback &callback)=0 |
| virtual TTV_ErrorCode | DisableEmotesOnlyMode (const UpdateRoomModesCallback &callback)=0 |
| virtual TTV_ErrorCode | SetLastReadAt (Timestamp lastReadAt, const UpdateRoomViewCallback &callback)=0 |
| virtual TTV_ErrorCode | SetMuted (bool isMuted, const UpdateRoomViewCallback &callback)=0 |
| virtual TTV_ErrorCode | SetArchived (bool isArchived, const UpdateRoomViewCallback &callback)=0 |
The interface for a chat room.
| using ttv::chat::IChatRoom::DeleteMessageCallback = std::function<void(TTV_ErrorCode ec)> |
Used with DeleteMessage().
| [in] | ec |
|
| [in] | message | The message received back from the server. |
| using ttv::chat::IChatRoom::DeleteRoomCallback = std::function<void(TTV_ErrorCode ec)> |
Used with DeleteRoom().
| [in] | ec |
|
| using ttv::chat::IChatRoom::EditMessageCallback = std::function<void(TTV_ErrorCode ec, ChatRoomMessage&& message)> |
Used with EditMessage().
| [in] | ec |
|
| [in] | message | The message received back from the server. |
| using ttv::chat::IChatRoom::FetchMessagesCallback = std::function<void(TTV_ErrorCode ec, std::vector<ChatRoomMessage>&& messages, std::string&& nextCursor, bool moreMessages)> |
Used with FetchMessages functions.
| [in] | ec |
|
| [in] | messages | The list of messages received back from the server. If fetching before a time/cursor, listed from newest to oldest. Else if fetching after a time/cursor, listed from oldest to newest. |
| [in] | nextCursor | The cursor to use next time to fetch messages from where we left off, in the same pagination direction. |
| [in] | moreMessages | True if there are more messages to be fetched at the cursor, else false. |
| using ttv::chat::IChatRoom::FetchRoomInfoCallback = std::function<void(TTV_ErrorCode ec, ChatRoomInfo&& info)> |
Used with FetchRoomInfo().
| [in] | ec |
|
| [in] | info | The updated information of the room. |
| using ttv::chat::IChatRoom::SendMessageCallback = std::function<void(TTV_ErrorCode ec, SendRoomMessageError&& error, ChatRoomMessage&& message)> |
Used with SendMessage().
| [in] | ec |
|
| [in] | error | Error object received from GraphQL describing reason why sending message failed. |
| [in] | message | The message received back from the server. |
| using ttv::chat::IChatRoom::UpdateRoomInfoCallback = std::function<void(TTV_ErrorCode ec, UpdateRoomError&& error, ChatRoomInfo&& info)> |
Used when updating the information of a room.
| [in] | ec |
|
| [in] | error | Error object received from GraphQL describing the reason why updating room info failed. |
| [in] | info | The updated information of the room. |
| using ttv::chat::IChatRoom::UpdateRoomModesCallback = std::function<void(TTV_ErrorCode ec, UpdateRoomModesError&& error, ChatRoomInfo&& info)> |
Used when updating a room's chat mode.
| [in] | ec |
|
| [in] | error | Error object received from GraphQL describing the reason why updating room mode failed. |
| [in] | info | The updated information of the room. |
| using ttv::chat::IChatRoom::UpdateRoomViewCallback = std::function<void(TTV_ErrorCode ec, ChatRoomInfo&& info)> |
Used when updating a room's view.
| [in] | ec |
|
| [in] | info | The updated information of the room. |
|
virtualdefault |
|
pure virtual |
Deletes a message in the chat room.
| [in] | messageId | The id of the message we want to delete. |
| [in] | callback | Callback when API call returns, receives an error code. |
Implemented in ttv::chat::ChatRoom.
|
pure virtual |
Deletes the chat room from the channel. User must be the owner of the chat room.
| [in] | callback | Callback when API call returns, receives an error code. |
Implemented in ttv::chat::ChatRoom.
|
pure virtual |
Turns off emotes-only mode for the chat room.
| [in] | callback | Callback when the API call returns, receives an error code and the new room info. |
Implemented in ttv::chat::ChatRoom.
|
pure virtual |
Turns off r9k mode for the chat room.
| [in] | callback | Callback when the API call returns, receives an error code and the new room info. |
Implemented in ttv::chat::ChatRoom.
|
pure virtual |
Turns off slow mode for the chat room.
| [in] | callback | Callback when the API call returns, receives an error code and the new room info. |
Implemented in ttv::chat::ChatRoom.
|
pure virtual |
This should be called when the application is done with the instance.
Implemented in ttv::chat::ChatRoom.
|
pure virtual |
Edits a message's content in the chat room. User must have written the message.
| [in] | messageId | The id of the message we want to edit. |
| [in] | message | The content that we want to set the message to. |
| [out] | placeholderMessage | A ChatRoomMessage created client-side to be displayed until we receive the actual message result from the backend. |
| [in] | callback | Callback when API call returns, receives an error code and the edited message. |
Implemented in ttv::chat::ChatRoom.
|
pure virtual |
Turns on emotes-only mode for the chat room.
| [in] | callback | Callback when the API call returns, receives an error code and the new room info. |
Implemented in ttv::chat::ChatRoom.
|
pure virtual |
Turns on r9k mode for the chat room.
| [in] | callback | Callback when the API call returns, receives an error code and the new room info. |
Implemented in ttv::chat::ChatRoom.
|
pure virtual |
Turns on slow mode for the chat room.
| [in] | durationSeconds | The number of seconds a user must wait between sending messages. Cannot be 0. |
| [in] | callback | Callback when the API call returns, receives an error code and the new room info. |
Implemented in ttv::chat::ChatRoom.
|
pure virtual |
Fetches newer messages from the chat room starting at the cursor, from oldest to newest.
| [in] | cursor | The cursor that we want to start fetching messages from. If the empty string is passed in, we fetch the oldest messages in the room. |
| [in] | limit | The max number of messages to fetch. Can be a number from 1-100. |
| [in] | callback | Callback when API call returns, receives an error code and the list of messages. |
Implemented in ttv::chat::ChatRoom.
|
pure virtual |
Fetches messages from the chat room and after the timestamp (inclusive), from oldest to newest.
| [in] | timestamp | The timestamp that we want to start fetching messages from. |
| [in] | limit | The max number of messages to fetch. Can be a number from 1-100. |
| [in] | callback | Callback when API call returns, receives an error code and the list of messages. |
Implemented in ttv::chat::ChatRoom.
|
pure virtual |
Fetches older messages from the chat room starting at the cursor, from newest to oldest.
| [in] | cursor | The cursor that we want to start fetching messages from. If the empty string is passed in, we fetch the most recent messages in the room. |
| [in] | limit | The max number of messages to fetch. Can be a number from 1-100. |
| [in] | callback | Callback when API call returns, receives an error code and the list of messages. |
Implemented in ttv::chat::ChatRoom.
|
pure virtual |
Fetches messages from the chat room before the timestamp, from newest to oldest.
| [in] | timestamp | The timestamp that we want to start fetching messages from. |
| [in] | limit | The max number of messages to fetch. Can be a number from 1-100. |
| [in] | callback | Callback when API call returns, receives an error code and the list of messages. |
Implemented in ttv::chat::ChatRoom.
|
pure virtual |
Fetches the information of the chat room and returns it in the callback.
| [in] | callback | Callback when API call returns, receives an error code and the room info. |
Implemented in ttv::chat::ChatRoom.
|
pure virtual |
Send a message to the chat room. User must be joined to the chat room.
| [in] | message | Content of the message we want to send to the chat room. |
| [out] | placeholderMessage | A ChatRoomMessage created client-side to be displayed until we receive the actual message result from the backend. |
| [in] | callback | Callback when API call returns, receives an error code and the sent message. |
Implemented in ttv::chat::ChatRoom.
|
pure virtual |
Update if the user has archived the chat room.
| [in] | isArchived | Whether the user has archived the room. |
| [in] | callback | Callback when API call returns, receives an error code and the new room info. |
Implemented in ttv::chat::ChatRoom.
|
pure virtual |
Update when the user last read a message in the chat room.
| [in] | lastReadAt | The time the user last read a message. |
| [in] | callback | Callback when API call returns, receives an error code and the new room info. |
Implemented in ttv::chat::ChatRoom.
|
pure virtual |
Update the minimum role required to join the chat room.
| [in] | minimumAllowedRole | The new minimum required role for the room. |
| [in] | callback | Callback when API call returns, receives an error code and the new room info. |
Implemented in ttv::chat::ChatRoom.
|
pure virtual |
Update if the user has muted the chat room.
| [in] | isMuted | Whether the user has muted the room. |
| [in] | callback | Callback when API call returns, receives an error code and the new room info. |
Implemented in ttv::chat::ChatRoom.
|
pure virtual |
Update whether the chat room is previewable to non-joined users.
| [in] | isPreviewable | Whether the chat room will be previewable. |
| [in] | callback | Callback when API call returns, receives an error code and the new room info. |
Implemented in ttv::chat::ChatRoom.
|
pure virtual |
Update the name of the chat room.
| [in] | name | The new name of the room. |
| [in] | callback | Callback when API call returns, receives an error code and the new room info. |
Implemented in ttv::chat::ChatRoom.
|
pure virtual |
Update the topic of the chat room.
| [in] | name | The new topic of the room. |
| [in] | callback | Callback when API call returns, receives an error code and the new room info. |
Implemented in ttv::chat::ChatRoom.
1.8.13