Channel: Don't let nicks leak private info.

Signed-off-by: James Vega <jamessan@users.sourceforge.net>
This commit is contained in:
James Vega 2009-05-25 00:30:13 -04:00
parent 54dda880d4
commit 8bd37dbff7

View File

@ -766,10 +766,17 @@ class Channel(callbacks.Plugin):
Returns the nicks in <channel>. <channel> is only necessary if the
message isn't sent in the channel itself.
"""
# Make sure we don't elicit information about private channels to
# people or channels that shouldn't know
if 's' in irc.state.channels[channel].modes and \
msg.args[0] != channel and \
(ircutils.isChannel(msg.args[0]) or \
msg.nick not in irc.state.channels[channel].users):
irc.error('You don\'t have access to that information.')
L = list(irc.state.channels[channel].users)
utils.sortBy(str.lower, L)
irc.reply(utils.str.commaAndify(L))
nicks = wrap(nicks, ['inChannel']) # XXX Check that the caller is in chan.
nicks = wrap(nicks, ['inChannel'])
def alertOps(self, irc, channel, s, frm=None):
"""Internal message for notifying all the #channel,ops in a channel of