summaryrefslogtreecommitdiff
path: root/src/fe-common/irc/irc-hilight-text.c
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2000-06-30 19:50:56 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2000-06-30 19:50:56 +0000
commite90cdaf4ca56ba0ace0448805f9ee8a89d3b7cdb (patch)
tree77ec7580793863c0c308e49471efe07c1ee3494b /src/fe-common/irc/irc-hilight-text.c
parent5da58d5849f313d7c4596745cb792296428ea225 (diff)
downloadirssi-e90cdaf4ca56ba0ace0448805f9ee8a89d3b7cdb.zip
Lots of /HILIGHT changes. You can use color names with -color. Window
numbers are colored with the highlight color in activity statusbar item. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@398 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-common/irc/irc-hilight-text.c')
-rw-r--r--src/fe-common/irc/irc-hilight-text.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/fe-common/irc/irc-hilight-text.c b/src/fe-common/irc/irc-hilight-text.c
index 7c8a46be..7969f7d4 100644
--- a/src/fe-common/irc/irc-hilight-text.c
+++ b/src/fe-common/irc/irc-hilight-text.c
@@ -19,10 +19,13 @@
*/
#include "module.h"
+#include "signals.h"
#include "settings.h"
#include "hilight-text.h"
+static int last_color;
+
char *irc_hilight_find_nick(const char *channel, const char *nick,
const char *address, int level, const char *msg)
{
@@ -32,6 +35,28 @@ char *irc_hilight_find_nick(const char *channel, const char *nick,
color = hilight_match(channel, mask, level, msg);
g_free(mask);
+ last_color = (color != NULL && *color == 3) ?
+ atoi(color+1) : 0;
return color;
}
+int irc_hilight_last_color(void)
+{
+ return last_color;
+}
+
+static void event_privmsg(void)
+{
+ last_color = 0;
+}
+
+void irc_hilight_text_init(void)
+{
+ last_color = 0;
+ signal_add_last("event privmsg", (SIGNAL_FUNC) event_privmsg);
+}
+
+void irc_hilight_text_deinit(void)
+{
+ signal_remove("event privmsg", (SIGNAL_FUNC) event_privmsg);
+}