From 6a32ae94fccf45a8684e80f5b9ccc88a055fbb7f Mon Sep 17 00:00:00 2001 From: James Lu Date: Sat, 25 Mar 2017 12:14:47 -0700 Subject: [PATCH] p10: implement FAKE and SETHOST IRCd checks --- protocols/p10.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/protocols/p10.py b/protocols/p10.py index abaa102..acadc66 100644 --- a/protocols/p10.py +++ b/protocols/p10.py @@ -716,6 +716,10 @@ class P10Protocol(IRCS2SProtocol): uobj = self.irc.users[target] if self.irc.isInternalClient(target): + # Host changing via SETHOST is only supported on nefarious and snircd. + if self.irc.serverdata.get('p10_ircd', 'nefarious').lower() not in ('nefarious', 'snircd'): + raise NotImplementedError + # Use SETHOST (umode +h) for internal clients. if field == 'HOST': # Set umode +x, and +h with the given vHost as argument. @@ -729,6 +733,10 @@ class P10Protocol(IRCS2SProtocol): else: raise NotImplementedError elif field == 'HOST': + # Host changing via FAKE is only supported on nefarious. + if self.irc.serverdata.get('p10_ircd', 'nefarious').lower() != 'nefarious': + raise NotImplementedError + # Use FAKE (FA) for external clients. self._send(self.irc.sid, 'FA %s %s' % (target, text))