From beae4eea9ead0491b4d25439845f13aef9700b3c Mon Sep 17 00:00:00 2001 From: James Lu Date: Sat, 30 Apr 2016 17:00:28 -0700 Subject: [PATCH] core: rename utils.fullVersion -> irc.version (#199) --- classes.py | 8 ++++++++ coreplugin.py | 2 +- protocols/inspircd.py | 2 +- utils.py | 8 -------- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/classes.py b/classes.py index 72c564a..beb73ae 100644 --- a/classes.py +++ b/classes.py @@ -799,6 +799,14 @@ class Irc(): modelist += ' %s' % ' '.join(args) return modelist + def version(self): + """ + Returns a detailed version string including the PyLink daemon version, + the protocol module in use, and the server hostname. + """ + fullversion = 'PyLink-%s. %s :[protocol:%s]' % (world.version, self.serverdata['hostname'], self.protoname) + return fullversion + ### State checking functions def nickToUid(self, nick): """Looks up the UID of a user with the given nick, if one is present.""" diff --git a/coreplugin.py b/coreplugin.py index 860ba27..ffcfed2 100644 --- a/coreplugin.py +++ b/coreplugin.py @@ -182,7 +182,7 @@ 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 = utils.fullVersion(irc) + fullversion = irc.version() irc.proto.numeric(irc.sid, 351, source, fullversion) utils.add_hook(handle_version, 'VERSION') diff --git a/protocols/inspircd.py b/protocols/inspircd.py index 9100409..a13afa6 100644 --- a/protocols/inspircd.py +++ b/protocols/inspircd.py @@ -358,7 +358,7 @@ class InspIRCdProtocol(TS6BaseProtocol): self._send(self.irc.sid, 'BURST %s' % ts) # InspIRCd sends VERSION data on link, instead of whenever requested by a client. - self._send(self.irc.sid, 'VERSION :%s' % utils.fullVersion(self.irc)) + self._send(self.irc.sid, 'VERSION :%s' % self.irc.version()) self._send(self.irc.sid, 'ENDBURST') def handle_capab(self, source, command, args): diff --git a/utils.py b/utils.py index 0f0d6a3..b923ab7 100644 --- a/utils.py +++ b/utils.py @@ -141,11 +141,3 @@ def getDatabaseName(dbname): dbname += '-%s' % conf.confname dbname += '.db' return dbname - -def fullVersion(irc): - """ - Returns a detailed version string including the PyLink daemon version, - the protocol module in use, and the server hostname. - """ - fullversion = 'PyLink-%s. %s :[protocol:%s]' % (world.version, irc.serverdata['hostname'], irc.protoname) - return fullversion