From e0c937bf8f58dbd0f0e52b956e05a51e4dc265a8 Mon Sep 17 00:00:00 2001 From: Rick Gibbed Date: Mon, 8 Oct 2012 21:19:58 -0400 Subject: [PATCH] Reinstate mIRC codes in a form that won't eat following text. Signed-off-by: Eric S. Raymond --- irkerhook.py | 11 +++++++++++ irkerhook.xml | 3 ++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/irkerhook.py b/irkerhook.py index fa67af6..b7bc1de 100755 --- a/irkerhook.py +++ b/irkerhook.py @@ -108,6 +108,17 @@ class GenericExtractor: self.brown = self.magenta = self.cyan = self.reset = "" def activate_color(self, style): "IRC color codes." + if style == 'mIRC': + # mIRC colors are mapped as closely to the ANSI colors as possible. + self.bold = '\x02' + self.green = '\x0309' + self.blue = '\x0312' + self.red = '\x0304' + self.yellow = '\x0308' + self.brown = '\x0305' + self.magenta = '\x0306' + self.cyan = '\x0310' + self.reset = '\x0F' if style == 'ANSI': self.bold = '\x1b[1m' self.green = '\x1b[1;32m' diff --git a/irkerhook.xml b/irkerhook.xml index f031c72..d097aaa 100644 --- a/irkerhook.xml +++ b/irkerhook.xml @@ -119,7 +119,8 @@ variable is "None", no compression will be attempted. color -If "ANSI", highlight notification fields with ANSI color escape sequences. +If "mIRC", highlight notification fields with mIRC color codes. +If "ANSI", highlight notification fields with ANSI color escape sequences. Defaults to "none" (no colors). Note: if you turn this on and notifications stop appearing on your channel, you need to turn off IRC's color filter on that channel. To do this you will need op -- 2.26.2