From 58a8d7134c7b2850d7193488db2a26e099158c2c Mon Sep 17 00:00:00 2001 From: James Lu Date: Thu, 23 Jul 2015 11:01:12 -0700 Subject: [PATCH] Fix handling of inbound CHG* --- plugins/relay.py | 5 +++-- protocols/inspircd.py | 8 ++++---- protocols/ts6.py | 2 +- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/plugins/relay.py b/plugins/relay.py index fed7ebe..dbba8be 100644 --- a/plugins/relay.py +++ b/plugins/relay.py @@ -434,8 +434,9 @@ def handle_chgclient(irc, source, command, args): remoteirc = utils.networkobjects[netname] try: remoteirc.proto.updateClient(remoteirc, user, field, text) - except ValueError: # IRCd doesn't support changing the field we want - logging.debug('(%s) Error raised changing field %r of %s on %s (for %s/%s)', irc.name, field, user, target, remotenet, irc.name) + except NotImplementedError: # IRCd doesn't support changing the field we want + log.debug('(%s) Ignoring changing field %r of %s on %s (for %s/%s);' + 'remote IRCd doesn\'t support it', irc.name, field, user, target, remotenet, irc.name) continue for c in ('CHGHOST', 'CHGNAME', 'CHGIDENT'): diff --git a/protocols/inspircd.py b/protocols/inspircd.py index 1fe935b..207eb61 100644 --- a/protocols/inspircd.py +++ b/protocols/inspircd.py @@ -276,16 +276,16 @@ def updateClient(irc, numeric, field, text): Changes the field of PyLink PseudoClient .""" field = field.upper() if field == 'IDENT': - handle_fident(irc, numeric, 'PYLINK_UPDATECLIENT_IDENT', [text]) + irc.users[numeric].ident = text _send(irc, numeric, 'FIDENT %s' % text) elif field == 'HOST': - handle_fhost(irc, numeric, 'PYLINK_UPDATECLIENT_HOST', [text]) + irc.users[numeric].host = text _send(irc, numeric, 'FHOST %s' % text) elif field in ('REALNAME', 'GECOS'): - handle_fname(irc, numeric, 'PYLINK_UPDATECLIENT_GECOS', [text]) + irc.users[numeric].realname = text _send(irc, numeric, 'FNAME :%s' % text) else: - raise ValueError("Changing field %r of a client is unsupported by this protocol." % field) + raise NotImplementedError("Changing field %r of a client is unsupported by this protocol." % field) def pingServer(irc, source=None, target=None): source = source or irc.sid diff --git a/protocols/ts6.py b/protocols/ts6.py index 8a5063b..0411ab6 100644 --- a/protocols/ts6.py +++ b/protocols/ts6.py @@ -217,7 +217,7 @@ def updateClient(irc, numeric, field, text): Changes the field of PyLink PseudoClient .""" field = field.upper() if field == 'HOST': - handle_chghost(irc, numeric, 'PYLINK_UPDATECLIENT_HOST', [text]) + irc.users[numeric].host = text _send(irc, irc.sid, 'CHGHOST %s :%s' % (numeric, text)) else: raise NotImplementedError("Changing field %r of a client is unsupported by this protocol." % field)