3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-25 04:02:45 +01:00

services_support: migrate to conf.conf['pylink'], make the realname option optional

This commit is contained in:
James Lu 2017-07-14 05:51:40 -07:00
parent 06d3de354e
commit 5a5a98c4ef

View File

@ -35,15 +35,15 @@ def spawn_service(irc, source, command, args):
# Determine host the same way as above, except fall back to server hostname. # Determine host the same way as above, except fall back to server hostname.
host = irc.serverdata.get("%s_host" % name) or sbconf.get('host') or irc.hostname() host = irc.serverdata.get("%s_host" % name) or sbconf.get('host') or irc.hostname()
# Determine realname the same way as above, except fall back to pylink:realname. # Determine realname the same way as above, except fall back to pylink:realname (and if that fails, the service name).
realname = irc.serverdata.get("%s_realname" % name) or sbconf.get('realname') or conf.conf['bot']['realname'] realname = irc.serverdata.get("%s_realname" % name) or sbconf.get('realname') or conf.conf['pylink'].get('realname') or name
# Spawning service clients with these umodes where supported. servprotect usage is a # Spawning service clients with these umodes where supported. servprotect usage is a
# configuration option. # configuration option.
preferred_modes = ['oper', 'hideoper', 'hidechans', 'invisible', 'bot'] preferred_modes = ['oper', 'hideoper', 'hidechans', 'invisible', 'bot']
modes = [] modes = []
if conf.conf['bot'].get('protect_services'): if conf.conf['pylink'].get('protect_services'):
preferred_modes.append('servprotect') preferred_modes.append('servprotect')
for mode in preferred_modes: for mode in preferred_modes: