mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Bring back VersionIsEmpty for supybot.user
Was removed by e5729bc86d
, but
the removal breaks compatibility with popular IRCds.
This commit is contained in:
parent
c6e29031d1
commit
97d29d7913
14
src/conf.py
14
src/conf.py
@ -212,8 +212,20 @@ registerGlobalValue(supybot, 'ident',
|
||||
ValidNick('limnoria', _("""Determines the bot's ident string, if the server
|
||||
doesn't provide one by default.""")))
|
||||
|
||||
# Although empty version strings are theoretically allowed by the RFC,
|
||||
# popular IRCds do not.
|
||||
# So, we keep replacing the empty string by the current version for
|
||||
# bots which are migrated from Supybot or an old version of Limnoria
|
||||
# (whose default value of supybot.user is the empty string).
|
||||
class VersionIfEmpty(registry.String):
|
||||
def __call__(self):
|
||||
ret = registry.String.__call__(self)
|
||||
if not ret:
|
||||
ret = 'Limnoria $version'
|
||||
return ret
|
||||
|
||||
registerGlobalValue(supybot, 'user',
|
||||
registry.String('Limnoria $version', _("""Determines the real name which the bot sends to
|
||||
VersionIfEmpty('Limnoria $version', _("""Determines the real name which the bot sends to
|
||||
the server. A standard real name using the current version of the bot
|
||||
will be generated if this is left empty.""")))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user