3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-28 21:52:38 +01:00

relay: allow overriding tag_nicks per network

Closes #494.
This commit is contained in:
James Lu 2017-08-02 21:57:48 +08:00
parent def1c0bfd9
commit 1d6b692e14
2 changed files with 13 additions and 6 deletions

View File

@ -173,11 +173,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.
@ -214,6 +209,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
# InspIRCd specific option: determines whether we should display WHOIS extensions by overriding
# InspIRCd's default WHOIS formatting. This defaults to true for consistency with PyLink 1.x.
#force_whois_extensions: true

View File

@ -101,7 +101,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', [])