3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-26 04:32:51 +01:00

inspircd: raise NotImplementedError instead of only warning when a CHG* module is missing

This commit is contained in:
James Lu 2017-12-22 12:41:48 -08:00
parent 92427201f1
commit 7c0d279f61

View File

@ -274,8 +274,7 @@ class InspIRCdProtocol(TS6BaseProtocol):
# It is a client on another server, use CHGIDENT/HOST/NAME. # It is a client on another server, use CHGIDENT/HOST/NAME.
if field == 'IDENT': if field == 'IDENT':
if 'm_chgident.so' not in self._modsupport: if 'm_chgident.so' not in self._modsupport:
log.warning('(%s) Failed to change ident of %s to %r: load m_chgident.so!', self.name, target, text) raise NotImplementedError('Cannot change idents as m_chgident.so is not loaded')
return
self.users[target].ident = text self.users[target].ident = text
self._send_with_prefix(self.sid, 'CHGIDENT %s %s' % (target, text)) self._send_with_prefix(self.sid, 'CHGIDENT %s %s' % (target, text))
@ -285,8 +284,7 @@ class InspIRCdProtocol(TS6BaseProtocol):
{'target': target, 'newident': text}]) {'target': target, 'newident': text}])
elif field == 'HOST': elif field == 'HOST':
if 'm_chghost.so' not in self._modsupport: if 'm_chghost.so' not in self._modsupport:
log.warning('(%s) Failed to change host of %s to %r: load m_chghost.so!', self.name, target, text) raise NotImplementedError('Cannot change hosts as m_chghost.so is not loaded')
return
self.users[target].host = text self.users[target].host = text
self._send_with_prefix(self.sid, 'CHGHOST %s %s' % (target, text)) self._send_with_prefix(self.sid, 'CHGHOST %s %s' % (target, text))
@ -296,8 +294,8 @@ class InspIRCdProtocol(TS6BaseProtocol):
elif field in ('REALNAME', 'GECOS'): elif field in ('REALNAME', 'GECOS'):
if 'm_chgname.so' not in self._modsupport: if 'm_chgname.so' not in self._modsupport:
log.warning('(%s) Failed to change real name of %s to %r: load m_chgname.so!', self.name, target, text) raise NotImplementedError('Cannot change real names as m_chgname.so is not loaded')
return
self.users[target].realname = text self.users[target].realname = text
self._send_with_prefix(self.sid, 'CHGNAME %s :%s' % (target, text)) self._send_with_prefix(self.sid, 'CHGNAME %s :%s' % (target, text))