Twitch SDK (Internal)
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
ttv::chat::ChatSession Class Reference

#include <chatsession.h>

Inheritance diagram for ttv::chat::ChatSession:
ttv::chat::IChatReceiveNetworkEvent

Public Member Functions

 ChatSession ()
 
 ~ChatSession ()
 
void SetWriter (std::shared_ptr< IChatWriteNetworkEvent > writer)
 
void AddEventHandler (IChatReceiveNetworkEvent *handler)
 
void RemoveEventHandler (IChatReceiveNetworkEvent *handler)
 
void Cap (const std::string &subCommand, const std::string &capabilities)
 Send a CAP REQ command to the server, capabilities is a space separated list. More...
 
void Pass (const std::string &pass)
 Send a PASS command to the server. More...
 
void User (const std::string &nick, const std::string &name)
 Send a USER command to the server. More...
 
void TwitchClient ()
 Send a TWITCHCLIENT command to the server. More...
 
void Nick (const std::string &nick)
 Send a NICK command to the server. More...
 
void Join (const std::string &channel, const std::string &key=std::string())
 Send a JOIN command to the server. More...
 
void Part (const std::string &channel, const std::string &msg=std::string())
 Send a PART command to the server. More...
 
void Kick (const std::string &channel, const std::string &user, const std::string &reason=std::string())
 Send a KICK command to the server. More...
 
void Invite (const std::string &user, const std::string &channel)
 Send an INVITE command to the server. More...
 
void Topic (const std::string &channel, const std::string &topic=std::string())
 Send a TOPIC command to the server. More...
 
void PrivMsg (const std::string &target, const std::string &msg)
 Send a PRIVMSG command to the server. More...
 
void Action (const std::string &target, const std::string &msg)
 Send an ACTION command to the server. More...
 
void Notice (const std::string &target, const std::string &msg)
 Send a NOTICE command to the server. More...
 
void CTCP (const std::string &target, const std::string &cmd, const std::string &msg=std::string())
 
void CTCPReply (const std::string &target, const std::string &cmd, const std::string &msg=std::string())
 
void CTCPPing (const std::string &target)
 
void Whois (const std::string &target)
 
void Mode (const std::string &target, const std::string &modes)
 
void UserHost (const std::string &user)
 
void Quit (const std::string &msg)
 Send a QUIT command to the server. More...
 
void Away (const std::string &msg)
 
void Raw (const std::string &text)
 
void Ping (const std::string &target)
 Send a PING command to the server. More...
 
void Pong (const std::string &target)
 Send a PONG command to the server. More...
 
void List ()
 
const std::string & GetNick () const
 
void SetNick (const std::string &nick)
 
bool IsMe (const std::string &nick)
 
bool IsConnected ()
 
uint64_t GetIdleTime ()
 
std::string GetChannelTypes ()
 
void GetChannelUserModes (std::string *letters, std::string *symbols)
 
bool HasServerCapability (const std::string &cap)
 
std::string GetServerCapability (const std::string &cap)
 
virtual void ReceiveEvent (const ChatNetworkEvent &evt)
 Accept an incoming event. More...
 

Protected Member Functions

void ResetIdleCounter ()
 
void DispatchEvent (const ChatNetworkEvent &evt)
 
void DoEvent (const ChatNetworkEvent &evt)
 
void InitDefaultServerCapabilities ()
 
void OnConnect (const ChatNetworkEvent &evt)
 
void OnDisconnect (const ChatNetworkEvent &evt)
 
void OnJoin (const ChatNetworkEvent &evt)
 
void OnPart (const ChatNetworkEvent &evt)
 
void OnKick (const ChatNetworkEvent &evt)
 
void OnNick (const ChatNetworkEvent &evt)
 
void OnQuit (const ChatNetworkEvent &evt)
 
void OnPing (const ChatNetworkEvent &evt)
 
void OnMode (const ChatNetworkEvent &evt)
 
void OnCTCPPing (const ChatNetworkEvent &evt)
 
void OnCTCPVersion (const ChatNetworkEvent &evt)
 
void OnCTCPRplPing (const ChatNetworkEvent &evt)
 
void OnRplNamReply (const ChatNetworkEvent &evt)
 
void OnRplWelcome (const ChatNetworkEvent &evt)
 
void OnRplProtoCtl (const ChatNetworkEvent &evt)
 
void OnRplListStart (const ChatNetworkEvent &evt)
 
void OnRplList (const ChatNetworkEvent &evt)
 

Private Attributes

std::map< std::string, std::string > m_mapServerCaps
 
