ZNC  trunk
Public Types | Public Member Functions | Protected Attributes | List of all members
CChan Class Reference

#include <Chan.h>

+ Inheritance diagram for CChan:
+ Collaboration diagram for CChan:

Public Types

enum  EUserPerms {
  Voice = '+' , HalfOp = '' , Op = '@' , Admin = '!' ,
  Owner = '*'
}
 
enum  EModes {
  M_Private = 'p' , M_Secret = 's' , M_Moderated = 'm' , M_InviteOnly = 'i' ,
  M_NoMessages = 'n' , M_OpTopic = 't' , M_Limit = 'l' , M_Key = 'k' ,
  M_Op = 'o' , M_Voice = 'v' , M_Ban = 'b' , M_Except = 'e'
}
 

Public Member Functions

 CChan (const CString &sName, CIRCNetwork *pNetwork, bool bInConfig, CConfig *pConfig=nullptr)
 
 ~CChan ()
 
 CChan (const CChan &)=delete
 
CChanoperator= (const CChan &)=delete
 
void Reset ()
 
CConfig ToConfig () const
 
void Clone (CChan &chan)
 
void Cycle () const
 
void JoinUser (const CString &sKey="")
 
void AttachUser (CClient *pClient=nullptr)
 
void DetachUser ()
 
void OnWho (const CString &sNick, const CString &sIdent, const CString &sHost)
 
void SetModes (const CString &s)
 
void SetModes (const CString &sModes, const VCString &vsModeParams)
 Set the current modes for this channel. More...
 
void ModeChange (const CString &sModes, const CNick *OpNick=nullptr)
 
void ModeChange (const CString &sModes, const VCString &vsModeParams, const CNick *OpNick=nullptr)
 Handle changing the modes on a channel. More...
 
bool AddMode (char cMode, const CString &sArg)
 
bool RemMode (char cMode)
 
CString GetModeString () const
 
CString GetModeArg (CString &sArgs) const
 
CString GetModeForNames () const
 
void ClearNicks ()
 
const CNickFindNick (const CString &sNick) const
 
CNickFindNick (const CString &sNick)
 
int AddNicks (const CString &sNicks)
 
bool AddNick (const CString &sNick)
 
bool RemNick (const CString &sNick)
 
bool ChangeNick (const CString &sOldNick, const CString &sNewNick)
 
const CBufferGetBuffer () const
 
unsigned int GetBufferCount () const
 
bool SetBufferCount (unsigned int u, bool bForce=false)
 
void InheritBufferCount (unsigned int u, bool bForce=false)
 
void ResetBufferCount ()
 
size_t AddBuffer (const CMessage &Format, const CString &sText="")
 
size_t AddBuffer (const CString &sFormat, const CString &sText="", const timeval *ts=nullptr, const MCString &mssTags=MCString::EmptyMap)
 
void ClearBuffer ()
 
void SendBuffer (CClient *pClient)
 
void SendBuffer (CClient *pClient, const CBuffer &Buffer)
 
CString GetPermStr () const
 e.g. '@' for chanop. More...
 
bool HasPerm (char cPerm) const
 e.g. '@' for chanop. More...
 
bool AddPerm (char cPerm)
 e.g. '@' for chanop. More...
 
bool RemPerm (char cPerm)
 e.g. '@' for chanop. More...
 
void SetModeKnown (bool b)
 
void SetIsOn (bool b)
 
void SetKey (const CString &s)
 
void SetTopic (const CString &s)
 
void SetTopicOwner (const CString &s)
 
void SetTopicDate (unsigned long u)
 
void SetDefaultModes (const CString &s)
 
void SetAutoClearChanBuffer (bool b)
 
void InheritAutoClearChanBuffer (bool b)
 
void ResetAutoClearChanBuffer ()
 
void SetDetached (bool b=true)
 
void SetInConfig (bool b)
 
void SetCreationDate (unsigned long u)
 
void Disable ()
 
void Enable ()
 
void IncJoinTries ()
 
void ResetJoinTries ()
 
CIRCNetworkGetNetwork () const
 
bool IsModeKnown () const
 
bool HasMode (char cMode) const
 
CString GetOptions () const
 
CString GetModeArg (char cMode) const
 
std::map< char, unsigned int > GetPermCounts () const
 
bool IsOn () const
 
const CStringGetName () const
 
const std::map< char, CString > & GetModes () const
 
const CStringGetKey () const
 
const CStringGetTopic () const
 
const CStringGetTopicOwner () const
 
