summaryrefslogtreecommitdiff
path: root/miniirc_idc.py
diff options
context:
space:
mode:
authorluk3yx <luk3yx@users.noreply.github.com>2022-05-06 20:27:55 +1200
committerluk3yx <luk3yx@users.noreply.github.com>2022-05-06 20:27:55 +1200
commit58bfbdac13128d2e51acb2465b404550c4ec6188 (patch)
tree8df25f0cf911b627d135091e526382d00e9d2e70 /miniirc_idc.py
parent5e426f593fbd3a474c73bf4001dc0f927ce256d2 (diff)
downloadminiirc_idc-58bfbdac13128d2e51acb2465b404550c4ec6188.tar.gz
miniirc_idc-58bfbdac13128d2e51acb2465b404550c4ec6188.zip
Don't handle echo messages if echo-message wasn't requested
Diffstat (limited to 'miniirc_idc.py')
-rw-r--r--miniirc_idc.py7
1 files changed, 6 insertions, 1 deletions
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.