From 95f806dc466ab66dfddffd330b4a356e941a4492 Mon Sep 17 00:00:00 2001 From: James Lu Date: Sat, 30 Dec 2017 01:22:24 -0800 Subject: [PATCH] relay: allow defining server-specific nicks to always tags Closes #564. (cherry picked from commit 60c05af9ed30c0f4407cc8b2d72bdc2cc808a507) Conflicts: example-conf.yml --- example-conf.yml | 4 ++++ plugins/relay.py | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/example-conf.yml b/example-conf.yml index 6dc480c..3e26516 100644 --- a/example-conf.yml +++ b/example-conf.yml @@ -220,6 +220,10 @@ servers: # IPs of other networks' users. #relay_no_ips: true + # If relay nick tagging is disabled, this option specifies a per-network list of nick + # globs to always tag when introducing users *from* other networks. + #relay_forcetag_nicks: ["someuser", "Guest*"] + # Determines whether relay will tag nicks on this network. This overrides the relay::tag_nicks # option on a per network-basis. #relay_tag_nicks: true diff --git a/plugins/relay.py b/plugins/relay.py index 9a8c08f..357aa9a 100644 --- a/plugins/relay.py +++ b/plugins/relay.py @@ -106,7 +106,8 @@ def normalize_nick(irc, netname, nick, times_tagged=0, uid=''): if irc.serverdata.get('relay_tag_nicks', conf.conf.get('relay', {}).get('tag_nicks', True)): times_tagged = 1 else: - forcetag_nicks = conf.conf.get('relay', {}).get('forcetag_nicks', []) + forcetag_nicks = set(conf.conf.get('relay', {}).get('forcetag_nicks', [])) + forcetag_nicks |= set(irc.serverdata.get('relay_forcetag_nicks', [])) log.debug('(%s) relay.normalize_nick: checking if globs %s match %s.', irc.name, forcetag_nicks, nick) for glob in forcetag_nicks: if irc.matchHost(glob, nick):