mirror of
https://github.com/znc/znc.git
synced 2026-08-06 17:03:14 +02:00
Added AutoCycle and GetCurrentServer()
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@410 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -28,6 +28,7 @@ CUser::CUser(const CString& sUserName, CZNC* pZNC) {
|
||||
m_sStatusPrefix = "*";
|
||||
m_uBufferCount = 50;
|
||||
m_bKeepBuffer = false;
|
||||
m_bAutoCycle = true;
|
||||
m_pKeepNickTimer = new CKeepNickTimer(this);
|
||||
m_pJoinTimer = new CJoinTimer(this);
|
||||
m_pZNC->GetManager().AddCron(m_pKeepNickTimer);
|
||||
@@ -258,6 +259,16 @@ CServer* CUser::GetNextServer() {
|
||||
return m_vServers[m_uServerIdx++]; // Todo: cycle through these
|
||||
}
|
||||
|
||||
CServer* CUser::GetCurrentServer() {
|
||||
unsigned int uIdx = (m_uServerIdx) ? m_uServerIdx -1 : 0;
|
||||
|
||||
if (uIdx >= m_vServers.size()) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return m_vServers[uIdx];
|
||||
}
|
||||
|
||||
bool CUser::CheckPass(const CString& sPass) {
|
||||
if (!m_bPassHashed) {
|
||||
return (sPass == m_sPass);
|
||||
@@ -469,6 +480,7 @@ void CUser::SetQuitMsg(const CString& s) { m_sQuitMsg = s; }
|
||||
void CUser::AddCTCPReply(const CString& sCTCP, const CString& sReply) { m_mssCTCPReplies[sCTCP.AsUpper()] = sReply; }
|
||||
void CUser::SetBufferCount(unsigned int u) { m_uBufferCount = u; }
|
||||
void CUser::SetKeepBuffer(bool b) { m_bKeepBuffer = b; }
|
||||
void CUser::SetAutoCycle(bool b) { m_bAutoCycle = b; }
|
||||
|
||||
bool CUser::SetStatusPrefix(const CString& s) {
|
||||
if ((!s.empty()) && (s.length() < 6) && (s.find(' ') == CString::npos)) {
|
||||
@@ -547,4 +559,5 @@ CString CUser::GetQuitMsg() const { return (!m_sQuitMsg.empty()) ? m_sQuitMsg :
|
||||
const MCString& CUser::GetCTCPReplies() const { return m_mssCTCPReplies; }
|
||||
unsigned int CUser::GetBufferCount() const { return m_uBufferCount; }
|
||||
bool CUser::KeepBuffer() const { return m_bKeepBuffer; }
|
||||
bool CUser::AutoCycle() const { return m_bAutoCycle; }
|
||||
// !Getters
|
||||
|
||||
@@ -36,6 +36,7 @@ public:
|
||||
bool AddServer(const CString& sName);
|
||||
bool AddServer(const CString& sName, unsigned short uPort, const CString& sPass = "", bool bSSL = false);
|
||||
CServer* GetNextServer();
|
||||
CServer* GetCurrentServer();
|
||||
bool CheckPass(const CString& sPass);
|
||||
bool AddAllowedHost(const CString& sHostMask);
|
||||
bool IsHostAllowed(const CString& sHostMask);
|
||||
@@ -85,6 +86,7 @@ public:
|
||||
void AddCTCPReply(const CString& sCTCP, const CString& sReply);
|
||||
void SetBufferCount(unsigned int u);
|
||||
void SetKeepBuffer(bool b);
|
||||
void SetAutoCycle(bool b);
|
||||
// !Setters
|
||||
|
||||
// Getters
|
||||
@@ -123,6 +125,7 @@ public:
|
||||
const MCString& GetCTCPReplies() const;
|
||||
unsigned int GetBufferCount() const;
|
||||
bool KeepBuffer() const;
|
||||
bool AutoCycle() const;
|
||||
// !Getters
|
||||
private:
|
||||
protected:
|
||||
@@ -155,6 +158,7 @@ protected:
|
||||
bool m_bKeepNick;
|
||||
bool m_bDenyLoadMod;
|
||||
bool m_bKeepBuffer;
|
||||
bool m_bAutoCycle;
|
||||
|
||||
CKeepNickTimer* m_pKeepNickTimer;
|
||||
CJoinTimer* m_pJoinTimer;
|
||||
|
||||
Reference in New Issue
Block a user