20 #include <znc/zncconfig.h>
42 : m_sUsername(sUsername), m_sPassword(sPassword), m_pSock(pSock) {}
51 m_sUsername = sUsername;
52 m_sPassword = sPassword;
246 bool bReconnect =
true);
254 void HandleCap(
const CMessage& Message);
255 void RespondCap(
const CString& sResponse);
256 void ParsePass(
const CString& sAuthLine);
257 void ParseUser(
const CString& sAuthLine);
258 void ParseIdentifier(
const CString& sAuthLine);
260 template <
typename T>
261 void AddBuffer(
const T& Message);
262 void EchoMessage(
const CMessage& Message);
264 std::set<CChan*> MatchChans(
const CString& sPatterns)
const;
265 unsigned int AttachChans(
const std::set<CChan*>& sChans);
266 unsigned int DetachChans(
const std::set<CChan*>& sChans);
274 bool OnPingMessage(
CMessage& Message);
275 bool OnPongMessage(
CMessage& Message);
279 bool OnOtherMessage(
CMessage& Message);
313 static const std::map<
CString, std::function<void(
CClient*,
bool bVal)>>&
std::set< CString > SCString
Definition: ZNCString.h:35
Definition: Message.h:231
virtual void AcceptedLogin(CUser &User)=0
const CString & GetUsername() const
Definition: Client.h:59
void AcceptLogin(CUser &User)
CAuthBase(const CAuthBase &)=delete
CAuthBase & operator=(const CAuthBase &)=delete
const CString & GetPassword() const
Definition: Client.h:60
virtual ~CAuthBase()
Definition: Client.h:44
virtual void RefusedLogin(const CString &sReason)=0
virtual void Invalidate()
Csock * GetSocket() const
Definition: Client.h:61
CAuthBase(const CString &sUsername, const CString &sPassword, CZNCSock *pSock)
Definition: Client.h:40
virtual void SetLoginInfo(const CString &sUsername, const CString &sPassword, CZNCSock *pSock)
Definition: Client.h:49
void RefuseLogin(const CString &sReason)
CString GetRemoteIP() const
Definition: Message.h:242
CClientAuth(CClient *pClient, const CString &sUsername, const CString &sPassword)
void Invalidate() override
Definition: Client.h:87
CClientAuth(const CClientAuth &)=delete
CClientAuth & operator=(const CClientAuth &)=delete
virtual ~CClientAuth()
Definition: Client.h:82
CClient * m_pClient
Definition: Client.h:96
void AcceptedLogin(CUser &User) override
void RefusedLogin(const CString &sReason) override
CString GetNickMask() const
bool HasSelfMessage() const
Definition: Client.h:127
bool IsTagEnabled(const CString &sTag) const
Definition: Client.h:218
void SetNetwork(CIRCNetwork *pNetwork, bool bDisconnect=true, bool bReconnect=true)
CString GetFullName() const
bool m_bEchoMessage
Definition: Client.h:297
CIRCNetwork * m_pNetwork
Definition: Client.h:301
void SendRequiredPasswordNotice()
bool PutClientRaw(const CString &sLine)
Sends a raw data line to the client.
void SetTagSupport(const CString &sTag, bool bState)
Registers a tag as being supported or unsupported by the client.
void UserCommand(CString &sLine)
CString m_sNick
Definition: Client.h:302
bool m_bAccountNotify
Definition: Client.h:289
static bool IsValidIdentifier(const CString &sIdentifier)
bool m_bAway
Definition: Client.h:294
bool HasCapNotify() const
Definition: Client.h:116
void PutClient(const CString &sLine)
Sends a message to the client.
CString m_sNetwork
Definition: Client.h:305
CClient & operator=(const CClient &)=delete
bool m_bBatch
Definition: Client.h:296
void PutIRC(const CString &sLine)
bool m_bChgHost
Definition: Client.h:293
std::shared_ptr< CAuthBase > m_spAuth
Definition: Client.h:307
CClient(const CClient &)=delete
CString GetNick(bool bAllowIRCNick=true) const
unsigned int PutStatus(const CTable &table)
bool m_bInCap
Definition: Client.h:286
void StatusCTCP(const CString &sCommand)
CString GetIdentifier() const
Definition: Client.h:113
bool m_bGotNick
Definition: Client.h:283
bool HasCap302() const
Definition: Client.h:115
void ReadLine(const CString &sData) override
bool IsPlaybackActive() const
Definition: Client.h:137
CString m_sPass
Definition: Client.h:303
SCString m_ssAcceptedCaps
Definition: Client.h:308
bool m_bGotPass
Definition: Client.h:282
bool IsAttached() const
Definition: Client.h:135
bool HasServerTime() const
Definition: Client.h:124
const std::vector< CClient * > & GetClients() const
void HelpUser(const CString &sFilter="")
bool HasBatch() const
Definition: Client.h:125
bool HasUHNames() const
Definition: Client.h:121
bool HasAwayNotify() const
Definition: Client.h:117
bool HasChgHost() const
Definition: Client.h:122
void PutStatusNotice(const CString &sLine)
void SetPlaybackActive(bool bActive)
Definition: Client.h:138
unsigned short int m_uCapVersion
Definition: Client.h:285
const CIRCSock * GetIRCSock() const
bool m_bServerTime
Definition: Client.h:295
void ReachedMaxBuffer() override
This WARNING event is called when your buffer for readline exceeds the warning threshold and triggers...
SCString m_ssSupportedTags
Definition: Client.h:309
bool IsCapEnabled(const CString &sCap) const
Definition: Client.h:214
void PutStatus(const CString &sLine)
static const std::map< CString, std::function< void(CClient *, bool bVal)> > & CoreCaps()
void Timeout() override
Sock Timed out event.
bool m_bGotUser
Definition: Client.h:284
void SetAway(bool bAway)
Definition: Client.h:243
bool m_bSelfMessage
Definition: Client.h:298
CUser * m_pUser
Definition: Client.h:300
void SetNick(const CString &s)
friend class CCoreCaps
Definition: Client.h:317
void Disconnected() override
Disconnected event.
void UserPortCommand(CString &sLine)
void Connected() override
Connected event.
void PutModNotice(const CString &sModule, const CString &sLine)
bool m_bPlaybackActive
Definition: Client.h:299
bool IsAway() const
Definition: Client.h:123
bool m_bNamesx
Definition: Client.h:291
CUser * GetUser() const
Definition: Client.h:244
friend class ClientTest
Definition: Client.h:316
bool HasEchoMessage() const
Definition: Client.h:126
bool HasAccountNotify() const
Definition: Client.h:118
bool HasExtendedJoin() const
Definition: Client.h:119
void PutModule(const CString &sModule, const CString &sLine)
void NotifyServerDependentCap(const CString &sCap, bool bValue, const CString &sValue)
Notifies client about one specific cap which server has just notified us about.
void AcceptLogin(CUser &User)
CString m_sUser
Definition: Client.h:304
bool m_bAwayNotify
Definition: Client.h:288
bool m_bExtendedJoin
Definition: Client.h:290
bool m_bCapNotify
Definition: Client.h:287
bool HasNamesx() const
Definition: Client.h:120
void ConnectionRefused() override
Connection Refused Event.
CIRCNetwork * GetNetwork() const
Definition: Client.h:247
unsigned short int CapVersion() const
Definition: Client.h:114
bool m_bUHNames
Definition: Client.h:292
bool PutClient(const CMessage &Message)
Sends a message to the client.
CString m_sIdentifier
Definition: Client.h:306
void RefuseLogin(const CString &sReason)
Definition: Translation.h:103
Definition: IRCNetwork.h:40
Base IRC socket for client<->ZNC, and ZNC<->server.
Definition: Socket.h:309
Definition: Message.h:252
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: Message.h:259
Definition: Message.h:280
Definition: Message.h:304
Definition: Message.h:313
String class that is used inside ZNC.
Definition: ZNCString.h:68
Generate a grid-like or list-like output from a given input.
Definition: Utils.h:172
Definition: Message.h:322
Definition: Message.h:329
Basic socket class.
Definition: Csocket.h:564