mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Updated more replies.
This commit is contained in:
parent
099b8bc14b
commit
2846b4ab2f
@ -400,7 +400,7 @@ class ChannelDB(plugins.ChannelDBHandler,
|
|||||||
hostmask = irc.state.nickToHostmask(name)
|
hostmask = irc.state.nickToHostmask(name)
|
||||||
name = ircdb.users.getUserId(hostmask)
|
name = ircdb.users.getUserId(hostmask)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
irc.error(conf.replyNoUser)
|
irc.errorNoUser()
|
||||||
else:
|
else:
|
||||||
table = 'nick_seen'
|
table = 'nick_seen'
|
||||||
criterion = 'normalized=%s'
|
criterion = 'normalized=%s'
|
||||||
@ -439,7 +439,7 @@ class ChannelDB(plugins.ChannelDBHandler,
|
|||||||
hostmask = irc.state.nickToHostmask(name)
|
hostmask = irc.state.nickToHostmask(name)
|
||||||
id = ircdb.users.getUserId(hostmask)
|
id = ircdb.users.getUserId(hostmask)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
irc.error(conf.replyNoUser)
|
irc.errorNoUser()
|
||||||
return
|
return
|
||||||
else:
|
else:
|
||||||
id = ircdb.users.getUserId(name)
|
id = ircdb.users.getUserId(name)
|
||||||
@ -544,7 +544,7 @@ class ChannelDB(plugins.ChannelDBHandler,
|
|||||||
hostmask = irc.state.nickToHostmask(user)
|
hostmask = irc.state.nickToHostmask(user)
|
||||||
id = ircdb.users.getUserId(hostmask)
|
id = ircdb.users.getUserId(hostmask)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
irc.error(conf.replyNoUser)
|
irc.errorNoUser()
|
||||||
return
|
return
|
||||||
db = self.getDb(channel)
|
db = self.getDb(channel)
|
||||||
cursor = db.cursor()
|
cursor = db.cursor()
|
||||||
|
@ -170,7 +170,7 @@ class Herald(callbacks.Privmsg, configurable.Mixin):
|
|||||||
try:
|
try:
|
||||||
id = self._getId(userNickHostmask)
|
id = self._getId(userNickHostmask)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
irc.error(conf.replyNoUser)
|
irc.errorNoUser()
|
||||||
return
|
return
|
||||||
self.db.setHerald(id, channel, herald)
|
self.db.setHerald(id, channel, herald)
|
||||||
irc.replySuccess()
|
irc.replySuccess()
|
||||||
@ -188,7 +188,7 @@ class Herald(callbacks.Privmsg, configurable.Mixin):
|
|||||||
try:
|
try:
|
||||||
id = self._getId(userNickHostmask)
|
id = self._getId(userNickHostmask)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
irc.error(conf.replyNoUser)
|
irc.errorNoUser()
|
||||||
return
|
return
|
||||||
self.db.delHerald(id, channel)
|
self.db.delHerald(id, channel)
|
||||||
irc.replySuccess()
|
irc.replySuccess()
|
||||||
|
@ -134,7 +134,7 @@ class Note(callbacks.Privmsg):
|
|||||||
hostmask = irc.state.nickToHostmask(name)
|
hostmask = irc.state.nickToHostmask(name)
|
||||||
toId = ircdb.users.getUserId(hostmask)
|
toId = ircdb.users.getUserId(hostmask)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
irc.error(conf.replyNoUser)
|
irc.errorNoUser()
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
fromId = ircdb.users.getUserId(msg.prefix)
|
fromId = ircdb.users.getUserId(msg.prefix)
|
||||||
|
@ -248,7 +248,7 @@ class Topic(callbacks.Privmsg, configurable.Mixin):
|
|||||||
try:
|
try:
|
||||||
senderName = ircdb.users.getUser(msg.prefix).name
|
senderName = ircdb.users.getUser(msg.prefix).name
|
||||||
except KeyError:
|
except KeyError:
|
||||||
irc.error(conf.replyNoUser)
|
irc.errorNoUser()
|
||||||
return
|
return
|
||||||
if name and name != senderName and \
|
if name and name != senderName and \
|
||||||
not ircdb.checkCapabilities(msg.prefix, ('op', 'admin')):
|
not ircdb.checkCapabilities(msg.prefix, ('op', 'admin')):
|
||||||
|
@ -244,7 +244,7 @@ class Admin(privmsgs.CapabilityCheckingPrivmsg):
|
|||||||
ircdb.users.setUser(id, user)
|
ircdb.users.setUser(id, user)
|
||||||
irc.replySuccess()
|
irc.replySuccess()
|
||||||
except KeyError:
|
except KeyError:
|
||||||
irc.error(conf.replyNoUser)
|
irc.errorNoUser()
|
||||||
else:
|
else:
|
||||||
s = 'You can\'t add capabilities you don\'t have.'
|
s = 'You can\'t add capabilities you don\'t have.'
|
||||||
irc.error(s)
|
irc.error(s)
|
||||||
@ -262,7 +262,7 @@ class Admin(privmsgs.CapabilityCheckingPrivmsg):
|
|||||||
id = ircdb.users.getUserId(name)
|
id = ircdb.users.getUserId(name)
|
||||||
user = ircdb.users.getUser(id)
|
user = ircdb.users.getUser(id)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
irc.error(conf.replyNoUser)
|
irc.errorNoUser()
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
user.removeCapability(capability)
|
user.removeCapability(capability)
|
||||||
|
@ -411,7 +411,7 @@ class Channel(callbacks.Privmsg):
|
|||||||
ircdb.users.setUser(id, user)
|
ircdb.users.setUser(id, user)
|
||||||
irc.replySuccess()
|
irc.replySuccess()
|
||||||
except KeyError:
|
except KeyError:
|
||||||
irc.error(conf.replyNoUser)
|
irc.errorNoUser()
|
||||||
addcapability = privmsgs.checkChannelCapability(addcapability,'op')
|
addcapability = privmsgs.checkChannelCapability(addcapability,'op')
|
||||||
|
|
||||||
def removecapability(self, irc, msg, args, channel):
|
def removecapability(self, irc, msg, args, channel):
|
||||||
@ -431,7 +431,7 @@ class Channel(callbacks.Privmsg):
|
|||||||
ircdb.users.setUser(id, user)
|
ircdb.users.setUser(id, user)
|
||||||
irc.replySuccess()
|
irc.replySuccess()
|
||||||
except KeyError:
|
except KeyError:
|
||||||
irc.error(conf.replyNoUser)
|
irc.errorNoUser()
|
||||||
removecapability = privmsgs.checkChannelCapability(removecapability, 'op')
|
removecapability = privmsgs.checkChannelCapability(removecapability, 'op')
|
||||||
|
|
||||||
def setdefaultcapability(self, irc, msg, args, channel):
|
def setdefaultcapability(self, irc, msg, args, channel):
|
||||||
|
18
src/User.py
18
src/User.py
@ -187,7 +187,7 @@ class User(callbacks.Privmsg):
|
|||||||
id = ircdb.users.getUserId(name)
|
id = ircdb.users.getUserId(name)
|
||||||
user = ircdb.users.getUser(id)
|
user = ircdb.users.getUser(id)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
irc.error(conf.replyNoUser)
|
irc.errorNoUser()
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
otherId = ircdb.users.getUserId(hostmask)
|
otherId = ircdb.users.getUserId(hostmask)
|
||||||
@ -218,7 +218,7 @@ class User(callbacks.Privmsg):
|
|||||||
id = ircdb.users.getUserId(name)
|
id = ircdb.users.getUserId(name)
|
||||||
user = ircdb.users.getUser(id)
|
user = ircdb.users.getUser(id)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
irc.error(conf.replyNoUser)
|
irc.errorNoUser()
|
||||||
return
|
return
|
||||||
if user.checkHostmask(msg.prefix) or user.checkPassword(password):
|
if user.checkHostmask(msg.prefix) or user.checkPassword(password):
|
||||||
try:
|
try:
|
||||||
@ -251,7 +251,7 @@ class User(callbacks.Privmsg):
|
|||||||
id = ircdb.users.getUserId(name)
|
id = ircdb.users.getUserId(name)
|
||||||
user = ircdb.users.getUser(id)
|
user = ircdb.users.getUser(id)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
irc.error(conf.replyNoUser)
|
irc.errorNoUser()
|
||||||
return
|
return
|
||||||
if user.checkPassword(oldpassword):
|
if user.checkPassword(oldpassword):
|
||||||
user.setPassword(newpassword, hashed=hashed)
|
user.setPassword(newpassword, hashed=hashed)
|
||||||
@ -271,13 +271,13 @@ class User(callbacks.Privmsg):
|
|||||||
try:
|
try:
|
||||||
hostmask = irc.state.nickToHostmask(hostmask)
|
hostmask = irc.state.nickToHostmask(hostmask)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
irc.error(conf.replyNoUser)
|
irc.errorNoUser()
|
||||||
return
|
return
|
||||||
try:
|
try:
|
||||||
user = ircdb.users.getUser(hostmask)
|
user = ircdb.users.getUser(hostmask)
|
||||||
irc.reply(user.name)
|
irc.reply(user.name)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
irc.error(conf.replyNoUser)
|
irc.errorNoUser()
|
||||||
|
|
||||||
def hostmasks(self, irc, msg, args):
|
def hostmasks(self, irc, msg, args):
|
||||||
"""[<name>]
|
"""[<name>]
|
||||||
@ -299,7 +299,7 @@ class User(callbacks.Privmsg):
|
|||||||
user = ircdb.users.getUser(name)
|
user = ircdb.users.getUser(name)
|
||||||
irc.reply(repr(user.hostmasks))
|
irc.reply(repr(user.hostmasks))
|
||||||
except KeyError:
|
except KeyError:
|
||||||
irc.error(conf.replyNoUser)
|
irc.errorNoUser()
|
||||||
else:
|
else:
|
||||||
irc.reply(repr(user.hostmasks))
|
irc.reply(repr(user.hostmasks))
|
||||||
except KeyError:
|
except KeyError:
|
||||||
@ -319,7 +319,7 @@ class User(callbacks.Privmsg):
|
|||||||
user = ircdb.users.getUser(name)
|
user = ircdb.users.getUser(name)
|
||||||
irc.reply('[%s]' % ', '.join(user.capabilities))
|
irc.reply('[%s]' % ', '.join(user.capabilities))
|
||||||
except KeyError:
|
except KeyError:
|
||||||
irc.error(conf.replyNoUser)
|
irc.errorNoUser()
|
||||||
|
|
||||||
def identify(self, irc, msg, args):
|
def identify(self, irc, msg, args):
|
||||||
"""<name> <password>
|
"""<name> <password>
|
||||||
@ -334,7 +334,7 @@ class User(callbacks.Privmsg):
|
|||||||
id = ircdb.users.getUserId(name)
|
id = ircdb.users.getUserId(name)
|
||||||
user = ircdb.users.getUser(id)
|
user = ircdb.users.getUser(id)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
irc.error(conf.replyNoUser)
|
irc.errorNoUser()
|
||||||
return
|
return
|
||||||
if user.checkPassword(password):
|
if user.checkPassword(password):
|
||||||
try:
|
try:
|
||||||
@ -356,7 +356,7 @@ class User(callbacks.Privmsg):
|
|||||||
id = ircdb.users.getUserId(msg.prefix)
|
id = ircdb.users.getUserId(msg.prefix)
|
||||||
user = ircdb.users.getUser(id)
|
user = ircdb.users.getUser(id)
|
||||||
except KeyError:
|
except KeyError:
|
||||||
irc.error(conf.replyNoUser)
|
irc.errorNoUser()
|
||||||
return
|
return
|
||||||
user.unsetAuth()
|
user.unsetAuth()
|
||||||
ircdb.users.setUser(id, user)
|
ircdb.users.setUser(id, user)
|
||||||
|
Loading…
Reference in New Issue
Block a user