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

relay: allow claim to be disabled by default on new channels

Closes #581.
This commit is contained in:
James Lu 2018-05-11 13:26:13 -07:00
parent fc275cfdca
commit 741e2c8ece
2 changed files with 11 additions and 3 deletions

View File

@ -701,6 +701,11 @@ relay:
# in a server block. # in a server block.
#linkacl_use_whitelist: false #linkacl_use_whitelist: false
# Determines whether CLAIM should be enabled by default for newly created channels.
# This defaults to true, and can also be specified per network via the 'enable_default_claim'
# option in a server block.
#enable_default_claim: true
# Sets whether Clientbot mode sync will be enabled. Valid options: # Sets whether Clientbot mode sync will be enabled. Valid options:
# "full" - Sync bans, ban/invite exceptions, prefix modes, and all RFC1459-standard modes. The # "full" - Sync bans, ban/invite exceptions, prefix modes, and all RFC1459-standard modes. The
# bot will need op in the Clientbot channel for this to work both ways. # bot will need op in the Clientbot channel for this to work both ways.

View File

@ -2127,11 +2127,14 @@ def create(irc, source, args):
creator = irc.get_hostmask(source) creator = irc.get_hostmask(source)
# Create the relay database entry with the (network name, channel name) # Create the relay database entry with the (network name, channel name)
# pair - this is just a dict with various keys. # pair - this is just a dict with various keys.
db[(irc.name, channel)] = {'claim': [irc.name], 'links': set(), db[(irc.name, channel)] = {'links': set(),
'blocked_nets': set(), 'creator': creator, 'blocked_nets': set(),
'creator': creator,
'ts': time.time(), 'ts': time.time(),
'use_whitelist': irc.get_service_option('relay', 'linkacl_use_whitelist', False), 'use_whitelist': irc.get_service_option('relay', 'linkacl_use_whitelist', False),
'allowed_nets': set()} 'allowed_nets': set(),
'claim': [irc.name] if irc.get_service_option('relay', 'enable_default_claim', True)
else []}
log.info('(%s) relay: Channel %s created by %s.', irc.name, channel, creator) log.info('(%s) relay: Channel %s created by %s.', irc.name, channel, creator)
initialize_channel(irc, channel) initialize_channel(irc, channel)
irc.reply('Done.') irc.reply('Done.')