mirror of
https://github.com/progval/Limnoria.git
synced 2025-04-26 04:51:06 -05:00
Relay.{join,part} should require admin capability.
This commit is contained in:
parent
7af1a75b26
commit
b5b3d16c00
@ -107,7 +107,7 @@ class Relay(callbacks.Plugin):
|
|||||||
networkGroup = conf.supybot.networks.get(otherIrc.network)
|
networkGroup = conf.supybot.networks.get(otherIrc.network)
|
||||||
otherIrc.queueMsg(networkGroup.channels.join(channel))
|
otherIrc.queueMsg(networkGroup.channels.join(channel))
|
||||||
irc.replySuccess()
|
irc.replySuccess()
|
||||||
join = wrap(join, ['channel'])
|
join = wrap(join, ['channel', 'admin'])
|
||||||
|
|
||||||
def part(self, irc, msg, args, channel):
|
def part(self, irc, msg, args, channel):
|
||||||
"""<channel>
|
"""<channel>
|
||||||
@ -121,7 +121,7 @@ class Relay(callbacks.Plugin):
|
|||||||
if channel in otherIrc.state.channels:
|
if channel in otherIrc.state.channels:
|
||||||
otherIrc.queueMsg(ircmsgs.part(channel))
|
otherIrc.queueMsg(ircmsgs.part(channel))
|
||||||
irc.replySuccess()
|
irc.replySuccess()
|
||||||
part = wrap(part, ['channel'])
|
part = wrap(part, ['channel', 'admin'])
|
||||||
|
|
||||||
def nicks(self, irc, msg, args, channel):
|
def nicks(self, irc, msg, args, channel):
|
||||||
"""[<channel>]
|
"""[<channel>]
|
||||||
@ -316,7 +316,7 @@ class Relay(callbacks.Plugin):
|
|||||||
if s in normalized:
|
if s in normalized:
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def _punishRelayers(self, msg):
|
def _punishRelayers(self, msg):
|
||||||
assert self._checkRelayMsg(msg), 'Punishing without checking.'
|
assert self._checkRelayMsg(msg), 'Punishing without checking.'
|
||||||
who = msg.prefix
|
who = msg.prefix
|
||||||
@ -336,7 +336,7 @@ class Relay(callbacks.Plugin):
|
|||||||
kmsg = 'You seem to be relaying, punk.'
|
kmsg = 'You seem to be relaying, punk.'
|
||||||
irc.sendMsg(ircmsgs.kick(channel, msg.nick, kmsg))
|
irc.sendMsg(ircmsgs.kick(channel, msg.nick, kmsg))
|
||||||
else:
|
else:
|
||||||
notPunishing(irc, 'not opped')
|
notPunishing(irc, 'not opped')
|
||||||
|
|
||||||
def doPrivmsg(self, irc, msg):
|
def doPrivmsg(self, irc, msg):
|
||||||
(channel, text) = msg.args
|
(channel, text) = msg.args
|
||||||
@ -367,7 +367,7 @@ class Relay(callbacks.Plugin):
|
|||||||
s = self._formatPrivmsg(msg.nick, network, msg)
|
s = self._formatPrivmsg(msg.nick, network, msg)
|
||||||
m = self._msgmaker(channel, s)
|
m = self._msgmaker(channel, s)
|
||||||
self._sendToOthers(irc, m)
|
self._sendToOthers(irc, m)
|
||||||
|
|
||||||
def _msgmaker(self, target, s):
|
def _msgmaker(self, target, s):
|
||||||
msg = dynamic.msg
|
msg = dynamic.msg
|
||||||
channel = dynamic.channel
|
channel = dynamic.channel
|
||||||
@ -376,7 +376,7 @@ class Relay(callbacks.Plugin):
|
|||||||
return ircmsgs.notice(target, s)
|
return ircmsgs.notice(target, s)
|
||||||
else:
|
else:
|
||||||
return ircmsgs.privmsg(target, s)
|
return ircmsgs.privmsg(target, s)
|
||||||
|
|
||||||
def doJoin(self, irc, msg):
|
def doJoin(self, irc, msg):
|
||||||
irc = self._getRealIrc(irc)
|
irc = self._getRealIrc(irc)
|
||||||
channel = msg.args[0]
|
channel = msg.args[0]
|
||||||
@ -463,7 +463,7 @@ class Relay(callbacks.Plugin):
|
|||||||
otherIrc.queueMsg(m)
|
otherIrc.queueMsg(m)
|
||||||
else:
|
else:
|
||||||
self.queuedTopics.remove((otherIrc, newTopic))
|
self.queuedTopics.remove((otherIrc, newTopic))
|
||||||
|
|
||||||
except KeyError:
|
except KeyError:
|
||||||
self.log.warning('Not on %s on %s, '
|
self.log.warning('Not on %s on %s, '
|
||||||
'can\'t sync topics.',
|
'can\'t sync topics.',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user