summary refs log tree commit diff stats
path: root/src/common/inbound.c
diff options
context:
space:
mode:
authorDiogo Sousa <diogogsousa@gmail.com>2013-06-22 00:13:36 +0100
committerDiogo Sousa <diogogsousa@gmail.com>2013-06-28 16:03:12 +0100
commit94186f7888d5a730e52e433a21698154dfcc4e2e (patch)
treec7ec4e195a92f0e81d130d1cfe47442e75a5637b /src/common/inbound.c
parentac5771377ea95287a99bfd5c8c99ec65e9bb069d (diff)
First step towards message tags extension support
(see http://ircv3.atheme.org/specification/message-tags-3.2).

In particular this commit implements a (very) dummy implementation
sketch of the server-time extension
(see http://ircv3.atheme.org/specification/message-tags-3.2 and #499).
Diffstat (limited to 'src/common/inbound.c')
-rw-r--r--src/common/inbound.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/common/inbound.c b/src/common/inbound.c
index b1b739e5..55a4005c 100644
--- a/src/common/inbound.c
+++ b/src/common/inbound.c
@@ -158,6 +158,8 @@ inbound_privmsg (server *serv, char *from, char *ip, char *text, int id)
 	struct User *user;
 	char idtext[64];
 	gboolean nodiag = FALSE;
+	message_tags_data tags_data_ = MESSAGE_TAGS_DATA_INIT; /* TODO: this will be an argument */
+	const message_tags_data const *tags_data = &tags_data_;
 
 	sess = find_dialog (serv, from);
 
@@ -186,7 +188,7 @@ inbound_privmsg (server *serv, char *from, char *ip, char *text, int id)
 			}
 			set_topic (sess, ip, ip);
 		}
-		inbound_chanmsg (serv, NULL, NULL, from, text, FALSE, id);
+		inbound_chanmsg (serv, NULL, NULL, from, text, FALSE, id, tags_data);
 		return;
 	}
 
@@ -410,7 +412,9 @@ inbound_action (session *sess, char *chan, char *from, char *ip, char *text, int
 }
 
 void
-inbound_chanmsg (server *serv, session *sess, char *chan, char *from, char *text, char fromme, int id)
+inbound_chanmsg (server *serv, session *sess, char *chan, char *from, 
+		 char *text, char fromme, int id, 
+		 const message_tags_data const *tags_data)
 {
 	struct User *user;
 	int hilight = FALSE;
@@ -462,11 +466,14 @@ inbound_chanmsg (server *serv, session *sess, char *chan, char *from, char *text
 		hilight = TRUE;
 
 	if (sess->type == SESS_DIALOG)
-		EMIT_SIGNAL (XP_TE_DPRIVMSG, sess, from, text, idtext, NULL, 0);
+		EMIT_SIGNAL_TIMESTAMP (XP_TE_DPRIVMSG, sess, from, text, 
+				       idtext, NULL, 0, tags_data->timestamp);
 	else if (hilight)
-		EMIT_SIGNAL (XP_TE_HCHANMSG, sess, from, text, nickchar, idtext, 0);
+		EMIT_SIGNAL_TIMESTAMP (XP_TE_HCHANMSG, sess, from, text,
+				       nickchar, idtext, 0, tags_data->timestamp);
 	else
-		EMIT_SIGNAL (XP_TE_CHANMSG, sess, from, text, nickchar, idtext, 0);
+		EMIT_SIGNAL_TIMESTAMP (XP_TE_CHANMSG, sess, from, text, 
+				       nickchar, idtext, 0, tags_data->timestamp);
 }
 
 void