Use source field instead of tag to filter incoming SB messages
This commit is contained in:
parent
8fb3434242
commit
a53e39d34b
|
@ -23,7 +23,7 @@ def handle_irc(m):
|
|||
shoutbox.post(m.author, m.text, m.to[1:], USERS)
|
||||
|
||||
|
||||
@shoutbox.on(lambda m: m.channel in channels and m.author != "IRC" and not m.text.endswith("[IRC]"))
|
||||
@shoutbox.on(lambda m: m.channel in channels)
|
||||
def handle_shoutbox(m):
|
||||
author = Shoutbox.normalize(m.author)
|
||||
shoutbox.irc_clients[author][0].send(f"#{m.channel}", f"{m.text}")
|
||||
|
|
|
@ -84,6 +84,9 @@ class Shoutbox(object):
|
|||
logging.getLogger().setLevel(logging.DEBUG)
|
||||
for m in messages:
|
||||
logging.debug(m)
|
||||
# If message comes from IRC, drop it (no loops allowed)
|
||||
if m['source'] == "IRC":
|
||||
continue
|
||||
# Get channel id, parse SBMessage
|
||||
self.channels[channel] = m['id']
|
||||
message = SBMessage(m, channel)
|
||||
|
|
Loading…
Reference in New Issue