3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-01 09:19:23 +01:00

global: set loopback=False on messages to prevent duplicating them via relay

This commit is contained in:
James Lu 2017-03-13 13:29:04 -07:00
parent 0a57c084bb
commit cfe72e2cd0

View File

@ -6,7 +6,7 @@ from pylinkirc.coremods import permissions
def g(irc, source, args): def g(irc, source, args):
"""<message text> """<message text>
Sends out a Instance-wide notice. Sends out a Instance-wide notice.
""" """
permissions.checkPermissions(irc, source, ["global.global"]) permissions.checkPermissions(irc, source, ["global.global"])
@ -15,7 +15,8 @@ def g(irc, source, args):
for name, ircd in world.networkobjects.items(): for name, ircd in world.networkobjects.items():
if ircd.connected.is_set(): # Only attempt to send to connected networks if ircd.connected.is_set(): # Only attempt to send to connected networks
for channel in ircd.pseudoclient.channels: for channel in ircd.pseudoclient.channels:
ircd.msg(channel, message) # Disable relaying or other plugins handling the global message.
ircd.msg(channel, message, loopback=False)
utils.add_cmd(g, "global", featured=True) utils.add_cmd(g, "global", featured=True)