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:
prozacx
2005-05-27 00:17:29 +00:00
parent b148e65898
commit 98eadd73a8
2 changed files with 22 additions and 0 deletions
+19
View File
@@ -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(); }