mirror of
https://github.com/jlu5/PyLink.git
synced 2025-01-12 05:02:33 +01:00
Fix handling of inbound CHG*
This commit is contained in:
parent
1efc9018f3
commit
58a8d7134c
@ -434,8 +434,9 @@ def handle_chgclient(irc, source, command, args):
|
|||||||
remoteirc = utils.networkobjects[netname]
|
remoteirc = utils.networkobjects[netname]
|
||||||
try:
|
try:
|
||||||
remoteirc.proto.updateClient(remoteirc, user, field, text)
|
remoteirc.proto.updateClient(remoteirc, user, field, text)
|
||||||
except ValueError: # IRCd doesn't support changing the field we want
|
except NotImplementedError: # 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)
|
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
|
continue
|
||||||
|
|
||||||
for c in ('CHGHOST', 'CHGNAME', 'CHGIDENT'):
|
for c in ('CHGHOST', 'CHGNAME', 'CHGIDENT'):
|
||||||
|
@ -276,16 +276,16 @@ def updateClient(irc, numeric, field, text):
|
|||||||
Changes the <field> field of <target> PyLink PseudoClient <client numeric>."""
|
Changes the <field> field of <target> PyLink PseudoClient <client numeric>."""
|
||||||
field = field.upper()
|
field = field.upper()
|
||||||
if field == 'IDENT':
|
if field == 'IDENT':
|
||||||
handle_fident(irc, numeric, 'PYLINK_UPDATECLIENT_IDENT', [text])
|
irc.users[numeric].ident = text
|
||||||
_send(irc, numeric, 'FIDENT %s' % text)
|
_send(irc, numeric, 'FIDENT %s' % text)
|
||||||
elif field == 'HOST':
|
elif field == 'HOST':
|
||||||
handle_fhost(irc, numeric, 'PYLINK_UPDATECLIENT_HOST', [text])
|
irc.users[numeric].host = text
|
||||||
_send(irc, numeric, 'FHOST %s' % text)
|
_send(irc, numeric, 'FHOST %s' % text)
|
||||||
elif field in ('REALNAME', 'GECOS'):
|
elif field in ('REALNAME', 'GECOS'):
|
||||||
handle_fname(irc, numeric, 'PYLINK_UPDATECLIENT_GECOS', [text])
|
irc.users[numeric].realname = text
|
||||||
_send(irc, numeric, 'FNAME :%s' % text)
|
_send(irc, numeric, 'FNAME :%s' % text)
|
||||||
else:
|
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):
|
def pingServer(irc, source=None, target=None):
|
||||||
source = source or irc.sid
|
source = source or irc.sid
|
||||||
|
@ -217,7 +217,7 @@ def updateClient(irc, numeric, field, text):
|
|||||||
Changes the <field> field of <target> PyLink PseudoClient <client numeric>."""
|
Changes the <field> field of <target> PyLink PseudoClient <client numeric>."""
|
||||||
field = field.upper()
|
field = field.upper()
|
||||||
if field == 'HOST':
|
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))
|
_send(irc, irc.sid, 'CHGHOST %s :%s' % (numeric, text))
|
||||||
else:
|
else:
|
||||||
raise NotImplementedError("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)
|
||||||
|
Loading…
Reference in New Issue
Block a user