diff --git a/example-conf.yml b/example-conf.yml index 3d8a90f..b8444fe 100644 --- a/example-conf.yml +++ b/example-conf.yml @@ -283,7 +283,7 @@ plugins: # to a template string, as they connect. This requires the changehost: block # to be configured correctly below. #- changehost - + # Automode plugin: allows assigning channel access to specific hostmasks or # exttargets. See https://github.com/GLolol/PyLink/blob/master/docs/automode.md # for a usage guide. @@ -413,6 +413,11 @@ relay: # experimental. tag_nicks: true + # If tag_nicks is False, this specifies a list of NICK globs that network + # tags should be added for anyways (e.g. for network services). + forcetag_nicks: + - "*Serv" + games: # Sets the nick of the Games service, if you're using it. nick: Games diff --git a/plugins/relay.py b/plugins/relay.py index 7e2314f..b849c2e 100644 --- a/plugins/relay.py +++ b/plugins/relay.py @@ -101,9 +101,18 @@ def normalizeNick(irc, netname, nick, times_tagged=0, uid=''): separator = irc.serverdata.get('separator') or \ conf.conf.get('relay', {}).get('separator') or "/" - # Figure out whether we tag nicks by default or not. - if times_tagged == 0 and conf.conf.get('relay', {}).get('tag_nicks', True): - times_tagged = 1 + # Figure out whether we tag nicks or not. + if times_tagged == 0: + if conf.conf.get('relay', {}).get('tag_nicks', True): + times_tagged = 1 + else: + forcetag_nicks = conf.conf.get('relay', {}).get('forcetag_nicks', []) + log.debug('(%s) relay.normalizeNick: checking if globs %s match %s.', irc.name, forcetag_nicks, nick) + for glob in forcetag_nicks: + if irc.matchHost(glob, nick): + # User matched a nick to force tag nicks for. Tag them. + times_tagged = 1 + break log.debug('(%s) relay.normalizeNick: using %r as separator.', irc.name, separator) orig_nick = nick