std::string mNick
 
std::vector< IChatReceiveNetworkEvent * > mEventHandlers
 The child event handlers for incoming chat events. More...
 
std::shared_ptr< IChatWriteNetworkEventmWriter
 The stream writer. More...
 
uint64_t mLastActivity
 
bool mConnected
 

Detailed Description

A session wraps the event processing for a single channel.

Constructor & Destructor Documentation

◆ ChatSession()

ttv::chat::ChatSession::ChatSession ( )

◆ ~ChatSession()

ttv::chat::ChatSession::~ChatSession ( )

Member Function Documentation

◆ Action()

void ttv::chat::ChatSession::Action ( const std::string &  target,
const std::string &  msg 
)

Send an ACTION command to the server.

◆ AddEventHandler()

void ttv::chat::ChatSession::AddEventHandler ( IChatReceiveNetworkEvent handler)

◆ Away()

void ttv::chat::ChatSession::Away ( const std::string &  msg)

◆ Cap()

void ttv::chat::ChatSession::Cap ( const std::string &  subCommand,
const std::string &  capabilities 
)

Send a CAP REQ command to the server, capabilities is a space separated list.

◆ CTCP()

void ttv::chat::ChatSession::CTCP ( const std::string &  target,
const std::string &  cmd,
const std::string &  msg = std::string() 
)

◆ CTCPPing()

void ttv::chat::ChatSession::CTCPPing ( const std::string &  target)

◆ CTCPReply()

void ttv::chat::ChatSession::CTCPReply ( const std::string &  target,
const std::string &  cmd,
const std::string &  msg = std::string() 
)

◆ DispatchEvent()

void ttv::chat::ChatSession::DispatchEvent ( const ChatNetworkEvent evt)
protected

◆ DoEvent()

void ttv::chat::ChatSession::DoEvent ( const ChatNetworkEvent evt)
protected

◆ GetChannelTypes()

std::string ttv::chat::ChatSession::GetChannelTypes ( )

◆ GetChannelUserModes()

void ttv::chat::ChatSession::GetChannelUserModes ( std::string *  letters,
std::string *  symbols 
)

◆ GetIdleTime()

uint64_t ttv::chat::ChatSession::GetIdleTime ( )

◆ GetNick()

const std::string& ttv::chat::ChatSession::GetNick ( ) const

◆ GetServerCapability()

std::string ttv::chat::ChatSession::GetServerCapability ( const std::string &  cap)

◆ HasServerCapability()

bool ttv::chat::ChatSession::HasServerCapability ( const std::string &  cap)

◆ InitDefaultServerCapabilities()

void ttv::chat::ChatSession::InitDefaultServerCapabilities ( )
protected

◆ Invite()

void ttv::chat::ChatSession::Invite ( const std::string &  user,
const std::string &  channel 
)

Send an INVITE command to the server.

◆ IsConnected()

bool ttv::chat::ChatSession::IsConnected ( )
inline

◆ IsMe()

bool ttv::chat::ChatSession::IsMe ( const std::string &  nick)

◆ Join()

void ttv::chat::ChatSession::Join ( const std::string &  channel,
const std::string &  key = std::string() 
)

Send a JOIN command to the server.

◆ Kick()

void ttv::chat::ChatSession::Kick ( const std::string &  channel,
const std::string &  user,
const std::string &  reason = std::string() 
)

Send a KICK command to the server.

◆ List()

void ttv::chat::ChatSession::List ( )

◆ Mode()

void ttv::chat::ChatSession::Mode ( const std::string &  target,
const std::string &  modes 
)

◆ Nick()

void ttv::chat::ChatSession::Nick ( const std::string &  nick)

Send a NICK command to the server.

◆ Notice()

void ttv::chat::ChatSession::Notice ( const std::string &  target,
const std::string &  msg 
)

Send a NOTICE command to the server.

◆ OnConnect()

void ttv::chat::ChatSession::OnConnect ( const ChatNetworkEvent evt)
protected

◆ OnCTCPPing()

void ttv::chat::ChatSession::OnCTCPPing ( const ChatNetworkEvent evt)
protected

◆ OnCTCPRplPing()

void ttv::chat::ChatSession::OnCTCPRplPing ( const ChatNetworkEvent evt)
protected

◆ OnCTCPVersion()

void ttv::chat::ChatSession::OnCTCPVersion ( const ChatNetworkEvent evt)
protected

◆ OnDisconnect()

void ttv::chat::ChatSession::OnDisconnect ( const ChatNetworkEvent evt)
protected

