From 58bfbdac13128d2e51acb2465b404550c4ec6188 Mon Sep 17 00:00:00 2001 From: luk3yx Date: Fri, 6 May 2022 20:27:55 +1200 Subject: Don't handle echo messages if echo-message wasn't requested --- miniirc_idc.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/miniirc_idc.py b/miniirc_idc.py index 9c041d0..88f7549 100644 --- a/miniirc_idc.py +++ b/miniirc_idc.py @@ -96,6 +96,11 @@ class IDC(miniirc.IRC): else: hostmask = ('', '', '') + # If echo-message wasn't requested then don't send self messages + if (command == 'PRIVMSG' and hostmask[0] == self.current_nick and + 'echo-message' not in self.active_caps): + return None + if 'TS' in idc_args: dt = datetime.datetime.utcfromtimestamp(float(idc_args['TS'])) tags['time'] = dt.isoformat() + 'Z' @@ -159,7 +164,7 @@ class IDC(miniirc.IRC): self.idc_send('LOGIN', username=user, password=password, label=label) self.active_caps = self.ircv3_caps & { - 'account-tag', 'labeled-response', # 'message-tags', + 'account-tag', 'echo-message', 'labeled-response', } # Override the message parser to change the default parser. -- cgit v1.2.3