summary refs log tree commit diff stats
path: root/src/common/text.c
diff options
context:
space:
mode:
authorPatrick Griffis <tingping@tingping.se>2016-11-11 19:25:46 -0500
committerPatrick Griffis <tingping@tingping.se>2016-11-11 19:27:57 -0500
commit241dd69b081779a77718763561a779cdffcaf11f (patch)
treec9ee1ac451506f8b17efbf1b5b98cd97fe19aee5 /src/common/text.c
parent539949973c484f14d40f1886d67ec09df057315c (diff)
Further tab color improvements
- Combine the three properties into a single one
- Finally fully fix the handling with plugins handling events

TODO: Look into lastact handling of these, seems wrong
Diffstat (limited to 'src/common/text.c')
-rw-r--r--src/common/text.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/common/text.c b/src/common/text.c
index 799af833..9d7935f2 100644
--- a/src/common/text.c
+++ b/src/common/text.c
@@ -2008,6 +2008,7 @@ text_emit (int index, session *sess, char *a, char *b, char *c, char *d,
 {
 	char *word[PDIWORDS];
 	int i;
+	tab_state_flags current_state = sess->tab_state;
 	unsigned int stripcolor_args = (chanopt_is_set (prefs.hex_text_stripcolor_msg, sess->text_strip) ? 0xFFFFFFFF : 0);
 	char tbuf[NICKLEN + 4];
 
@@ -2026,14 +2027,12 @@ text_emit (int index, session *sess, char *a, char *b, char *c, char *d,
 	for (i = 5; i < PDIWORDS; i++)
 		word[i] = "\000";
 
+	/* We want to ignore the tab state if the plugin emits new events
+	 * and restore it if it doesn't eat the current one */
+	sess->tab_state = sess->last_tab_state;
 	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;
-	}
+	sess->tab_state = current_state;
 
 	/* If a plugin's callback executes "/close", 'sess' may be invalid */
 	if (!is_session (sess))