17 #ifndef ZNC_IRCNETWORK_H
18 #define ZNC_IRCNETWORK_H
20 #include <znc/zncconfig.h>
36 class CIRCNetworkPingTimer;
37 class CIRCNetworkJoinTimer;
82 CClient* pSkipClient =
nullptr);
84 CClient* pSkipClient =
nullptr);
86 CClient* pSkipClient =
nullptr);
119 const CString& sPass =
"",
bool bSSL =
false);
282 bool JoinChan(
CChan* pChan);
std::set< CString > SCString
Definition: ZNCString.h:35
size_type UpdateLine(const CString &sCommand, const CMessage &Format, const CString &sText="")
size_type AddLine(const CMessage &Format, const CString &sText="")
void Clear()
Definition: Buffer.h:100
size_type UpdateExactLine(const CMessage &Format, const CString &sText="")
Definition: Translation.h:103
Definition: FileUtils.h:30
Definition: IRCNetwork.h:40
void DelTrustedFingerprint(const CString &sFP)
Definition: IRCNetwork.h:133
const CString & GetEncoding() const
void SetBindHost(const CString &s)
CString m_sNick
Definition: IRCNetwork.h:290
bool SetNextServer(const CServer *pServer)
void SetQuitMsg(const CString &s)
const CIRCSock * GetIRCSock() const
Definition: IRCNetwork.h:142
unsigned long long BytesWritten() const
Definition: IRCNetwork.h:273
const CNick & GetIRCNick() const
CString m_sRealName
Definition: IRCNetwork.h:293
void AddNoticeBuffer(const CMessage &Format, const CString &sText="")
Definition: IRCNetwork.h:213
bool IsLastServer() const
void AddTrustedFingerprint(const CString &sFP)
Definition: IRCNetwork.h:129
CServer * FindServer(const CString &sName) const
void AddBytesWritten(unsigned long long u)
Definition: IRCNetwork.h:276
CUser * m_pUser
Definition: IRCNetwork.h:288
bool IsUserAttached() const
Definition: IRCNetwork.h:62
void ClearTrustedFingerprints()
Definition: IRCNetwork.h:136
void AddBytesRead(unsigned long long u)
Definition: IRCNetwork.h:275
CQuery * AddQuery(const CString &sName)
void SetIRCSocket(CIRCSock *pIRCSock)
CString ExpandString(const CString &sStr) const
void SetAltNick(const CString &s)
CIRCSock * GetIRCSock()
Definition: IRCNetwork.h:141
CServer * GetCurrentServer() const
CServer * GetNextServer(bool bAdvance=true)
CChan * FindChan(CString sName) const
CString m_sEncoding
Definition: IRCNetwork.h:295
void UpdateExactRawBuffer(const CMessage &Format, const CString &sText="")
Definition: IRCNetwork.h:173
CIRCNetwork(const CIRCNetwork &)=delete
static bool IsValidNetwork(const CString &sNetwork)
bool IsNetworkAttached() const
Definition: IRCNetwork.h:69
const std::vector< CQuery * > & GetQueries() const
bool IsIRCAway() const
Definition: IRCNetwork.h:147
void ClearNoticeBuffer()
Definition: IRCNetwork.h:220
bool IsUserOnline() const
unsigned short int m_uJoinDelay
Definition: IRCNetwork.h:330
void AddRawBuffer(const CString &sFormat, const CString &sText="")
Definition: IRCNetwork.h:180
CModules & GetModules()
Definition: IRCNetwork.h:77
void SetIdent(const CString &s)
bool PutStatus(const CString &sLine, CClient *pClient=nullptr, CClient *pSkipClient=nullptr)
bool m_bIRCAway
Definition: IRCNetwork.h:318
void ClientConnected(CClient *pClient)
void SetNick(const CString &s)
bool m_bTrustAllCerts
Definition: IRCNetwork.h:311
double GetFloodRate() const
Definition: IRCNetwork.h:252
CBuffer m_RawBuffer
Definition: IRCNetwork.h:323
const CString & GetBindHost() const
void AddNoticeBuffer(const CString &sFormat, const CString &sText="")
Definition: IRCNetwork.h:223
CString m_sName
Definition: IRCNetwork.h:287
bool IsChan(const CString &sChan) const
bool DelQuery(const CString &sName)
CIRCNetworkJoinTimer * m_pJoinTimer
Definition: IRCNetwork.h:328
CBuffer m_MotdBuffer
Definition: IRCNetwork.h:324
const std::vector< CClient * > & GetClients() const
Definition: IRCNetwork.h:70
SCString m_ssTrustedFingerprints
Definition: IRCNetwork.h:297
CString m_sBindHost
Definition: IRCNetwork.h:294
void UpdateRawBuffer(const CString &sMatch, const CString &sFormat, const CString &sText="")
Definition: IRCNetwork.h:184
CIRCNetwork(CUser *pUser, const CString &sName)
void SetFloodBurst(unsigned short int uFloodBurst)
Definition: IRCNetwork.h:255
CString GetCurNick() const
void SetTrustAllCerts(const bool bTrustAll=false)
Definition: IRCNetwork.h:264
const std::vector< CChan * > & GetChans() const
void SetIRCAway(bool b)
Definition: IRCNetwork.h:148
CNick m_IRCNick
Definition: IRCNetwork.h:317
bool GetTrustPKI() const
Definition: IRCNetwork.h:270
CIRCNetworkPingTimer * m_pPingTimer
Definition: IRCNetwork.h:327
CString m_sChanPrefixes
Definition: IRCNetwork.h:308
unsigned long long m_uBytesRead
Definition: IRCNetwork.h:331
CIRCSock * m_pIRCSock
Definition: IRCNetwork.h:303
CString GetQuitMsg() const
unsigned short int GetJoinDelay() const
Definition: IRCNetwork.h:259
void AddRawBuffer(const CMessage &Format, const CString &sText="")
Definition: IRCNetwork.h:166
const CString & GetIRCServer() const
bool HasServers() const
Definition: IRCNetwork.h:113
CBuffer m_NoticeBuffer
Definition: IRCNetwork.h:325
void ClearMotdBuffer()
Definition: IRCNetwork.h:201
CString & ExpandString(const CString &sStr, CString &sRet) const
const CString & GetNick(const bool bAllowDefault=true) const
bool PutModule(const CString &sModule, const CString &sLine, CClient *pClient=nullptr, CClient *pSkipClient=nullptr)
void AddMotdBuffer(const CMessage &Format, const CString &sText="")
Definition: IRCNetwork.h:194
bool PutUser(const CString &sLine, CClient *pClient=nullptr, CClient *pSkipClient=nullptr)
void SetUser(CUser *pUser)
std::vector< CChan * > m_vChans
Definition: IRCNetwork.h:305
std::vector< CQuery * > FindQueries(const CString &sWild) const
bool MoveChan(const CString &sChan, unsigned int index, CString &sError)
unsigned long long BytesRead() const
Definition: IRCNetwork.h:272
void SetTrustPKI(const bool bTrustPKI=true)
Definition: IRCNetwork.h:269
std::vector< CServer * > m_vServers
Definition: IRCNetwork.h:314
CString GetRealName() const
const CString & GetIdent(const bool bAllowDefault=true) const
void NotifyClientsAboutServerDependentCap(const CString &sCap, bool bValue)
std::vector< CClient * > FindClients(const CString &sIdentifier) const
CIRCNetwork(CUser *pUser, const CIRCNetwork &Network)
const CModules & GetModules() const
Definition: IRCNetwork.h:78
size_t m_uServerIdx
Index in m_vServers of our current server + 1.
Definition: IRCNetwork.h:315
void SetIRCServer(const CString &s)
void UpdateMotdBuffer(const CString &sCommand, const CMessage &Format, const CString &sText="")
Definition: IRCNetwork.h:197
CIRCNetwork & operator=(const CIRCNetwork &)=delete
void UpdateRawBuffer(const CString &sCommand, const CMessage &Format, const CString &sText="")
Definition: IRCNetwork.h:169
unsigned short int GetFloodBurst() const
Definition: IRCNetwork.h:253
std::vector< CChan * > FindChans(const CString &sWild) const
bool ParseConfig(CConfig *pConfig, CString &sError, bool bUpgrade=false)
const CString & GetAltNick(const bool bAllowDefault=true) const
bool DelServer(const CString &sName, unsigned short uPort, const CString &sPass)
CString m_sIRCServer
Definition: IRCNetwork.h:313
void SetJoinDelay(unsigned short int uJoinDelay)
Definition: IRCNetwork.h:260
bool AddChan(const CString &sName, bool bInConfig)
const std::vector< CServer * > & GetServers() const
CString m_sIdent
Definition: IRCNetwork.h:292
CString m_sAltNick
Definition: IRCNetwork.h:291
void SetIRCNick(const CNick &n)
const CString & GetName() const
bool PutIRC(const CMessage &Message)
bool GetTrustAllCerts() const
Definition: IRCNetwork.h:267
bool PutIRC(const CString &sLine)
void ClientDisconnected(CClient *pClient)
void ClearRawBuffer()
Definition: IRCNetwork.h:177
bool AddServer(const CString &sName, unsigned short uPort, const CString &sPass="", bool bSSL=false)
bool m_bIRCConnectEnabled
Definition: IRCNetwork.h:310
unsigned short int m_uFloodBurst
Definition: IRCNetwork.h:321
bool AddServer(const CString &sName)
bool m_bTrustPKI
Definition: IRCNetwork.h:312
bool SetName(const CString &sName)
unsigned long long m_uBytesWritten
Definition: IRCNetwork.h:332
std::vector< CQuery * > m_vQueries
Definition: IRCNetwork.h:306
void UpdateExactRawBuffer(const CString &sFormat, const CString &sText="")
Definition: IRCNetwork.h:189
CQuery * FindQuery(const CString &sName) const
bool PutUser(const CMessage &Message, CClient *pClient=nullptr, CClient *pSkipClient=nullptr)
CModules * m_pModules
Definition: IRCNetwork.h:299
CString GetNetworkPath() const
void UpdateNoticeBuffer(const CString &sCommand, const CMessage &Format, const CString &sText="")
Definition: IRCNetwork.h:216
CString m_sQuitMsg
Definition: IRCNetwork.h:296
bool IsServerCapAccepted(const CString &sCap) const
void UpdateMotdBuffer(const CString &sMatch, const CString &sFormat, const CString &sText="")
Definition: IRCNetwork.h:208
void SetIRCConnectEnabled(bool b)
bool IsIRCConnected() const
This method will return whether the user is connected and authenticated to an IRC server.
void SetChanPrefixes(const CString &s)
Definition: IRCNetwork.h:109
bool DelChan(const CString &sName)
void JoinChans(std::set< CChan * > &sChans)
bool GetIRCConnectEnabled() const
Definition: IRCNetwork.h:139
void SetFloodRate(double fFloodRate)
Definition: IRCNetwork.h:254
void UpdateNoticeBuffer(const CString &sMatch, const CString &sFormat, const CString &sText="")
Definition: IRCNetwork.h:227
void Clone(const CIRCNetwork &Network, bool bCloneName=true)
void SetEncoding(const CString &s)
bool AddChan(CChan *pChan)
void SetRealName(const CString &s)
double m_fFloodRate
Set to -1 to disable protection.
Definition: IRCNetwork.h:320
void AddMotdBuffer(const CString &sFormat, const CString &sText="")
Definition: IRCNetwork.h:204
std::vector< CClient * > m_vClients
Definition: IRCNetwork.h:301
const SCString & GetTrustedFingerprints() const
Definition: IRCNetwork.h:126
const CString & GetChanPrefixes() const
Definition: IRCNetwork.h:108
bool SwapChans(const CString &sChan1, const CString &sChan2, CString &sError)
Here is a small explanation of how messages on IRC work, and how you can use this class to get useful...
Definition: Message.h:57
Definition: Modules.h:1464
String class that is used inside ZNC.
Definition: ZNCString.h:68
@ EHEXCOLON
Definition: ZNCString.h:78
CString Escape_n(EEscape eFrom, EEscape eTo) const