mirror of
https://github.com/jlu5/PyLink.git
synced 2025-02-02 23:54:08 +01:00
services_support: fix clientbot service spawning when irc.pseudoclient exists but isn't in the user index
This commit is contained in:
parent
bc48709595
commit
94e05a6233
@ -24,9 +24,17 @@ def spawn_service(irc, source, command, args):
|
|||||||
|
|
||||||
old_userobj = irc.users.get(sbot.uids.get(irc.name))
|
old_userobj = irc.users.get(sbot.uids.get(irc.name))
|
||||||
if old_userobj and old_userobj.service:
|
if old_userobj and old_userobj.service:
|
||||||
# A client already exists, so reuse it.
|
# A client already exists, so don't respawn it.
|
||||||
log.debug('(%s) spawn_service: Using existing nick %r for service %r', irc.name, old_userobj.nick, name)
|
log.debug('(%s) spawn_service: Not respawning service %r as service client %r already exists.', irc.name, name,
|
||||||
userobj = old_userobj
|
irc.pseudoclient.nick)
|
||||||
|
return
|
||||||
|
|
||||||
|
if name == 'pylink' and irc.pseudoclient:
|
||||||
|
# irc.pseudoclient already exists, reuse values from it but
|
||||||
|
# spawn a new client. This is used for protocols like Clientbot,
|
||||||
|
# so that they can override the main service nick, among other things.
|
||||||
|
log.debug('(%s) spawn_service: Using existing nick %r for service %r', irc.name, irc.pseudoclient.nick, name)
|
||||||
|
userobj = irc.pseudoclient
|
||||||
userobj.opertype = "PyLink Service"
|
userobj.opertype = "PyLink Service"
|
||||||
userobj.manipulatable = sbot.manipulatable
|
userobj.manipulatable = sbot.manipulatable
|
||||||
else:
|
else:
|
||||||
|
Loading…
Reference in New Issue
Block a user