mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-24 11:42:52 +01:00
Changed delhostmask to removehostmask and fixed a bug.
This commit is contained in:
parent
0293a2ba0d
commit
2d0671b6f6
@ -134,10 +134,10 @@ class UserCommands(callbacks.Privmsg):
|
||||
irc.error(msg, conf.replyIncorrectAuth)
|
||||
return
|
||||
|
||||
def delhostmask(self, irc, msg, args):
|
||||
def removehostmask(self, irc, msg, args):
|
||||
"""<name> <hostmask> [<password>]
|
||||
|
||||
Deletes the hostmask <hostmask> from the record of the user specified
|
||||
Removes the hostmask <hostmask> from the record of the user specified
|
||||
by <name>. The <password> may only be required if the user is not
|
||||
recognized by his hostmask.
|
||||
"""
|
||||
@ -151,7 +151,11 @@ class UserCommands(callbacks.Privmsg):
|
||||
irc.error(msg, conf.replyNoUser)
|
||||
return
|
||||
if user.checkHostmask(msg.prefix) or user.checkPassword(password):
|
||||
user.removeHostmask(hostmask)
|
||||
try:
|
||||
user.removeHostmask(hostmask)
|
||||
except ValueError:
|
||||
irc.error(msg, 'There was no such hostmask.')
|
||||
return
|
||||
ircdb.users.setUser(id, user)
|
||||
irc.reply(msg, conf.replySuccess)
|
||||
else:
|
||||
|
@ -223,7 +223,7 @@ class IrcUser(object):
|
||||
self.hostmasks.append(hostmask)
|
||||
|
||||
def removeHostmask(self, hostmask):
|
||||
self.hostmasks = [s for s in self.hostmasks if s != hostmask]
|
||||
self.hostmasks.remove(hostmask)
|
||||
|
||||
def hasHostmask(self, hostmask):
|
||||
return hostmask in self.hostmasks
|
||||
|
Loading…
Reference in New Issue
Block a user