From 7e7e85a22f7cc7c6a4f7e51c3052103970990926 Mon Sep 17 00:00:00 2001 From: prozacx Date: Thu, 15 Sep 2005 04:15:56 +0000 Subject: [PATCH] Added GetOptions() git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@497 726aef4b-f618-498e-8847-2d620e286838 --- Chan.cpp | 18 ++++++++++++++++++ Chan.h | 1 + 2 files changed, 19 insertions(+) diff --git a/Chan.cpp b/Chan.cpp index f14d85d6..711e7122 100644 --- a/Chan.cpp +++ b/Chan.cpp @@ -275,6 +275,24 @@ void CChan::ModeChange(const CString& sModes, const CString& sOpNick) { } } +CString CChan::GetOptions() const { + CString sRet; + + if (IsDetached()) { + sRet += (sRet.empty()) ? "Detached" : ", Detached"; + } + + if (AutoCycle()) { + sRet += (sRet.empty()) ? "AutoCycle" : ", AutoCycle"; + } + + if (KeepBuffer()) { + sRet += (sRet.empty()) ? "KeepBuffer" : ", KeepBuffer"; + } + + return sRet; +} + CString CChan::GetModeArg(unsigned char uMode) const { if (uMode) { map::const_iterator it = m_musModes.find(uMode); diff --git a/Chan.h b/Chan.h index 2cff6177..18559d45 100644 --- a/Chan.h +++ b/Chan.h @@ -109,6 +109,7 @@ public: // Getters bool HasMode(unsigned char uMode) const; + CString GetOptions() const; CString GetModeArg(unsigned char uMode) const; unsigned int GetPermCount(unsigned char uPerm); const bool IsOn() const { return m_bIsOn; }