mirror of
https://github.com/jlu5/PyLink.git
synced 2025-02-17 14:01:03 +01:00
parent
be960bf27b
commit
9bda4094e4
@ -307,7 +307,9 @@ class ClientbotWrapperProtocol(Protocol):
|
|||||||
# Sender is a nick!user@host prefix. Split it into its relevant parts.
|
# Sender is a nick!user@host prefix. Split it into its relevant parts.
|
||||||
nick, ident, host = utils.splitHostmask(sender)
|
nick, ident, host = utils.splitHostmask(sender)
|
||||||
idsource = self.irc.nickToUid(nick)
|
idsource = self.irc.nickToUid(nick)
|
||||||
|
|
||||||
if not idsource:
|
if not idsource:
|
||||||
|
# We don't know the sender, so it most be new.
|
||||||
idsource = self.spawnClient(nick, ident, host, server=self.irc.uplink).uid
|
idsource = self.spawnClient(nick, ident, host, server=self.irc.uplink).uid
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@ -563,6 +565,19 @@ class ClientbotWrapperProtocol(Protocol):
|
|||||||
def handle_nick(self, source, command, args):
|
def handle_nick(self, source, command, args):
|
||||||
"""Handles NICK changes."""
|
"""Handles NICK changes."""
|
||||||
# <- :GL|!~GL@127.0.0.1 NICK :GL_
|
# <- :GL|!~GL@127.0.0.1 NICK :GL_
|
||||||
|
|
||||||
|
if not self.irc.pseudoclient:
|
||||||
|
# We haven't properly logged on yet, so any initial NICK should be treated as a forced
|
||||||
|
# nick change for US. For example, this clause is used to handle forced nick changes
|
||||||
|
# sent by ZNC, when the login nick and the actual IRC nick of the bouncer differ.
|
||||||
|
|
||||||
|
# HACK: change the nick config entry so services_support knows what our main
|
||||||
|
# pseudoclient is called.
|
||||||
|
oldnick = self.irc.serverdata['pylink_nick']
|
||||||
|
self.irc.serverdata['pylink_nick'] = self.conf_nick = args[0]
|
||||||
|
log.debug('(%s) Pre-auth FNC: Forcing configured nick to %s from %s', self.irc.name, args[0], oldnick)
|
||||||
|
return
|
||||||
|
|
||||||
oldnick = self.irc.users[source].nick
|
oldnick = self.irc.users[source].nick
|
||||||
self.nick(source, args[0])
|
self.nick(source, args[0])
|
||||||
return {'newnick': args[0], 'oldnick': oldnick}
|
return {'newnick': args[0], 'oldnick': oldnick}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user