From eb6419022804058a946757524bca4ff1f08c18e3 Mon Sep 17 00:00:00 2001 From: James Lu Date: Fri, 7 Oct 2016 21:08:55 -0700 Subject: [PATCH] Clientbot: use a more specific realname fallback (cherry picked from commit 288a2fffd79d2f34a3af36fbf222bf8fd9d7641c) This is cherry-picked as a prerequisite for the next commit. --- protocols/clientbot.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/protocols/clientbot.py b/protocols/clientbot.py index abe2d10..cba40da 100644 --- a/protocols/clientbot.py +++ b/protocols/clientbot.py @@ -6,6 +6,7 @@ from pylinkirc import utils, conf from pylinkirc.log import log from pylinkirc.classes import Protocol, IrcUser, IrcServer +FALLBACK_REALNAME = 'PyLink Relay Mirror Client' COMMON_PREFIXMODES = [('h', 'halfop'), ('a', 'admin'), ('q', 'owner'), ('y', 'owner')] class ClientbotWrapperProtocol(Protocol): @@ -313,7 +314,7 @@ class ClientbotWrapperProtocol(Protocol): if (not idsource) and self.irc.pseudoclient: # 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, realname=FALLBACK_REALNAME).uid try: func = getattr(self, 'handle_'+command.lower()) @@ -402,7 +403,7 @@ class ClientbotWrapperProtocol(Protocol): # Get the PUID for the given nick. If one doesn't exist, spawn # a new virtual user. TODO: wait for WHO responses for each nick before # spawning in order to get a real ident/host. - idsource = self.irc.nickToUid(nick) or self.spawnClient(nick, server=self.irc.uplink).uid + idsource = self.irc.nickToUid(nick) or self.spawnClient(nick, server=self.irc.uplink, realname=FALLBACK_REALNAME).uid # Queue these virtual users to be joined if they're not already in the channel, # or we're waiting for a kick acknowledgment for them.