mirror of
https://github.com/jlu5/PyLink.git
synced 2024-11-01 01:09:22 +01:00
core: rename utils.fullVersion -> irc.version (#199)
This commit is contained in:
parent
3bb1208e74
commit
beae4eea9e
@ -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."""
|
||||
|
@ -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')
|
||||
|
||||
|
@ -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):
|
||||
|
8
utils.py
8
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
|
||||
|
Loading…
Reference in New Issue
Block a user