mirror of
https://github.com/znc/znc.git
synced 2026-05-07 05:44:41 +02:00
Fix stickychan joining inaccessable channels.
Channels that raise this error are unlikely to ever be unblocked, either due to a jupe, or because the name contains illegal characters.
This commit is contained in:
@@ -175,6 +175,26 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
EModRet OnRaw(CString& sLine) override {
|
||||
CString sNumeric = sLine.Token(1);
|
||||
|
||||
if (sNumeric.Equals("479")) {
|
||||
// ERR_BADCHANNAME (juped channels or illegal channel name - ircd hybrid)
|
||||
// prevent the module from getting into an infinite loop of trying to join it.
|
||||
// :irc.network.net 479 mynick #channel :Illegal channel name
|
||||
|
||||
CString sChannel = sLine.Token(3);
|
||||
for (MCString::iterator it = BeginNV(); it != EndNV(); ++it) {
|
||||
if (sChannel.Equals(it->first)) {
|
||||
PutModule("Channel [" + sChannel + "] cannot be joined, it is an illegal channel name. Unsticking.");
|
||||
OnUnstickCommand("unstick " + sChannel);
|
||||
return CONTINUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return CONTINUE;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user