3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-27 13:09:23 +01:00

relay: allow overriding tag_nicks per network

Closes #494.

(cherry picked from commit 1d6b692e14)

Conflicts:
	example-conf.yml
This commit is contained in:
James Lu 2017-08-02 21:57:48 +08:00
parent e8efbb8e83
commit a639efa93e
2 changed files with 13 additions and 6 deletions

View File

@ -168,11 +168,6 @@ servers:
# PyLink will disconnect with a ping timeout. This defaults to 90 if not set.
#pingfreq: 90
# If enabled, this opts this network out of relay IP sharing: this network
# will not have its users' IPs sent across the relay, and it will not see any
# IPs of other networks' users.
#relay_no_ips: true
# Sets the max nick length for the network. It is important that this is
# set correctly, or PyLink might introduce a nick that is too long and
# cause netsplits! This defaults to 30 if not set.
@ -209,6 +204,15 @@ servers:
# This setting is EXPERIMENTAL as of PyLink 1.2.x.
#encoding: utf-8
# If enabled, this opts this network out of relay IP sharing: this network
# will not have its users' IPs sent across the relay, and it will not see any
# IPs of other networks' users.
#relay_no_ips: true
# 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
ts6net:
ip: ::1

View File

@ -100,7 +100,10 @@ def normalize_nick(irc, netname, nick, times_tagged=0, uid=''):
# Figure out whether we tag nicks or not.
if times_tagged == 0:
if conf.conf.get('relay', {}).get('tag_nicks', True):
# Check the following options in order, before falling back to True:
# 1) servers::<netname>::relay_tag_nicks
# 2) relay::tag_nicks
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', [])