summary refs log tree commit diff stats
path: root/src/common
diff options
context:
space:
mode:
authorPatrick Griffis <tingping@tingping.se>2016-11-11 01:25:12 -0500
committerPatrick Griffis <tingping@tingping.se>2016-11-11 01:25:12 -0500
commit539949973c484f14d40f1886d67ec09df057315c (patch)
tree823b900e1cb28b61a567a63a8f7a507767bcaebd /src/common
parente7c88e0f83f40f9d020aa7d2783e95dff55f323f (diff)
More fixes for tab color handling with plugins
Part 2 of 03767ee0f9826222

So how the colors work should be pretty straight forward:

- A message comes in and is handled, this sets the state flags:
    nick_said, msg_said, new_data. These map to tab colors.
- This state is reset under one of these conditions:
  - It is commited to the UI when actually printed on unfocused tab
  - Event is interupted by a plugin hook
  - The tab focus is changed
Diffstat (limited to 'src/common')
-rw-r--r--src/common/text.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/common/text.c b/src/common/text.c
index e491b512..799af833 100644
--- a/src/common/text.c
+++ b/src/common/text.c
@@ -2027,7 +2027,13 @@ text_emit (int index, session *sess, char *a, char *b, char *c, char *d,
 		word[i] = "\000";
 
 	if (plugin_emit_print (sess, word, timestamp))
+	{
+		/* Reset the state that never printed */
+		sess->nick_said = FALSE;
+		sess->msg_said = FALSE;
+		sess->new_data = FALSE;
 		return;
+	}
 
 	/* If a plugin's callback executes "/close", 'sess' may be invalid */
 	if (!is_session (sess))
@@ -2061,7 +2067,6 @@ text_emit (int index, session *sess, char *a, char *b, char *c, char *d,
 	/* ===Highlighted message=== */
 	case XP_TE_HCHANACTION:
 	case XP_TE_HCHANMSG:
-		fe_set_tab_color (sess, 3);
 		if (chanopt_is_set (prefs.hex_input_beep_hilight, sess->alert_beep) && (!prefs.hex_away_omit_alerts || !sess->server->is_away))
 			sound_beep (sess);
 		if (chanopt_is_set (prefs.hex_input_flash_hilight, sess->alert_taskbar) && (!prefs.hex_away_omit_alerts || !sess->server->is_away))