3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-30 14:49:28 +01:00

core: rename utils.fullVersion -> irc.version (#199)

This commit is contained in:
James Lu 2016-04-30 17:00:28 -07:00
parent 3bb1208e74
commit beae4eea9e
4 changed files with 10 additions and 10 deletions

View File

@ -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."""

View File

@ -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 "<server version>. <server hostname> :<anything else you want to add>
fullversion = utils.fullVersion(irc)
fullversion = irc.version()
irc.proto.numeric(irc.sid, 351, source, fullversion)
utils.add_hook(handle_version, 'VERSION')

View File

@ -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):

View File

@ -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