3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-01 01:09:22 +01:00

Irc: make hostname field optional in version()

Reported by Rascle via IRC.
This commit is contained in:
James Lu 2016-08-10 13:16:51 -07:00
parent d1dccf8dcc
commit ffdc313376

View File

@ -810,7 +810,8 @@ class 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]' % (__version__, self.serverdata['hostname'], self.protoname)
fullversion = 'PyLink-%s. %s :[protocol:%s]' % (__version__, self.serverdata.get('hostname', world.fallback_hostname),
self.protoname)
return fullversion
### State checking functions