mirror of
https://github.com/jlu5/SupyPlugins.git
synced 2025-04-27 13:31:10 -05:00
RelayNext: support relaying topics (turned off by default)
This commit is contained in:
parent
78a79fdf3d
commit
a33f37c4e6
@ -77,10 +77,12 @@ conf.registerChannelValue(RelayNext.antiflood, 'timeout',
|
|||||||
|
|
||||||
conf.registerGroup(RelayNext, 'events')
|
conf.registerGroup(RelayNext, 'events')
|
||||||
|
|
||||||
_events = ('quit', 'join', 'part', 'nick', 'mode', 'kick')
|
_events = {'quit': True, 'join': True, 'part': True,
|
||||||
|
'nick': True, 'mode': True, 'kick': True,
|
||||||
|
'topic': False}
|
||||||
for ev in _events:
|
for ev in _events:
|
||||||
conf.registerChannelValue(RelayNext.events, 'relay%ss' % ev,
|
conf.registerChannelValue(RelayNext.events, 'relay%ss' % ev,
|
||||||
registry.Boolean(True, """Determines whether the bot should relay %ss.""" % ev))
|
registry.Boolean(_events[ev], """Determines whether the bot should relay %ss.""" % ev))
|
||||||
conf.registerChannelValue(RelayNext.events, 'userIgnored',
|
conf.registerChannelValue(RelayNext.events, 'userIgnored',
|
||||||
registry.SpaceSeparatedListOfStrings(['PRIVMSG', 'MODE'], ("""Determines what events
|
registry.SpaceSeparatedListOfStrings(['PRIVMSG', 'MODE'], ("""Determines what events
|
||||||
the relay should ignore from ignored users. Ignores are added using
|
the relay should ignore from ignored users. Ignores are added using
|
||||||
|
@ -203,6 +203,8 @@ class RelayNext(callbacks.Plugin):
|
|||||||
elif msg.command == 'MODE':
|
elif msg.command == 'MODE':
|
||||||
modes = ' '.join(msg.args[1:])
|
modes = ' '.join(msg.args[1:])
|
||||||
s = '- %s%s set mode %s on %s' % (nick, userhost, modes, channel)
|
s = '- %s%s set mode %s on %s' % (nick, userhost, modes, channel)
|
||||||
|
elif msg.command == 'TOPIC':
|
||||||
|
s = '- %s set topic on %s to: %s' % (nick, channel, msg.args[1])
|
||||||
|
|
||||||
if s: # Add the network name and some final touch-ups
|
if s: # Add the network name and some final touch-ups
|
||||||
s = "\x02[%s]\x02 %s" % (netname, s)
|
s = "\x02[%s]\x02 %s" % (netname, s)
|
||||||
@ -276,7 +278,7 @@ class RelayNext(callbacks.Plugin):
|
|||||||
if self.registryValue("events.relay%ss" % msg.command, msg.args[0]):
|
if self.registryValue("events.relay%ss" % msg.command, msg.args[0]):
|
||||||
self.relay(irc, msg)
|
self.relay(irc, msg)
|
||||||
|
|
||||||
doPart = doKick = doMode = doJoin
|
doTopic = doPart = doKick = doMode = doJoin
|
||||||
|
|
||||||
# NICK and QUIT aren't channel specific, so they require a bit
|
# NICK and QUIT aren't channel specific, so they require a bit
|
||||||
# of extra handling
|
# of extra handling
|
||||||
|
Loading…
x
Reference in New Issue
Block a user