Support channels other than #chan or &chan

Without this e.g. +chans are changed to #+chans in CChan::CChan()
because IsChan() pretends it's sure that this can't be a channel.


git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@1019 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
psychon
2008-04-08 08:21:40 +00:00
parent 5590307909
commit 0afd0cf5dd
2 changed files with 12 additions and 3 deletions

View File

@@ -39,7 +39,7 @@ CUser::CUser(const CString& sUserName) {
m_bAdmin= false;
m_bDenySetVHost= false;
m_sStatusPrefix = "*";
m_sChanPrefixes = "#&";
m_sChanPrefixes = "";
m_uBufferCount = 50;
m_uMaxJoinTries = 0;
m_bKeepBuffer = false;
@@ -984,6 +984,15 @@ void CUser::SetUserName(const CString& s) {
m_sUserName = s;
}
bool CUser::IsChan(const CString& sChan) const {
if (sChan.empty())
return false; // There is no way this is a chan
if (GetChanPrefixes().empty())
return true; // We can't know, so we allow everything
// Thanks to the above if(empty), we can do sChan[0]
return GetChanPrefixes().find(sChan[0]) != CString::npos;
}
void CUser::SetNick(const CString& s) { m_sNick = s; }
void CUser::SetAltNick(const CString& s) { m_sAltNick = s; }
void CUser::SetIdent(const CString& s) { m_sIdent = s; }