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

services_support: hack around nick clashes between service clients & real users in Clientbot

For #327. Essentially what this does is tack on a nick prefix to all service bots introduced on a Clientbot network, using characters invalid for regular nicks.
This commit is contained in:
James Lu 2016-09-06 19:46:59 -07:00
parent aacc3149ce
commit a12ed6ad35

View File

@ -26,6 +26,10 @@ def spawn_service(irc, source, command, args):
nick = irc.serverdata.get("%s_nick" % name) or conf.conf.get(name, {}).get('nick') or sbot.nick or name
ident = irc.serverdata.get("%s_ident" % name) or conf.conf.get(name, {}).get('ident') or sbot.ident or name
if name != 'pylink' and irc.protoname == 'clientbot':
# Prefix service bots spawned on Clientbot to prevent possible nick collisions.
nick = 'PyLinkService@' + nick
# TODO: make this configurable?
host = irc.hostname()
@ -43,6 +47,7 @@ def spawn_service(irc, source, command, args):
modes.append((mode, None))
# Track the service's UIDs on each network.
log.debug('(%s) Using nick %s for service %s', irc.name, nick, name)
userobj = irc.proto.spawnClient(nick, ident, host, modes=modes, opertype="PyLink Service",
manipulatable=sbot.manipulatable)