Updated deop/dehalfop/devoice to work by default on the sender of the message.

This commit is contained in:
Jeremy Fincher 2003-12-04 16:27:03 +00:00
parent 56b68d6893
commit 9873981fd8

View File

@ -91,13 +91,14 @@ class Channel(callbacks.Privmsg):
voice = privmsgs.checkChannelCapability(voice, 'voice') voice = privmsgs.checkChannelCapability(voice, 'voice')
def deop(self, irc, msg, args, channel): def deop(self, irc, msg, args, channel):
"""[<channel>] <nick> [<nick> ...] """[<channel>] [<nick> ...]
If you have the #channel.op capability, this will remove operator If you have the #channel.op capability, this will remove operator
privileges from all the nicks given. privileges from all the nicks given. If no nicks are given, removes
operator privileges from the person sending the message.
""" """
if not args: if not args:
raise callbacks.ArgumentError args.append(msg.nick)
if irc.nick in irc.state.channels[channel].ops: if irc.nick in irc.state.channels[channel].ops:
irc.queueMsg(ircmsgs.deops(channel, args)) irc.queueMsg(ircmsgs.deops(channel, args))
else: else:
@ -105,13 +106,14 @@ class Channel(callbacks.Privmsg):
deop = privmsgs.checkChannelCapability(deop, 'op') deop = privmsgs.checkChannelCapability(deop, 'op')
def dehalfop(self, irc, msg, args, channel): def dehalfop(self, irc, msg, args, channel):
"""[<channel>] <nick> [<nick> ...] """[<channel>] [<nick> ...]
If you have the #channel.op capability, this will remove half-operator If you have the #channel.op capability, this will remove half-operator
privileges from all the nicks given. privileges from all the nicks given. If no nicks are given, removes
half-operator privileges from the person sending the message.
""" """
if not args: if not args:
raise callbacks.ArgumentError args.append(msg.nick)
if irc.nick in irc.state.channels[channel].ops: if irc.nick in irc.state.channels[channel].ops:
irc.queueMsg(ircmsgs.dehalfops(channel, args)) irc.queueMsg(ircmsgs.dehalfops(channel, args))
else: else:
@ -119,13 +121,14 @@ class Channel(callbacks.Privmsg):
dehalfop = privmsgs.checkChannelCapability(dehalfop, 'op') dehalfop = privmsgs.checkChannelCapability(dehalfop, 'op')
def devoice(self, irc, msg, args, channel): def devoice(self, irc, msg, args, channel):
"""[<channel>] <nick> [<nick> ...] """[<channel>] [<nick> ...]
If you have the #channel.op capability, this will remove voice from all If you have the #channel.op capability, this will remove voice from all
the nicks given. the nicks given. If no nicks are given, removes voice from the person
sending the message.
""" """
if not args: if not args:
raise callbacks.ArgumentError args.append(msg.nick)
if irc.nick in irc.state.channels[channel].ops: if irc.nick in irc.state.channels[channel].ops:
irc.queueMsg(ircmsgs.devoices(channel, args)) irc.queueMsg(ircmsgs.devoices(channel, args))
else: else: