Add setting to disable relaying joins/parts/quits/modes/etc
This commit is contained in:
parent
93b455d5b8
commit
a3c62f117a
1 changed files with 11 additions and 3 deletions
|
@ -4,6 +4,8 @@
|
|||
|
||||
from src import EventManager, ModuleManager, utils
|
||||
|
||||
@utils.export("channelset", utils.BoolSetting("relay-extras",
|
||||
"Whether or not to relay joins/parts/quits/modes/etc"))
|
||||
class Module(ModuleManager.BaseModule):
|
||||
@utils.hook("new.server")
|
||||
def new_server(self, event):
|
||||
|
@ -54,6 +56,10 @@ class Module(ModuleManager.BaseModule):
|
|||
|
||||
@utils.hook("formatted.message.channel")
|
||||
@utils.hook("formatted.notice.channel")
|
||||
@utils.kwarg("priority", EventManager.PRIORITY_LOW)
|
||||
def formatted(self, event):
|
||||
self._relay(event, event["channel"])
|
||||
|
||||
@utils.hook("formatted.join")
|
||||
@utils.hook("formatted.part")
|
||||
@utils.hook("formatted.nick")
|
||||
|
@ -62,11 +68,13 @@ class Module(ModuleManager.BaseModule):
|
|||
@utils.hook("formatted.quit")
|
||||
@utils.hook("formatted.rename")
|
||||
@utils.kwarg("priority", EventManager.PRIORITY_LOW)
|
||||
def formatted(self, event):
|
||||
def formatted_extra(self, event):
|
||||
if event["channel"]:
|
||||
if event["channel"].get_setting("relay-extras", True):
|
||||
self._relay(event, event["channel"])
|
||||
elif event["user"]:
|
||||
for channel in event["user"].channels:
|
||||
if channel.get_setting("relay-extras", True):
|
||||
self._relay(event, channel)
|
||||
|
||||
@utils.hook("received.command.relaygroup")
|
||||
|
|
Loading…
Reference in a new issue