mirror of
https://github.com/znc/znc.git
synced 2026-04-30 10:34:16 +02:00
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:
11
Chan.cpp
11
Chan.cpp
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user