mirror of
https://github.com/znc/znc.git
synced 2026-03-28 17:42:41 +01:00
Save channel key on user JOIN even if user was not on the channel yet,
which is the usual case. Fix #1223
This commit is contained in:
@@ -1065,13 +1065,20 @@ bool CClient::OnJoinMessage(CJoinMessage& Message) {
|
||||
CString sChannel = Message.GetTarget();
|
||||
CString sKey = Message.GetKey();
|
||||
|
||||
CChan* pChan = m_pNetwork ? m_pNetwork->FindChan(sChannel) : nullptr;
|
||||
if (pChan) {
|
||||
if (pChan->IsDetached())
|
||||
pChan->AttachUser(this);
|
||||
else
|
||||
pChan->JoinUser(sKey);
|
||||
continue;
|
||||
if (m_pNetwork) {
|
||||
CChan* pChan = m_pNetwork->FindChan(sChannel);
|
||||
if (pChan) {
|
||||
if (pChan->IsDetached())
|
||||
pChan->AttachUser(this);
|
||||
else
|
||||
pChan->JoinUser(sKey);
|
||||
continue;
|
||||
} else if (!sChannel.empty()) {
|
||||
pChan = new CChan(sChannel, m_pNetwork, false);
|
||||
if (m_pNetwork->AddChan(pChan)) {
|
||||
pChan->SetKey(sKey);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!sChannel.empty()) {
|
||||
|
||||
Reference in New Issue
Block a user