Most of the need-* functions (key, unban, limit, invite) are broken in 1.6.10, there's some new code inserted in them:
from src/mod/irc.mod/chan.c:
chan = findchan(chname);
if (!chan)
return 0;
This code has been added right before the tcl in the need-* settings is executed. First of all, chan is already correctly set, so this code is totally unnecessary. Secondly, it's also wrong, since the bot is not in the channel when it's requesting the key or limit. Thus findchan won't see it, findchan_by_dname would have to be used.
Do you even know what findchan and findchan_by_dname do? Sure doesn't sound like you do -- findchan doesn't care if the bot is on or off the channel, it does care though if the bot knows about the channel. That type of code was added to prevent the bot from crashing when people remove a channel via a bind.
You're right, I didn't investigate the differences between findchan and findchan_by_dname precisely. I made up my mind based on the comment in the proc from which I got that snip of code:
/* We use dname because name is first set on JOIN and we might not
* have joined the channel yet.
*/
So, if findchan_by_dname was used for a reason up above, stands to reason it should be used again since the bot is still in the same state. And again, this code is completely unnecessary since chan is already set and verified:
If the code mentioned in my first post is removed need-key et al work again. Whether or not findchan would work as well as findchan_by_dname I didn't test, but at the very least, findchan is used improperly since the variable chname is set with "!channel" for use by findchan_by_dname only.
It's all moot really, the code shouldn't even exist there.