--- a/src/irc_line.h Thu Mar 26 22:54:25 2009 +0200
+++ b/src/irc_line.h Thu Mar 26 23:15:55 2009 +0200
@@ -6,6 +6,7 @@
*
* The low-level IRC protocol unit is a line, with prefix, command and arguments
*/
+#include "irc_proto.h"
#include "error.h"
/**
@@ -28,8 +29,8 @@
* Low-level IRC protocol unit
*/
struct irc_line {
- /** The message source, either a server name or a nickmask */
- const char *prefix;
+ /** The message source as a nickmask, for those messages that have a valid prefix. May be NULL otherwise */
+ const struct irc_nm *source;
/** The command, either a numeric or a primary command */
const char *command;
@@ -42,9 +43,11 @@
* Parse an IRC message to fill in an irc_line. This mutates the value of data (to insert NULs between tokens), and
* stores pointers into this data into the irc_line.
*
+ * If the prefix is a valid nickmask, it will be stored in the given given irc_nm, and irc_line.nm set to this.
+ *
* The irc_line will have the first N args values set to valid values, and all the rest set to NULL.
*/
-err_t irc_line_parse (struct irc_line *line, char *data);
+err_t irc_line_parse (struct irc_line *line, struct irc_nm *nm, char *data);
/**
* Formats an irc_line as a protocol line into the given buffer (which should hold at least IRC_LINE_MAX bytes).