Encyclopedia:
Fix channel specific factoid lookup for channes with Upper-case names (LP: #203595) Bugtracker: Add @mark to add a Bantracker entry without having to kick or ban (LP: #159568)
This commit is contained in:
parent
eaeb52c797
commit
21ab658806
|
@ -254,4 +254,34 @@ class Bantracker(callbacks.Plugin):
|
|||
|
||||
btlogin = wrap(btlogin)
|
||||
|
||||
def mark(self, irc, msg, args, channel, target, kickmsg):
|
||||
"""<nick> [<channel>] [<comment>]
|
||||
|
||||
Creates an entry in the Bantracker as if <nick> was kicked from <channel> with the comment <comment>,
|
||||
if <comment> is given it will be uses as the comment on the Bantracker, <channel> is only needed when send in /msg
|
||||
"""
|
||||
if not msg.tagged('identified'):
|
||||
irc.error(conf.supybot.replies.incorrectAuthentication())
|
||||
return
|
||||
try:
|
||||
user = ircdb.users.getUser(msg.prefix[:msg.prefix.find('!')])
|
||||
except:
|
||||
irc.error(conf.supybot.replies.incorrectAuthentication())
|
||||
return
|
||||
|
||||
user.addAuth(msg.prefix)
|
||||
ircdb.users.setUser(user, flush=False)
|
||||
if not channel:
|
||||
irc.error('<channel> must be given if not in a channel')
|
||||
return
|
||||
if not kickmsg:
|
||||
kickmsg = '**MARK**'
|
||||
else:
|
||||
kickmsg = "**MARK** - %s" % kickmsg
|
||||
self.doLog(irc, channel, '*** %s requested a mark for %s\n' % (msg.nick, target))
|
||||
self.doKickban(irc, channel, msg.nick, target, kickmsg)
|
||||
irc.replySuccess()
|
||||
|
||||
mark = wrap(mark, [optional('channel'), 'something', additional('text')])
|
||||
|
||||
Class = Bantracker
|
||||
|
|
|
@ -205,8 +205,8 @@ class Encyclopedia(callbacks.Plugin):
|
|||
factoids = FactoidSet()
|
||||
factoids.global_primary = self.get_single_factoid(channel, name)
|
||||
factoids.global_secondary = self.get_single_factoid(channel, name + '-also')
|
||||
factoids.channel_primary = self.get_single_factoid(channel, name + '-' + channel)
|
||||
factoids.channel_secondary = self.get_single_factoid(channel, name + '-' + channel + '-also')
|
||||
factoids.channel_primary = self.get_single_factoid(channel, name + '-' + channel.lower())
|
||||
factoids.channel_secondary = self.get_single_factoid(channel, name + '-' + channel.lower() + '-also')
|
||||
if resolve:
|
||||
factoids.global_primary = self.resolve_alias(channel, factoids.global_primary)
|
||||
factoids.global_secondary = self.resolve_alias(channel, factoids.global_secondary)
|
||||
|
|
Loading…
Reference in New Issue