mirror of
https://github.com/znc/znc.git
synced 2026-08-02 23:12:46 +02:00
Added IsLastServer() and ConnectPaused()
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@370 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#include "Timers.h"
|
||||
|
||||
CUser::CUser(const CString& sUserName, CZNC* pZNC) {
|
||||
m_uConnectTime = 0;
|
||||
m_sUserName = sUserName;
|
||||
m_sNick = sUserName;
|
||||
m_sIdent = sUserName;
|
||||
@@ -233,6 +234,10 @@ bool CUser::AddServer(const CString& sName, unsigned short uPort, const CString&
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CUser::IsLastServer() {
|
||||
return (m_uServerIdx >= m_vServers.size());
|
||||
}
|
||||
|
||||
CServer* CUser::GetNextServer() {
|
||||
if (m_vServers.empty()) {
|
||||
return NULL;
|
||||
@@ -500,6 +505,20 @@ CString CUser::FindModPath(const CString& sModule) const {
|
||||
return sModPath;
|
||||
}
|
||||
|
||||
bool CUser::ConnectPaused() {
|
||||
if (!m_uConnectTime) {
|
||||
m_uConnectTime = time(NULL);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (time(NULL) - m_uConnectTime >= 5) {
|
||||
m_uConnectTime = time(NULL);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
const CString& CUser::GetCurPath() const { return m_pZNC->GetCurPath(); }
|
||||
const CString& CUser::GetDLPath() const { return m_pZNC->GetDLPath(); }
|
||||
const CString& CUser::GetModPath() const { return m_pZNC->GetModPath(); }
|
||||
|
||||
Reference in New Issue
Block a user