diff --git a/coreplugin.py b/coreplugin.py index ecc6c2e..becf189 100644 --- a/coreplugin.py +++ b/coreplugin.py @@ -147,6 +147,14 @@ def handle_services_login(irc, source, command, args): utils.add_hook(handle_services_login, 'CLIENT_SERVICES_LOGIN') +def handle_version(irc, source, command, args): + """Handles requests for the PyLink server version.""" + # 351 syntax is usually ". : + fullversion = 'PyLink-%s. %s :[protocol:%s]' % (world.version, irc.serverdata['hostname'], irc.protoname) + + irc.proto.numeric(irc.sid, 351, source, fullversion) +utils.add_hook(handle_version, 'VERSION') + # Essential, core commands go here so that the "commands" plugin with less-important, # but still generic functions can be reloaded. diff --git a/protocols/inspircd.py b/protocols/inspircd.py index f334641..5152df5 100644 --- a/protocols/inspircd.py +++ b/protocols/inspircd.py @@ -697,4 +697,10 @@ class InspIRCdProtocol(TS6BaseProtocol): self.irc.callHooks([uid, 'CLIENT_SERVICES_LOGIN', {'text': args[-1]}]) + def handle_version(self, numeric, command, args): + """ + Stub VERSION handler (does nothing) to override the one in ts6_common. + """ + pass + Class = InspIRCdProtocol diff --git a/protocols/ts6_common.py b/protocols/ts6_common.py index 6451b31..8ab37fe 100644 --- a/protocols/ts6_common.py +++ b/protocols/ts6_common.py @@ -339,3 +339,7 @@ class TS6BaseProtocol(Protocol): except IndexError: # User is unsetting away status self.irc.users[numeric].away = text = '' return {'text': text} + + def handle_version(self, numeric, command, args): + """Handles requests for the PyLink server version.""" + return {} # See coreplugin.py for how this hook is used