◆ OnJoin()

void ttv::chat::ChatSession::OnJoin ( const ChatNetworkEvent evt)
protected

◆ OnKick()

void ttv::chat::ChatSession::OnKick ( const ChatNetworkEvent evt)
protected

◆ OnMode()

void ttv::chat::ChatSession::OnMode ( const ChatNetworkEvent evt)
protected

◆ OnNick()

void ttv::chat::ChatSession::OnNick ( const ChatNetworkEvent evt)
protected

◆ OnPart()

void ttv::chat::ChatSession::OnPart ( const ChatNetworkEvent evt)
protected

◆ OnPing()

void ttv::chat::ChatSession::OnPing ( const ChatNetworkEvent evt)
protected

◆ OnQuit()

void ttv::chat::ChatSession::OnQuit ( const ChatNetworkEvent evt)
protected

◆ OnRplList()

void ttv::chat::ChatSession::OnRplList ( const ChatNetworkEvent evt)
protected

◆ OnRplListStart()

void ttv::chat::ChatSession::OnRplListStart ( const ChatNetworkEvent evt)
protected

◆ OnRplNamReply()

void ttv::chat::ChatSession::OnRplNamReply ( const ChatNetworkEvent evt)
protected

◆ OnRplProtoCtl()

void ttv::chat::ChatSession::OnRplProtoCtl ( const ChatNetworkEvent evt)
protected

◆ OnRplWelcome()

void ttv::chat::ChatSession::OnRplWelcome ( const ChatNetworkEvent evt)
protected

◆ Part()

void ttv::chat::ChatSession::Part ( const std::string &  channel,
const std::string &  msg = std::string() 
)

Send a PART command to the server.

◆ Pass()

void ttv::chat::ChatSession::Pass ( const std::string &  pass)

Send a PASS command to the server.

◆ Ping()

void ttv::chat::ChatSession::Ping ( const std::string &  target)

Send a PING command to the server.

◆ Pong()

void ttv::chat::ChatSession::Pong ( const std::string &  target)

Send a PONG command to the server.

◆ PrivMsg()

void ttv::chat::ChatSession::PrivMsg ( const std::string &  target,
const std::string &  msg 
)

Send a PRIVMSG command to the server.

◆ Quit()

void ttv::chat::ChatSession::Quit ( const std::string &  msg)

Send a QUIT command to the server.

◆ Raw()

void ttv::chat::ChatSession::Raw ( const std::string &  text)

◆ ReceiveEvent()

virtual void ttv::chat::ChatSession::ReceiveEvent ( const ChatNetworkEvent evt)
virtual

Accept an incoming event.

Implements ttv::chat::IChatReceiveNetworkEvent.

◆ RemoveEventHandler()

void ttv::chat::ChatSession::RemoveEventHandler ( IChatReceiveNetworkEvent handler)

◆ ResetIdleCounter()

void ttv::chat::ChatSession::ResetIdleCounter ( )
protected

◆ SetNick()

void ttv::chat::ChatSession::SetNick ( const std::string &  nick)

◆ SetWriter()

void ttv::chat::ChatSession::SetWriter ( std::shared_ptr< IChatWriteNetworkEvent writer)

◆ Topic()

void ttv::chat::ChatSession::Topic ( const std::string &  channel,
const std::string &  topic = std::string() 
)

Send a TOPIC command to the server.

◆ TwitchClient()

void ttv::chat::ChatSession::TwitchClient ( )

Send a TWITCHCLIENT command to the server.

◆ User()

void ttv::chat::ChatSession::User ( const std::string &  nick,
const std::string &  name 
)

Send a USER command to the server.

◆ UserHost()

void ttv::chat::ChatSession::UserHost ( const std::string &  user)

◆ Whois()

void ttv::chat::ChatSession::Whois ( const std::string &  target)

Member Data Documentation

◆ m_mapServerCaps

std::map<std::string, std::string> ttv::chat::ChatSession::m_mapServerCaps
private

◆ mConnected

bool ttv::chat::ChatSession::mConnected
private

◆ mEventHandlers

std::vector<IChatReceiveNetworkEvent*> ttv::chat::ChatSession::mEventHandlers
private

The child event handlers for incoming chat events.

◆ mLastActivity

uint64_t ttv::chat::ChatSession::mLastActivity
private

◆ mNick

std::string ttv::chat::ChatSession::mNick
private

◆ mWriter

std::shared_ptr<IChatWriteNetworkEvent> ttv::chat::ChatSession::mWriter
private

The stream writer.


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