summary refs log tree commit diff stats
path: root/src/common/proto-irc.c
diff options
context:
space:
mode:
authorDiogo Sousa <diogogsousa@gmail.com>2013-11-28 00:59:31 +0000
committerDiogo Sousa <diogogsousa@gmail.com>2013-11-28 02:11:33 +0000
commit40f26429f8e3466fb68af30076d1a297c84f5da6 (patch)
treedcbc904de44ff5284d77e53168fc001c342e218d /src/common/proto-irc.c
parentd38bbb1e2c96314dd61faa84f2908b90ae29b987 (diff)
Print{,_attr} and server{,_attr} hooks were incorrectly handled when both
version existed (regular and attrs).  Specifically, the priority was not
respected, and both versions were run even when EAT_PLUGIN was returned.

Fixes #847.
Diffstat (limited to 'src/common/proto-irc.c')
-rw-r--r--src/common/proto-irc.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/src/common/proto-irc.c b/src/common/proto-irc.c
index eb60a2e6..6d7c7fc1 100644
--- a/src/common/proto-irc.c
+++ b/src/common/proto-irc.c
@@ -1503,9 +1503,6 @@ irc_inline (server *serv, char *buf, int len)
 
 	if (buf[0] == ':')
 	{
-		int eat1;
-		int eat2;
-
 		/* find a context for this message */
 		if (is_channel (serv, word[3]))
 		{
@@ -1520,11 +1517,8 @@ irc_inline (server *serv, char *buf, int len)
 		word[0] = type;
 		word_eol[1] = buf;	/* keep the ":" for plugins */
 
-		eat1 = plugin_emit_server (sess, type, word, word_eol);
-		eat2 = plugin_emit_server_attrs (sess, type, word, word_eol, 
-										 tags_data.timestamp);
-
-		if (eat1 || eat2)
+		if (plugin_emit_server (sess, type, word, word_eol,
+								tags_data.timestamp))
 			goto xit;
 
 		word[1]++;
@@ -1532,16 +1526,10 @@ irc_inline (server *serv, char *buf, int len)
 
 	} else
 	{
-		int eat1;
-		int eat2;
-
 		word[0] = type = word[1];
 
-		eat1 = plugin_emit_server (sess, type, word, word_eol);
-		eat2 = plugin_emit_server_attrs (sess, type, word, word_eol,
-										 tags_data.timestamp);
-
-		if (eat1 || eat2)
+		if (plugin_emit_server (sess, type, word, word_eol,
+								tags_data.timestamp))
 			goto xit;
 	}