Fixed issues with key when joining a 'trying' chan

git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@347 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
prozacx
2005-05-20 21:21:40 +00:00
parent c3a191d885
commit 41b5ea4398
3 changed files with 17 additions and 8 deletions

View File

@@ -44,10 +44,11 @@ void CChan::Cycle() const {
m_pUser->PutIRC("PART " + GetName() + "\r\nJOIN " + GetName() + " " + GetKey());
}
void CChan::JoinUser(bool bForce) {
void CChan::JoinUser(bool bForce, const CString& sKey) {
if (!bForce && (!IsOn() || !IsDetached())) {
IncClientRequests();
m_pUser->PutIRC("JOIN " + GetName());
m_pUser->PutIRC("JOIN " + GetName() + " " + ((sKey.empty()) ? GetKey() : sKey));
return;
}
@@ -124,7 +125,7 @@ CString CChan::GetModeString() const {
void CChan::SetModes(const CString& sModes) {
m_musModes.clear();
m_uLimit = 0;
m_sKey = "";
m_sCurKey = "";
ModeChange(sModes);
}
@@ -244,6 +245,10 @@ void CChan::ModeChange(const CString& sModes, const CString& sOpNick) {
break;
}
if (uMode == M_Key) {
m_sCurKey = (bAdd) ? sArg : "";
}
(bAdd) ? AddMode(uMode, sArg) : RemMode(uMode, sArg);
}
}