From 076fb79afeb3bfab00f02cfeda66d905b24ba419 Mon Sep 17 00:00:00 2001 From: James Lu Date: Fri, 22 May 2015 22:10:23 -0700 Subject: [PATCH] CtcpNext: strip formatting, don't allow overriding ACTION/PING --- CtcpNext/plugin.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/CtcpNext/plugin.py b/CtcpNext/plugin.py index 5118e12..17c23b1 100644 --- a/CtcpNext/plugin.py +++ b/CtcpNext/plugin.py @@ -116,7 +116,11 @@ class CtcpNext(callbacks.PluginRegexp): ACTION and PING, which are handled accordingly. All the standard substitutes ($version, $now, $nick, etc.) are handled properly. """ - self.db[ctcp.upper()] = response + ctcp = ctcp.upper() + if ctcp in ('ACTION', 'PING'): + irc.error('Replies for CTCP ACTION and PING cannot be overridden.', + Raise=True) + self.db[ctcp] = response irc.replySuccess() set = wrap(set, ['admin', 'somethingWithoutSpaces', 'text']) @@ -138,8 +142,9 @@ class CtcpNext(callbacks.PluginRegexp): """takes no arguments. Lists the CTCP responses currently configured.""" - items = [format("%s: %s", k, ircutils.bold(v)) for (k, v) in self.db.items()] - irc.reply(format('%L', items)) + items = [format("%s: %s", k, ircutils.bold(v) + "\x0f") + for (k, v) in self.db.items()] + irc.reply(format('%L', sorted(items))) def clear(self, irc, msg, args): """takes no arguments.