unsigned long GetTopicDate () const
 
const CStringGetDefaultModes () const
 
const std::map< CString, CNick > & GetNicks () const
 
size_t GetNickCount () const
 
bool AutoClearChanBuffer () const
 
bool IsDetached () const
 
bool InConfig () const
 
unsigned long GetCreationDate () const
 
bool IsDisabled () const
 
unsigned int GetJoinTries () const
 
bool HasBufferCountSet () const
 
bool HasAutoClearChanBufferSet () const
 

Protected Attributes

bool m_bDetached
 
bool m_bIsOn
 
bool m_bAutoClearChanBuffer
 
bool m_bInConfig
 
bool m_bDisabled
 
bool m_bHasBufferCountSet
 
bool m_bHasAutoClearChanBufferSet
 
CString m_sName
 
CString m_sKey
 
CString m_sTopic
 
CString m_sTopicOwner
 
unsigned long m_ulTopicDate
 
unsigned long m_ulCreationDate
 
CIRCNetworkm_pNetwork
 
CNick m_Nick
 
unsigned int m_uJoinTries
 
CString m_sDefaultModes
 
std::map< CString, CNickm_msNicks
 
CBuffer m_Buffer
 
bool m_bModeKnown
 
std::map< char, CStringm_mcsModes
 

Member Enumeration Documentation

◆ EModes

Enumerator
M_Private 
M_Secret 
M_Moderated 
M_InviteOnly 
M_NoMessages 
M_OpTopic 
M_Limit 
M_Key 
M_Op 
M_Voice 
M_Ban 
M_Except 

◆ EUserPerms

Enumerator
Voice 
HalfOp 
Op 
Admin 
Owner 

Constructor & Destructor Documentation

◆ CChan() [1/2]

CChan::CChan ( const CString sName,
CIRCNetwork pNetwork,
bool  bInConfig,
CConfig pConfig = nullptr 
)

◆ ~CChan()

CChan::~CChan ( )

◆ CChan() [2/2]

CChan::CChan ( const CChan )
delete

Member Function Documentation

◆ AddBuffer() [1/2]

size_t CChan::AddBuffer ( const CMessage Format,
const CString sText = "" 
)
inline

References CBuffer::AddLine(), and m_Buffer.

◆ AddBuffer() [2/2]

size_t CChan::AddBuffer ( const CString sFormat,
const CString sText = "",
const timeval *  ts = nullptr,
const MCString mssTags = MCString::EmptyMap 
)
inline

◆ AddMode()

bool CChan::AddMode ( char  cMode,
const CString sArg 
)

◆ AddNick()

bool CChan::AddNick ( const CString sNick)

◆ AddNicks()

int CChan::AddNicks ( const CString sNicks)

◆ AddPerm()

bool CChan::AddPerm ( char  cPerm)
inline

e.g. '@' for chanop.

References CNick::AddPerm(), and m_Nick.

◆ AttachUser()

void CChan::AttachUser ( CClient pClient = nullptr)

◆ AutoClearChanBuffer()

bool CChan::AutoClearChanBuffer ( ) const
inline

◆ ChangeNick()

bool CChan::ChangeNick ( const CString sOldNick,
const CString sNewNick 
)

◆ ClearBuffer()

void CChan::ClearBuffer ( )
inline

References CBuffer::Clear(), and m_Buffer.

◆ ClearNicks()

void CChan::ClearNicks ( )

◆ Clone()

void CChan::Clone ( CChan chan)

◆ Cycle()

void CChan::Cycle ( ) const

◆ DetachUser()

void CChan::DetachUser ( )

◆ Disable()

void CChan::Disable ( )
inline

References m_bDisabled.

◆ Enable()

void CChan::Enable ( )

◆ FindNick() [1/2]

CNick* CChan::FindNick ( const CString sNick)

◆ FindNick() [2/2]

const CNick* CChan::FindNick ( const CString sNick) const

◆ GetBuffer()

const CBuffer& CChan::GetBuffer ( ) const
inline

References m_Buffer.

◆ GetBufferCount()

unsigned int CChan::GetBufferCount ( ) const
inline

◆ GetCreationDate()

unsigned long CChan::GetCreationDate ( ) const
inline

References m_ulCreationDate.

◆ GetDefaultModes()

const CString& CChan::GetDefaultModes ( ) const
inline

References m_sDefaultModes.

◆ GetJoinTries()

unsigned int CChan::GetJoinTries ( ) const
inline

References m_uJoinTries.

◆ GetKey()

