3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-01 17:29:21 +01:00

relay: allow defining server-specific nicks to always tags

Closes #564.

(cherry picked from commit 60c05af9ed)

Conflicts:
	example-conf.yml
This commit is contained in:
James Lu 2017-12-30 01:22:24 -08:00
parent 3e16469b25
commit 95f806dc46
2 changed files with 6 additions and 1 deletions

View File

@ -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

View File

@ -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):