mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-19 08:59:27 +01:00
Channel: use msg.prefix instead of nickToHostmask for capability checks
Closes #1233.
This commit is contained in:
parent
cbb9f8c699
commit
010da43b29
@ -909,10 +909,9 @@ class Channel(callbacks.Plugin):
|
|||||||
# Make sure we don't elicit information about private channels to
|
# Make sure we don't elicit information about private channels to
|
||||||
# people or channels that shouldn't know
|
# people or channels that shouldn't know
|
||||||
capability = ircdb.makeChannelCapability(channel, 'op')
|
capability = ircdb.makeChannelCapability(channel, 'op')
|
||||||
hostmask = irc.state.nickToHostmask(msg.nick)
|
|
||||||
if 's' in irc.state.channels[channel].modes and \
|
if 's' in irc.state.channels[channel].modes and \
|
||||||
msg.args[0] != channel and \
|
msg.args[0] != channel and \
|
||||||
not ircdb.checkCapability(hostmask, capability) and \
|
not ircdb.checkCapability(msg.prefix, capability) and \
|
||||||
(ircutils.isChannel(msg.args[0]) or \
|
(ircutils.isChannel(msg.args[0]) or \
|
||||||
msg.nick not in irc.state.channels[channel].users):
|
msg.nick not in irc.state.channels[channel].users):
|
||||||
irc.error(_('You don\'t have access to that information.'),
|
irc.error(_('You don\'t have access to that information.'),
|
||||||
@ -937,8 +936,7 @@ class Channel(callbacks.Plugin):
|
|||||||
if frm is not None:
|
if frm is not None:
|
||||||
s += format(_(' (from %s)'), frm)
|
s += format(_(' (from %s)'), frm)
|
||||||
for nick in irc.state.channels[channel].users:
|
for nick in irc.state.channels[channel].users:
|
||||||
hostmask = irc.state.nickToHostmask(nick)
|
if ircdb.checkCapability(msg.prefix, capability):
|
||||||
if ircdb.checkCapability(hostmask, capability):
|
|
||||||
irc.reply(s, to=nick, private=True)
|
irc.reply(s, to=nick, private=True)
|
||||||
irc.replySuccess()
|
irc.replySuccess()
|
||||||
|
|
||||||
@ -969,8 +967,7 @@ class Channel(callbacks.Plugin):
|
|||||||
else:
|
else:
|
||||||
irc.error(Raise=True)
|
irc.error(Raise=True)
|
||||||
capability = ircdb.makeChannelCapability(channel, 'op')
|
capability = ircdb.makeChannelCapability(channel, 'op')
|
||||||
hostmask = irc.state.nickToHostmask(msg.nick)
|
if not ircdb.checkCapabilities(msg.prefix, [capability, 'admin']):
|
||||||
if not ircdb.checkCapabilities(hostmask, [capability, 'admin']):
|
|
||||||
irc.errorNoCapability(capability, Raise=True)
|
irc.errorNoCapability(capability, Raise=True)
|
||||||
try:
|
try:
|
||||||
network = conf.supybot.networks.get(irc.network)
|
network = conf.supybot.networks.get(irc.network)
|
||||||
|
Loading…
Reference in New Issue
Block a user