diff --git a/RelayNext/config.py b/RelayNext/config.py index 793d992..b58623e 100644 --- a/RelayNext/config.py +++ b/RelayNext/config.py @@ -1,5 +1,5 @@ ### -# Copyright (c) 2015-2018 James Lu +# Copyright (c) 2015-2020 James Lu # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -95,5 +95,9 @@ for ev in _events: conf.registerChannelValue(RelayNext.events, 'userIgnored', registry.SpaceSeparatedListOfStrings(['PRIVMSG', 'MODE'], ("""Determines what events the relay should ignore from ignored users. Ignores are added using - Supybot's global ignore system."""))) + Limnoria's global ignore system."""))) +conf.registerChannelValue(RelayNext.events, 'relaySelfMessages', + registry.Boolean(True, ("""Determines whether the bot should relay its own messages. + You may wish to disable this if you are running plugins that announce to the same channel + on multiple networks (e.g. RSS)."""))) # vim:set shiftwidth=4 tabstop=4 expandtab textwidth=79: diff --git a/RelayNext/plugin.py b/RelayNext/plugin.py index c4939da..9237439 100644 --- a/RelayNext/plugin.py +++ b/RelayNext/plugin.py @@ -1,5 +1,5 @@ ### -# Copyright (c) 2015-2018 James Lu +# Copyright (c) 2015-2020 James Lu # All rights reserved. # # Redistribution and use in source and binary forms, with or without @@ -367,7 +367,8 @@ class RelayNext(callbacks.Plugin): # Catch our own messages and send them into the relay (this is # useful because Supybot is often a multi-purpose bot!) try: - if msg.command == 'PRIVMSG' and not msg.relayedMsg: + if msg.command == 'PRIVMSG' and not msg.relayedMsg and \ + self.registryValue("events.relaySelfMessages", msg.args[0]): new_msg = deepcopy(msg) new_msg.nick = irc.nick self.relay(irc, new_msg, channel=msg.args[0])