mirror of
https://github.com/jlu5/PyLink.git
synced 2025-02-17 14:01:03 +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:
parent
aacc3149ce
commit
a12ed6ad35
@ -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
|
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
|
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?
|
# TODO: make this configurable?
|
||||||
host = irc.hostname()
|
host = irc.hostname()
|
||||||
|
|
||||||
@ -43,6 +47,7 @@ def spawn_service(irc, source, command, args):
|
|||||||
modes.append((mode, None))
|
modes.append((mode, None))
|
||||||
|
|
||||||
# Track the service's UIDs on each network.
|
# 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",
|
userobj = irc.proto.spawnClient(nick, ident, host, modes=modes, opertype="PyLink Service",
|
||||||
manipulatable=sbot.manipulatable)
|
manipulatable=sbot.manipulatable)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user