Fixed bug when client tried to cycle.. only attach a user to a chan if it is detached or bForce is set

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@259 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
prozacx
2005-05-10 22:41:49 +00:00
parent 67e9b0ecd8
commit 3196299a95
2 changed files with 19 additions and 7 deletions
+18 -6
View File
@@ -42,8 +42,8 @@ void CChan::Cycle() const {
m_pUser->PutIRC("PART " + GetName() + "\r\nJOIN " + GetName() + " " + GetKey());
}
void CChan::JoinUser() {
if (!IsOn()) {
void CChan::JoinUser(bool bForce) {
if (!bForce && (!IsOn() || !IsDetached())) {
IncClientRequests();
m_pUser->PutIRC("JOIN " + GetName());
return;
@@ -244,18 +244,30 @@ bool CChan::AddNick(const CString& sNick) {
const char* p = sNick.c_str();
bool bIsOp = false;
bool bIsVoice = false;
bool bNoMode = false;
switch (*p) {
case '\0':
return false;
case '@':
bIsOp = true;
break;
case '+':
if (!*++p) {
return false;
}
bIsVoice = true;
break;
case '%':
break;
case '*':
break;
case '!':
break;
default:
bNoMode = true;
break;
}
bIsVoice = !bIsOp;
if (!bNoMode && !*++p) {
return false;
}
CNick* pNick = FindNick(p);