const CString& CChan::GetKey ( ) const
inline

References m_sKey.

◆ GetModeArg() [1/2]

CString CChan::GetModeArg ( char  cMode) const

◆ GetModeArg() [2/2]

CString CChan::GetModeArg ( CString sArgs) const

◆ GetModeForNames()

CString CChan::GetModeForNames ( ) const

◆ GetModes()

const std::map<char, CString>& CChan::GetModes ( ) const
inline

References m_mcsModes.

◆ GetModeString()

CString CChan::GetModeString ( ) const

◆ GetName()

const CString& CChan::GetName ( ) const
inline

References m_sName.

◆ GetNetwork()

CIRCNetwork* CChan::GetNetwork ( ) const
inline

References m_pNetwork.

◆ GetNickCount()

size_t CChan::GetNickCount ( ) const
inline

References m_msNicks.

◆ GetNicks()

const std::map<CString, CNick>& CChan::GetNicks ( ) const
inline

References m_msNicks.

◆ GetOptions()

CString CChan::GetOptions ( ) const

◆ GetPermCounts()

std::map<char, unsigned int> CChan::GetPermCounts ( ) const

◆ GetPermStr()

CString CChan::GetPermStr ( ) const
inline

e.g. '@' for chanop.

References CNick::GetPermStr(), and m_Nick.

◆ GetTopic()

const CString& CChan::GetTopic ( ) const
inline

References m_sTopic.

◆ GetTopicDate()

unsigned long CChan::GetTopicDate ( ) const
inline

References m_ulTopicDate.

◆ GetTopicOwner()

const CString& CChan::GetTopicOwner ( ) const
inline

References m_sTopicOwner.

◆ HasAutoClearChanBufferSet()

bool CChan::HasAutoClearChanBufferSet ( ) const
inline

◆ HasBufferCountSet()

bool CChan::HasBufferCountSet ( ) const
inline

References m_bHasBufferCountSet.

◆ HasMode()

bool CChan::HasMode ( char  cMode) const

◆ HasPerm()

bool CChan::HasPerm ( char  cPerm) const
inline

e.g. '@' for chanop.

References CNick::HasPerm(), and m_Nick.

◆ IncJoinTries()

void CChan::IncJoinTries ( )
inline

References m_uJoinTries.

◆ InConfig()

bool CChan::InConfig ( ) const
inline

References m_bInConfig.

◆ InheritAutoClearChanBuffer()

void CChan::InheritAutoClearChanBuffer ( bool  b)

◆ InheritBufferCount()

void CChan::InheritBufferCount ( unsigned int  u,
bool  bForce = false 
)
inline

◆ IsDetached()

bool CChan::IsDetached ( ) const
inline

References m_bDetached.

◆ IsDisabled()

bool CChan::IsDisabled ( ) const
inline

References m_bDisabled.

◆ IsModeKnown()

bool CChan::IsModeKnown ( ) const
inline

References m_bModeKnown.

◆ IsOn()

bool CChan::IsOn ( ) const
inline

References m_bIsOn.

◆ JoinUser()

void CChan::JoinUser ( const CString sKey = "")

◆ ModeChange() [1/2]

void CChan::ModeChange ( const CString sModes,
const CNick OpNick = nullptr 
)
Deprecated:
Use ModeChange(CString, VCString, CNick*)

◆ ModeChange() [2/2]

void CChan::ModeChange ( const CString sModes,
const VCString vsModeParams,
const CNick OpNick = nullptr 
)

Handle changing the modes on a channel.

Parameters
sModesThe mode string (eg. +ovbs-pbo)
vsModeParamsThe parameters for the mode string

◆ OnWho()

void CChan::OnWho ( const CString sNick,
const CString sIdent,
const CString sHost 
)

◆ operator=()

CChan& CChan::operator= ( const CChan )
delete

◆ RemMode()

bool CChan::RemMode ( char  cMode)

◆ RemNick()

bool CChan::RemNick ( const CString sNick)

◆ RemPerm()

bool CChan::RemPerm ( char  cPerm)
inline

e.g. '@' for chanop.

References m_Nick, and CNick::RemPerm().

◆ Reset()

void CChan::Reset ( )

Referenced by SetIsOn().

◆ ResetAutoClearChanBuffer()

void CChan::ResetAutoClearChanBuffer ( )

◆ ResetBufferCount()

void CChan::ResetBufferCount ( )

◆ ResetJoinTries()

void CChan::ResetJoinTries ( )
inline

References m_uJoinTries.

◆ SendBuffer() [1/2]

