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:
Jos Ahrens
2015-09-07 13:14:32 +02:00
committed by J-P Nurmi
parent 9e1b1f5aee
commit b67f9182d6
+20
View File
@@ -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;
}
};