mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-20 01:19:26 +01:00
Alias: Also allow exclamation marks, as they are allowed by the registry.
This commit is contained in:
parent
ccafbf4847
commit
f32f36fea4
@ -317,12 +317,12 @@ class Alias(callbacks.Plugin):
|
|||||||
irc.error(_('There is no such alias.'))
|
irc.error(_('There is no such alias.'))
|
||||||
unlock = wrap(unlock, [('checkCapability', 'admin'), 'commandName'])
|
unlock = wrap(unlock, [('checkCapability', 'admin'), 'commandName'])
|
||||||
|
|
||||||
_validNameRe = re.compile(r'^[a-z.|][a-z0-9.|]*$')
|
_validNameRe = re.compile(r'^[a-z.|!][a-z0-9.|!]*$')
|
||||||
def addAlias(self, irc, name, alias, lock=False):
|
def addAlias(self, irc, name, alias, lock=False):
|
||||||
if not self._validNameRe.search(name):
|
if not self._validNameRe.search(name):
|
||||||
raise AliasError('Names can only contain alphanumerical '
|
raise AliasError('Names can only contain alphanumerical '
|
||||||
'characters and dots and pipes (and the first letter '
|
'characters, dots, pipes, and exclamation marks '
|
||||||
'cannot be a number).')
|
'(and the first character cannot be a number).')
|
||||||
realName = callbacks.canonicalName(name)
|
realName = callbacks.canonicalName(name)
|
||||||
if name != realName:
|
if name != realName:
|
||||||
s = format(_('That name isn\'t valid. Try %q instead.'), realName)
|
s = format(_('That name isn\'t valid. Try %q instead.'), realName)
|
||||||
|
Loading…
Reference in New Issue
Block a user