void CChan::SendBuffer ( CClient pClient)

◆ SendBuffer() [2/2]

void CChan::SendBuffer ( CClient pClient,
const CBuffer Buffer 
)

◆ SetAutoClearChanBuffer()

void CChan::SetAutoClearChanBuffer ( bool  b)

◆ SetBufferCount()

bool CChan::SetBufferCount ( unsigned int  u,
bool  bForce = false 
)
inline

◆ SetCreationDate()

void CChan::SetCreationDate ( unsigned long  u)
inline

References m_ulCreationDate.

◆ SetDefaultModes()

void CChan::SetDefaultModes ( const CString s)
inline

References m_sDefaultModes.

◆ SetDetached()

void CChan::SetDetached ( bool  b = true)
inline

References m_bDetached.

◆ SetInConfig()

void CChan::SetInConfig ( bool  b)

◆ SetIsOn()

void CChan::SetIsOn ( bool  b)
inline

References m_bIsOn, and Reset().

◆ SetKey()

void CChan::SetKey ( const CString s)

◆ SetModeKnown()

void CChan::SetModeKnown ( bool  b)
inline

References m_bModeKnown.

◆ SetModes() [1/2]

void CChan::SetModes ( const CString s)
Deprecated:
Use SetModes(CString, VCString)

◆ SetModes() [2/2]

void CChan::SetModes ( const CString sModes,
const VCString vsModeParams 
)

Set the current modes for this channel.

Parameters
sModesThe mode characters being changed
vsModeParamsThe parameters for the modes to be set

◆ SetTopic()

void CChan::SetTopic ( const CString s)
inline

References m_sTopic.

◆ SetTopicDate()

void CChan::SetTopicDate ( unsigned long  u)
inline

References m_ulTopicDate.

◆ SetTopicOwner()

void CChan::SetTopicOwner ( const CString s)
inline

References m_sTopicOwner.

◆ ToConfig()

CConfig CChan::ToConfig ( ) const

Member Data Documentation

◆ m_bAutoClearChanBuffer

bool CChan::m_bAutoClearChanBuffer
protected

Referenced by AutoClearChanBuffer().

◆ m_bDetached

bool CChan::m_bDetached
protected

Referenced by IsDetached(), and SetDetached().

◆ m_bDisabled

bool CChan::m_bDisabled
protected

Referenced by Disable(), and IsDisabled().

◆ m_bHasAutoClearChanBufferSet

bool CChan::m_bHasAutoClearChanBufferSet
protected

◆ m_bHasBufferCountSet

bool CChan::m_bHasBufferCountSet
protected

◆ m_bInConfig

bool CChan::m_bInConfig
protected

Referenced by InConfig().

◆ m_bIsOn

bool CChan::m_bIsOn
protected

Referenced by IsOn(), and SetIsOn().

◆ m_bModeKnown

bool CChan::m_bModeKnown
protected

Referenced by IsModeKnown(), and SetModeKnown().

◆ m_Buffer

CBuffer CChan::m_Buffer
protected

◆ m_mcsModes

std::map<char, CString> CChan::m_mcsModes
protected

Referenced by GetModes().

◆ m_msNicks

std::map<CString, CNick> CChan::m_msNicks
protected

Referenced by GetNickCount(), and GetNicks().

◆ m_Nick

CNick CChan::m_Nick
protected

Referenced by AddPerm(), GetPermStr(), HasPerm(), and RemPerm().

◆ m_pNetwork

CIRCNetwork* CChan::m_pNetwork
protected

Referenced by GetNetwork().

◆ m_sDefaultModes

CString CChan::m_sDefaultModes
protected

Referenced by GetDefaultModes(), and SetDefaultModes().

◆ m_sKey

CString CChan::m_sKey
protected

Referenced by GetKey().

◆ m_sName

CString CChan::m_sName
protected

Referenced by GetName().

◆ m_sTopic

CString CChan::m_sTopic
protected

Referenced by GetTopic(), and SetTopic().

◆ m_sTopicOwner

CString CChan::m_sTopicOwner
protected

Referenced by GetTopicOwner(), and SetTopicOwner().

◆ m_uJoinTries

unsigned int CChan::m_uJoinTries
protected

◆ m_ulCreationDate

unsigned long CChan::m_ulCreationDate
protected

Referenced by GetCreationDate(), and SetCreationDate().

◆ m_ulTopicDate

unsigned long CChan::m_ulTopicDate
protected

Referenced by GetTopicDate(), and SetTopicDate().


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