~aleteoryx/sexchat

2f53a59a4d3899bcb83d4399e520f0472f12ccfa — Aleteoryx 4 months ago 72f7d49
add msgid to xtext and scrollback
M src/common/ctcp.c => src/common/ctcp.c +5 -9
@@ 162,13 162,11 @@ ctcp_handle (session *sess, char *to, char *nick, char *ip,
				if (!chansess)
					chansess = sess;

				EMIT_SIGNAL_TIMESTAMP (XP_TE_CTCPSNDC, chansess, word[5],
											  nick, to, NULL, 0, tags_data->timestamp);
				EMIT_SIGNAL_TAGS (XP_TE_CTCPSNDC, chansess, word[5], nick, to, NULL, 0, tags_data);
			} else
			{
				EMIT_SIGNAL_TIMESTAMP (XP_TE_CTCPSND, sess->server->front_session,
											  word[5], nick, NULL, NULL, 0,
											  tags_data->timestamp);
				EMIT_SIGNAL_TAGS (XP_TE_CTCPSND, sess->server->front_session, word[5], nick,
						  NULL, NULL, 0, tags_data);
			}

			/* don't let IRCers specify path */


@@ 189,14 187,12 @@ generic:

	if (!is_channel (sess->server, to))
	{
		EMIT_SIGNAL_TIMESTAMP (XP_TE_CTCPGEN, sess->server->front_session, msg,
									  nick, NULL, NULL, 0, tags_data->timestamp);
		EMIT_SIGNAL_TAGS (XP_TE_CTCPGEN, sess->server->front_session, msg, nick, NULL, NULL, 0, tags_data);
	} else
	{
		chansess = find_channel (sess->server, to);
		if (!chansess)
			chansess = sess;
		EMIT_SIGNAL_TIMESTAMP (XP_TE_CTCPGENC, chansess, msg, nick, to, NULL, 0,
									  tags_data->timestamp);
		EMIT_SIGNAL_TAGS (XP_TE_CTCPGENC, chansess, msg, nick, to, NULL, 0, tags_data);
	}
}

M src/common/dcc.c => src/common/dcc.c +4 -6
@@ 2604,9 2604,8 @@ handle_dcc (struct session *sess, char *nick, char *word[], char *word_eol[],
				dcc->serv->p_ctcp (dcc->serv, dcc->nick, tbuf);
			}
			sprintf (tbuf, "%" G_GUINT64_FORMAT, dcc->pos);
			EMIT_SIGNAL_TIMESTAMP (XP_TE_DCCRESUMEREQUEST, sess, nick,
										  file_part (dcc->file), tbuf, NULL, 0,
										  tags_data->timestamp);
			EMIT_SIGNAL_TAGS (XP_TE_DCCRESUMEREQUEST, sess, nick, file_part (dcc->file),
					  tbuf, NULL, 0, tags_data);
		}
		return;
	}


@@ 2676,9 2675,8 @@ handle_dcc (struct session *sess, char *nick, char *word[], char *word_eol[],

	} else
	{
		EMIT_SIGNAL_TIMESTAMP (XP_TE_DCCGENERICOFFER, sess->server->front_session,
									  word_eol[4] + 2, nick, NULL, NULL, 0,
									  tags_data->timestamp);
		EMIT_SIGNAL_TAGS (XP_TE_DCCGENERICOFFER, sess->server->front_session,
				  word_eol[4] + 2, nick, NULL, NULL, 0, tags_data);
	}
}


M src/common/fe.h => src/common/fe.h +2 -2
@@ 95,8 95,8 @@ void fe_text_clear (struct session *sess, int lines);
void fe_close_window (struct session *sess);
void fe_progressbar_start (struct session *sess);
void fe_progressbar_end (struct server *serv);
void fe_print_text (struct session *sess, char *text, time_t stamp,
					gboolean no_activity);
void fe_print_text (struct session *sess, char *text, unsigned char *msgid,
			time_t stamp, gboolean no_activity);
void fe_userlist_insert (struct session *sess, struct User *newuser, gboolean sel);
int fe_userlist_remove (struct session *sess, struct User *user);
void fe_userlist_rehash (struct session *sess, struct User *user);

M src/common/inbound.c => src/common/inbound.c +90 -150
@@ 139,8 139,7 @@ inbound_open_dialog (server *serv, char *from,

	sess = new_ircwindow (serv, from, SESS_DIALOG, 0);
	/* for playing sounds */
	EMIT_SIGNAL_TIMESTAMP (XP_TE_OPENDIALOG, sess, NULL, NULL, NULL, NULL, 0,
								  tags_data->timestamp);
	EMIT_SIGNAL_TAGS (XP_TE_OPENDIALOG, sess, NULL, NULL, NULL, NULL, 0, tags_data);

	return sess;
}


@@ 165,7 164,7 @@ inbound_make_idtext (server *serv, char *idtext, int max, int id)

void
inbound_privmsg (server *serv, char *from, char *to, char *ip, char *text, int id,
					  const message_tags_data *tags_data)
			const message_tags_data *tags_data)
{
	session *sess;
	struct User *user;


@@ 222,11 221,9 @@ inbound_privmsg (server *serv, char *from, char *to, char *ip, char *text, int i
	inbound_make_idtext (serv, idtext, sizeof (idtext), id);

	if (sess->type == SESS_DIALOG && !nodiag)
		EMIT_SIGNAL_TIMESTAMP (XP_TE_DPRIVMSG, sess, from, text, idtext, NULL, 0,
									  tags_data->timestamp);
		EMIT_SIGNAL_TAGS (XP_TE_DPRIVMSG, sess, from, text, idtext, NULL, 0, tags_data);
	else
		EMIT_SIGNAL_TIMESTAMP (XP_TE_PRIVMSG, sess, from, text, idtext, NULL, 0, 
									  tags_data->timestamp);
		EMIT_SIGNAL_TAGS (XP_TE_PRIVMSG, sess, from, text, idtext, NULL, 0, tags_data);
}

/* used for Alerts section. Masks can be separated by commas and spaces. */


@@ 339,7 336,7 @@ is_hilight (char *from, char *text, session *sess, server *serv)

void
inbound_action (session *sess, char *chan, char *from, char *ip, char *text,
					 int fromme, int id, const message_tags_data *tags_data)
		int fromme, int id, const message_tags_data *tags_data)
{
	session *def = sess;
	server *serv = sess->server;


@@ 351,40 348,37 @@ inbound_action (session *sess, char *chan, char *from, char *ip, char *text,
	if (g_ascii_strcasecmp(from, serv->nick) == 0)
		fromme = TRUE;

	if (TRUE)
	if (is_channel (serv, chan))
	{
		if (is_channel (serv, chan))
		{
			sess = find_channel (serv, chan);
		} else
		sess = find_channel (serv, chan);
	} else
	{
		/* it's a private action! */
		privaction = TRUE;
		/* find a dialog tab for it */
		if (fromme)
			sess = find_dialog (serv, chan);
		else
			sess = find_dialog (serv, from);
		/* if non found, open a new one */
		if (!sess && prefs.hex_gui_autoopen_dialog)
		{
			/* it's a private action! */
			privaction = TRUE;
			/* find a dialog tab for it */
			if (fromme)
				sess = find_dialog (serv, chan);
			else
				sess = find_dialog (serv, from);
			/* if non found, open a new one */
			if (!sess && prefs.hex_gui_autoopen_dialog)
			/* but only if it wouldn't flood */
			if (flood_check (from, ip, serv, current_sess, 1))
			{
				/* but only if it wouldn't flood */
				if (flood_check (from, ip, serv, current_sess, 1))
				{
					if (fromme)
						sess = inbound_open_dialog (serv, chan, tags_data);
					else
						sess = inbound_open_dialog (serv, from, tags_data);
				} else
					sess = serv->server_session;
			}
				if (fromme)
					sess = inbound_open_dialog (serv, chan, tags_data);
				else
					sess = inbound_open_dialog (serv, from, tags_data);
			} else
				sess = serv->server_session;
		}
		if (!sess)
		{
			sess = find_session_from_nick (from, serv);
			/* still not good? */
			if (!sess)
			{
				sess = find_session_from_nick (from, serv);
				/* still not good? */
				if (!sess)
					sess = serv->front_session;
			}
				sess = serv->front_session;
		}
	}



@@ 417,30 411,25 @@ inbound_action (session *sess, char *chan, char *from, char *ip, char *text,
	{
		if (is_hilight (from, text, sess, serv))
		{
			EMIT_SIGNAL_TIMESTAMP (XP_TE_HCHANACTION, sess, from, text, nickchar,
										  idtext, 0, tags_data->timestamp);
			EMIT_SIGNAL_TAGS (XP_TE_HCHANACTION, sess, from, text, nickchar, idtext, 0, tags_data);
			return;
		}
	}

	if (fromme)
		EMIT_SIGNAL_TIMESTAMP (XP_TE_UACTION, sess, from, text, nickchar, idtext,
									  0, tags_data->timestamp);
		EMIT_SIGNAL_TAGS (XP_TE_UACTION, sess, from, text, nickchar, idtext, 0, tags_data);
	else if (!privaction)
		EMIT_SIGNAL_TIMESTAMP (XP_TE_CHANACTION, sess, from, text, nickchar,
									  idtext, 0, tags_data->timestamp);
		EMIT_SIGNAL_TAGS (XP_TE_CHANACTION, sess, from, text, nickchar, idtext, 0, tags_data);
	else if (sess->type == SESS_DIALOG)
		EMIT_SIGNAL_TIMESTAMP (XP_TE_DPRIVACTION, sess, from, text, idtext, NULL,
									  0, tags_data->timestamp);
		EMIT_SIGNAL_TAGS (XP_TE_DPRIVACTION, sess, from, text, idtext, NULL, 0, tags_data);
	else
		EMIT_SIGNAL_TIMESTAMP (XP_TE_PRIVACTION, sess, from, text, idtext, NULL, 0,
									  tags_data->timestamp);
		EMIT_SIGNAL_TAGS (XP_TE_PRIVACTION, sess, from, text, idtext, NULL, 0, tags_data);
}

void
inbound_chanmsg (server *serv, session *sess, char *chan, char *from, 
					  char *text, char fromme, int id, 
					  const message_tags_data *tags_data)
			char *text, char fromme, int id, 
			const message_tags_data *tags_data)
{
	struct User *user;
	int hilight = FALSE;


@@ 483,8 472,7 @@ inbound_chanmsg (server *serv, session *sess, char *chan, char *from,
	{
		if (prefs.hex_away_auto_unmark && serv->is_away && !tags_data->timestamp)
			sess->server->p_set_back (sess->server);
		EMIT_SIGNAL_TIMESTAMP (XP_TE_UCHANMSG, sess, from, text, nickchar, NULL,
									  0, tags_data->timestamp);
		EMIT_SIGNAL_TAGS (XP_TE_UCHANMSG, sess, from, text, nickchar, NULL, 0, tags_data);
		return;
	}



@@ 494,14 482,11 @@ inbound_chanmsg (server *serv, session *sess, char *chan, char *from,
		hilight = TRUE;

	if (sess->type == SESS_DIALOG)
		EMIT_SIGNAL_TIMESTAMP (XP_TE_DPRIVMSG, sess, from, text, idtext, NULL, 0,
									  tags_data->timestamp);
		EMIT_SIGNAL_TAGS (XP_TE_DPRIVMSG, sess, from, text, idtext, NULL, 0, tags_data);
	else if (hilight)
		EMIT_SIGNAL_TIMESTAMP (XP_TE_HCHANMSG, sess, from, text, nickchar, idtext,
									  0, tags_data->timestamp);
		EMIT_SIGNAL_TAGS (XP_TE_HCHANMSG, sess, from, text, nickchar, idtext, 0, tags_data);
	else
		EMIT_SIGNAL_TIMESTAMP (XP_TE_CHANMSG, sess, from, text, nickchar, idtext,
									  0, tags_data->timestamp);
		EMIT_SIGNAL_TAGS (XP_TE_CHANMSG, sess, from, text, nickchar, idtext, 0, tags_data);
}

void


@@ 528,12 513,9 @@ inbound_newnick (server *serv, char *nick, char *newnick, int quiet,
				if (!quiet)
				{
					if (me)
						EMIT_SIGNAL_TIMESTAMP (XP_TE_UCHANGENICK, sess, nick, 
													  newnick, NULL, NULL, 0,
													  tags_data->timestamp);
						EMIT_SIGNAL_TAGS (XP_TE_UCHANGENICK, sess, nick, newnick, NULL, NULL, 0, tags_data);
					else
						EMIT_SIGNAL_TIMESTAMP (XP_TE_CHANGENICK, sess, nick,
													  newnick, NULL, NULL, 0, tags_data->timestamp);
						EMIT_SIGNAL_TAGS (XP_TE_CHANGENICK, sess, nick, newnick, NULL, NULL, 0, tags_data);
				}
			}
			if (sess->type == SESS_DIALOG && !serv->p_cmp (sess->channel, nick))


@@ 639,8 621,7 @@ inbound_ujoin (server *serv, char *chan, char *nick, char *ip,
	/* sends a MODE */
	serv->p_join_info (sess->server, chan);

	EMIT_SIGNAL_TIMESTAMP (XP_TE_UJOIN, sess, nick, chan, ip, NULL, 0,
								  tags_data->timestamp);
	EMIT_SIGNAL_TAGS (XP_TE_UJOIN, sess, nick, chan, ip, NULL, 0, tags_data);

	if (prefs.hex_irc_who_join)
	{


@@ 657,8 638,7 @@ inbound_ukick (server *serv, char *chan, char *kicker, char *reason,
	session *sess = find_channel (serv, chan);
	if (sess)
	{
		EMIT_SIGNAL_TIMESTAMP (XP_TE_UKICK, sess, serv->nick, chan, kicker, 
									  reason, 0, tags_data->timestamp);
		EMIT_SIGNAL_TAGS (XP_TE_UKICK, sess, serv->nick, chan, kicker, reason, 0, tags_data);
		clear_channel (sess);
		if (prefs.hex_irc_auto_rejoin)
		{


@@ 676,11 656,9 @@ inbound_upart (server *serv, char *chan, char *ip, char *reason,
	if (sess)
	{
		if (*reason)
			EMIT_SIGNAL_TIMESTAMP (XP_TE_UPARTREASON, sess, serv->nick, ip, chan,
										  reason, 0, tags_data->timestamp);
			EMIT_SIGNAL_TAGS (XP_TE_UPARTREASON, sess, serv->nick, ip, chan, reason, 0, tags_data);
		else
			EMIT_SIGNAL_TIMESTAMP (XP_TE_UPART, sess, serv->nick, ip, chan, NULL,
										  0, tags_data->timestamp);
			EMIT_SIGNAL_TAGS (XP_TE_UPART, sess, serv->nick, ip, chan, NULL, 0, tags_data);
		clear_channel (sess);
	}
}


@@ 699,13 677,11 @@ inbound_nameslist (server *serv, char *chan, char *names,
	sess = find_channel (serv, chan);
	if (!sess)
	{
		EMIT_SIGNAL_TIMESTAMP (XP_TE_USERSONCHAN, serv->server_session, chan,
									  names, NULL, NULL, 0, tags_data->timestamp);
		EMIT_SIGNAL_TAGS (XP_TE_USERSONCHAN, serv->server_session, chan, names, NULL, NULL, 0, tags_data);
		return;
	}
	if (!sess->ignore_names)
		EMIT_SIGNAL_TIMESTAMP (XP_TE_USERSONCHAN, sess, chan, names, NULL, NULL,
									  0, tags_data->timestamp);
		EMIT_SIGNAL_TAGS (XP_TE_USERSONCHAN, sess, chan, names, NULL, NULL, 0, tags_data);

	if (sess->end_of_names)
	{


@@ 761,8 737,7 @@ inbound_topic (server *serv, char *chan, char *topic_text,
	} else
		sess = serv->server_session;

	EMIT_SIGNAL_TIMESTAMP (XP_TE_TOPIC, sess, chan, topic_text, NULL, NULL, 0,
								  tags_data->timestamp);
	EMIT_SIGNAL_TAGS (XP_TE_TOPIC, sess, chan, topic_text, NULL, NULL, 0, tags_data);
}

void


@@ 775,8 750,7 @@ inbound_topicnew (server *serv, char *nick, char *chan, char *topic,
	sess = find_channel (serv, chan);
	if (sess)
	{
		EMIT_SIGNAL_TIMESTAMP (XP_TE_NEWTOPIC, sess, nick, topic, chan, NULL, 0,
									  tags_data->timestamp);
		EMIT_SIGNAL_TAGS (XP_TE_NEWTOPIC, sess, nick, topic, chan, NULL, 0, tags_data);
		stripped_topic = strip_color (topic, -1, STRIP_ALL);
		set_topic (sess, topic, stripped_topic);
		g_free (stripped_topic);


@@ 790,8 764,7 @@ inbound_join (server *serv, char *chan, char *user, char *ip, char *account,
	session *sess = find_channel (serv, chan);
	if (sess)
	{
		EMIT_SIGNAL_TIMESTAMP (XP_TE_JOIN, sess, user, chan, ip, account, 0,
									  tags_data->timestamp);
		EMIT_SIGNAL_TAGS (XP_TE_JOIN, sess, user, chan, ip, account, 0, tags_data);
		userlist_add (sess, user, ip, account, realname, tags_data);
	}
}


@@ 803,8 776,7 @@ inbound_kick (server *serv, char *chan, char *user, char *kicker, char *reason,
	session *sess = find_channel (serv, chan);
	if (sess)
	{
		EMIT_SIGNAL_TIMESTAMP (XP_TE_KICK, sess, kicker, user, chan, reason, 0,
									  tags_data->timestamp);
		EMIT_SIGNAL_TAGS (XP_TE_KICK, sess, kicker, user, chan, reason, 0, tags_data);
		userlist_remove (sess, user);
	}
}


@@ 817,11 789,9 @@ inbound_part (server *serv, char *chan, char *user, char *ip, char *reason,
	if (sess)
	{
		if (*reason)
			EMIT_SIGNAL_TIMESTAMP (XP_TE_PARTREASON, sess, user, ip, chan, reason,
										  0, tags_data->timestamp);
			EMIT_SIGNAL_TAGS (XP_TE_PARTREASON, sess, user, ip, chan, reason, 0, tags_data);
		else
			EMIT_SIGNAL_TIMESTAMP (XP_TE_PART, sess, user, ip, chan, NULL, 0,
										  tags_data->timestamp);
			EMIT_SIGNAL_TAGS (XP_TE_PART, sess, user, ip, chan, NULL, 0, tags_data);
		userlist_remove (sess, user);
	}
}


@@ 839,8 809,7 @@ inbound_topictime (server *serv, char *chan, char *nick, time_t stamp,
	if (tim != NULL)
		tim[24] = 0;	/* get rid of the \n */

	EMIT_SIGNAL_TIMESTAMP (XP_TE_TOPICDATE, sess, chan, nick, tim, NULL, 0,
								  tags_data->timestamp);
	EMIT_SIGNAL_TAGS (XP_TE_TOPICDATE, sess, chan, nick, tim, NULL, 0, tags_data);
}

void


@@ 861,13 830,11 @@ inbound_quit (server *serv, char *nick, char *ip, char *reason,
 				was_on_front_session = TRUE;
			if ((user = userlist_find (sess, nick)))
			{
				EMIT_SIGNAL_TIMESTAMP (XP_TE_QUIT, sess, nick, reason, ip, NULL, 0,
											  tags_data->timestamp);
				EMIT_SIGNAL_TAGS (XP_TE_QUIT, sess, nick, reason, ip, NULL, 0, tags_data);
				userlist_remove_user (sess, user);
			} else if (sess->type == SESS_DIALOG && !serv->p_cmp (sess->channel, nick))
			{
				EMIT_SIGNAL_TIMESTAMP (XP_TE_QUIT, sess, nick, reason, ip, NULL, 0,
											  tags_data->timestamp);
				EMIT_SIGNAL_TAGS (XP_TE_QUIT, sess, nick, reason, ip, NULL, 0, tags_data);
			}
		}
		list = list->next;


@@ 926,13 893,11 @@ inbound_ping_reply (session *sess, char *timestring, char *from,
		if (sess->server->lag_sent)
			sess->server->lag_sent = 0;
		else
			EMIT_SIGNAL_TIMESTAMP (XP_TE_PINGREP, sess, from, "?", NULL, NULL, 0,
										  tags_data->timestamp);
			EMIT_SIGNAL_TAGS (XP_TE_PINGREP, sess, from, "?", NULL, NULL, 0, tags_data);
	} else
	{
		g_snprintf (outbuf, sizeof (outbuf), "%ld.%03ld", dif / 1000, dif % 1000);
		EMIT_SIGNAL_TIMESTAMP (XP_TE_PINGREP, sess, from, outbuf, NULL, NULL, 0,
									  tags_data->timestamp);
		EMIT_SIGNAL_TAGS (XP_TE_PINGREP, sess, from, outbuf, NULL, NULL, 0, tags_data);
	}
}



@@ 953,7 918,7 @@ find_session_from_type (int type, server *serv)

void
inbound_notice (server *serv, char *to, char *nick, char *msg, char *ip, int id,
					 const message_tags_data *tags_data)
		const message_tags_data *tags_data)
{
	char *ptr = to;
	session *sess = 0;


@@ 1045,19 1010,15 @@ inbound_notice (server *serv, char *to, char *nick, char *msg, char *ip, int id,
	}

	if (server_notice)
		EMIT_SIGNAL_TIMESTAMP (XP_TE_SERVNOTICE, sess, msg, nick, NULL, NULL, 0,
									  tags_data->timestamp);
		EMIT_SIGNAL_TAGS (XP_TE_SERVNOTICE, sess, msg, nick, NULL, NULL, 0, tags_data);
	else if (ptr)
		EMIT_SIGNAL_TIMESTAMP (XP_TE_CHANNOTICE, sess, nick, to, msg, NULL, 0,
									  tags_data->timestamp);
		EMIT_SIGNAL_TAGS (XP_TE_CHANNOTICE, sess, nick, to, msg, NULL, 0, tags_data);
	else
		EMIT_SIGNAL_TIMESTAMP (XP_TE_NOTICE, sess, nick, msg, NULL, NULL, 0,
									  tags_data->timestamp);
		EMIT_SIGNAL_TAGS (XP_TE_NOTICE, sess, nick, msg, NULL, NULL, 0, tags_data);
}

void
inbound_away (server *serv, char *nick, char *msg,
				  const message_tags_data *tags_data)
inbound_away (server *serv, char *nick, char *msg, const message_tags_data *tags_data)
{
	struct away_msg *away = server_away_find_message (serv, nick);
	session *sess = NULL;


@@ 1084,8 1045,7 @@ inbound_away (server *serv, char *nick, char *msg,

	/* possibly hide the output */
	if (!serv->inside_whois || !serv->skip_next_whois)
		EMIT_SIGNAL_TIMESTAMP (XP_TE_WHOIS5, sess, nick, msg, NULL, NULL, 0,
									  tags_data->timestamp);
		EMIT_SIGNAL_TAGS (XP_TE_WHOIS5, sess, nick, msg, NULL, NULL, 0, tags_data);

	list = sess_list;
	while (list)


@@ 1098,8 1058,7 @@ inbound_away (server *serv, char *nick, char *msg,
}

void
inbound_away_notify (server *serv, char *nick, char *reason,
							const message_tags_data *tags_data)
inbound_away_notify (server *serv, char *nick, char *reason, const message_tags_data *tags_data)
{
	session *sess = NULL;
	GSList *list;


@@ 1114,11 1073,9 @@ inbound_away_notify (server *serv, char *nick, char *reason,
			if (sess == serv->front_session && notify_is_in_list (serv, nick))
			{
				if (reason)
					EMIT_SIGNAL_TIMESTAMP (XP_TE_NOTIFYAWAY, sess, nick, reason, NULL,
												  NULL, 0, tags_data->timestamp);
					EMIT_SIGNAL_TAGS (XP_TE_NOTIFYAWAY, sess, nick, reason, NULL, NULL, 0, tags_data);
				else
					EMIT_SIGNAL_TIMESTAMP (XP_TE_NOTIFYBACK, sess, nick, NULL, NULL, 
												  NULL, 0, tags_data->timestamp);
					EMIT_SIGNAL_TAGS (XP_TE_NOTIFYBACK, sess, nick, NULL, NULL, NULL, 0, tags_data);
			}
		}
		list = list->next;


@@ 1126,8 1083,7 @@ inbound_away_notify (server *serv, char *nick, char *reason,
}

int
inbound_nameslist_end (server *serv, char *chan,
							  const message_tags_data *tags_data)
inbound_nameslist_end (server *serv, char *chan, const message_tags_data *tags_data)
{
	session *sess;
	GSList *list;


@@ 1260,13 1216,11 @@ inbound_next_nick (session *sess, char *nick, int error,
		serv->p_change_nick (serv, newnick);
		if (error)
		{
			EMIT_SIGNAL_TIMESTAMP (XP_TE_NICKERROR, sess, nick, newnick, NULL, NULL,
										  0, tags_data->timestamp);
			EMIT_SIGNAL_TAGS (XP_TE_NICKERROR, sess, nick, newnick, NULL, NULL, 0, tags_data);
		}
		else
		{
			EMIT_SIGNAL_TIMESTAMP (XP_TE_NICKCLASH, sess, nick, newnick, NULL, NULL,
										  0, tags_data->timestamp);
			EMIT_SIGNAL_TAGS (XP_TE_NICKCLASH, sess, nick, newnick, NULL, NULL, 0, tags_data);
		}
		break;



@@ 1274,19 1228,16 @@ inbound_next_nick (session *sess, char *nick, int error,
		serv->p_change_nick (serv, prefs.hex_irc_nick3);
		if (error)
		{
			EMIT_SIGNAL_TIMESTAMP (XP_TE_NICKERROR, sess, nick, prefs.hex_irc_nick3,
										  NULL, NULL, 0, tags_data->timestamp);
			EMIT_SIGNAL_TAGS (XP_TE_NICKERROR, sess, nick, prefs.hex_irc_nick3, NULL, NULL, 0, tags_data);
		}
		else
		{
			EMIT_SIGNAL_TIMESTAMP (XP_TE_NICKCLASH, sess, nick, prefs.hex_irc_nick3,
										  NULL, NULL, 0, tags_data->timestamp);
			EMIT_SIGNAL_TAGS (XP_TE_NICKCLASH, sess, nick, prefs.hex_irc_nick3, NULL, NULL, 0, tags_data);
		}
		break;

	default:
		EMIT_SIGNAL_TIMESTAMP (XP_TE_NICKFAIL, sess, NULL, NULL, NULL, NULL, 0,
									  tags_data->timestamp);
		EMIT_SIGNAL_TAGS (XP_TE_NICKFAIL, sess, NULL, NULL, NULL, NULL, 0, tags_data);
	}
}



@@ 1348,8 1299,7 @@ do_dns (session *sess, char *nick, char *host,
		host = po + 1;

	if (nick)
		EMIT_SIGNAL_TIMESTAMP (XP_TE_RESOLVINGUSER, sess, nick, host, NULL, NULL, 0,
								tags_data->timestamp);
		EMIT_SIGNAL_TAGS (XP_TE_RESOLVINGUSER, sess, nick, host, NULL, NULL, 0, tags_data);

	PrintTextf (sess, _("Looking up %s..."), host);



@@ 1444,9 1394,9 @@ inbound_foundip (session *sess, char *ip, const message_tags_data *tags_data)
	if (HostAddr)
	{
		sess->server->dcc_ip = ((struct in_addr *) HostAddr->h_addr)->s_addr;
		EMIT_SIGNAL_TIMESTAMP (XP_TE_FOUNDIP, sess->server->server_session,
									  inet_ntoa (*((struct in_addr *) HostAddr->h_addr)),
									  NULL, NULL, NULL, 0, tags_data->timestamp);
		EMIT_SIGNAL_TAGS (XP_TE_FOUNDIP, sess->server->server_session,
					inet_ntoa (*((struct in_addr *) HostAddr->h_addr)),
					NULL, NULL, NULL, 0, tags_data);
	}
}



@@ 1540,8 1490,7 @@ inbound_banlist (session *sess, time_t stamp, char *chan, char *mask,
	{
nowindow:

		EMIT_SIGNAL_TIMESTAMP (XP_TE_BANLIST, sess, chan, mask, banner, time_str,
									  0, tags_data->timestamp);
		EMIT_SIGNAL_TAGS (XP_TE_BANLIST, sess, chan, mask, banner, time_str, 0, tags_data);
		return TRUE;
	}



@@ 1644,13 1593,11 @@ inbound_login_end (session *sess, char *text, const message_tags_data *tags_data
	if (prefs.hex_irc_skip_motd && !serv->motd_skipped)
	{
		serv->motd_skipped = TRUE;
		EMIT_SIGNAL_TIMESTAMP (XP_TE_MOTDSKIP, serv->server_session, NULL, NULL,
									  NULL, NULL, 0, tags_data->timestamp);
		EMIT_SIGNAL_TAGS (XP_TE_MOTDSKIP, serv->server_session, NULL, NULL, NULL, NULL, 0, tags_data);
		return;
	}

	EMIT_SIGNAL_TIMESTAMP (XP_TE_MOTD, serv->server_session, text, NULL, NULL,
								  NULL, 0, tags_data->timestamp);
	EMIT_SIGNAL_TAGS (XP_TE_MOTD, serv->server_session, text, NULL, NULL, NULL, 0, tags_data);
}

void


@@ 1736,8 1683,7 @@ void
inbound_cap_ack (server *serv, char *nick, char *extensions,
					  const message_tags_data *tags_data)
{
	EMIT_SIGNAL_TIMESTAMP (XP_TE_CAPACK, serv->server_session, nick, extensions,
								  NULL, NULL, 0, tags_data->timestamp);
	EMIT_SIGNAL_TAGS (XP_TE_CAPACK, serv->server_session, nick, extensions, NULL, NULL, 0, tags_data);

	inbound_toggle_caps (serv, extensions, TRUE);
}


@@ 1746,8 1692,7 @@ void
inbound_cap_del (server *serv, char *nick, char *extensions,
					 const message_tags_data *tags_data)
{
	EMIT_SIGNAL_TIMESTAMP (XP_TE_CAPDEL, serv->server_session, nick, extensions,
								  NULL, NULL, 0, tags_data->timestamp);
	EMIT_SIGNAL_TAGS (XP_TE_CAPDEL, serv->server_session, nick, extensions, NULL, NULL, 0, tags_data);

	inbound_toggle_caps (serv, extensions, FALSE);
}


@@ 1858,8 1803,7 @@ inbound_cap_ls (server *serv, char *nick, char *extensions_str,
		serv->waiting_on_cap = FALSE;
	}

	EMIT_SIGNAL_TIMESTAMP (XP_TE_CAPLIST, serv->server_session, nick,
								  extensions_str, NULL, NULL, 0, tags_data->timestamp);
	EMIT_SIGNAL_TAGS (XP_TE_CAPLIST, serv->server_session, nick, extensions_str, NULL, NULL, 0, tags_data);

	extensions = g_strsplit (extensions_str, " ", 0);



@@ 1916,9 1860,7 @@ inbound_cap_ls (server *serv, char *nick, char *extensions_str,
	if (want_cap)
	{
		/* buffer + 9 = emit buffer without "CAP REQ :" */
		EMIT_SIGNAL_TIMESTAMP (XP_TE_CAPREQ, serv->server_session,
									  buffer + 9, NULL, NULL, NULL, 0,
									  tags_data->timestamp);
		EMIT_SIGNAL_TAGS (XP_TE_CAPREQ, serv->server_session, buffer + 9, NULL, NULL, NULL, 0, tags_data);
		tcp_sendf (serv, "%s\r\n", g_strchomp (buffer));
	}
	if (!serv->waiting_on_sasl && !serv->waiting_on_cap)


@@ 1960,8 1902,7 @@ inbound_cap_list (server *serv, char *nick, char *extensions,
		extensions += 2;
		extensions += extensions[0] == ':' ? 1 : 0;
	}
	EMIT_SIGNAL_TIMESTAMP (XP_TE_CAPACK, serv->server_session, nick, extensions,
								  NULL, NULL, 0, tags_data->timestamp);
	EMIT_SIGNAL_TAGS (XP_TE_CAPACK, serv->server_session, nick, extensions, NULL, NULL, 0, tags_data);
}

static void


@@ 2094,8 2035,7 @@ inbound_sasl_authenticate (server *serv, char *data)
#endif
		}

		EMIT_SIGNAL_TIMESTAMP (XP_TE_SASLAUTH, serv->server_session, user, (char*)mech,
								NULL,	NULL,	0,	0);
		EMIT_SIGNAL (XP_TE_SASLAUTH, serv->server_session, user, (char*)mech, NULL, NULL, 0);
}

void

M src/common/modes.c => src/common/modes.c +22 -43
@@ 445,16 445,14 @@ handle_single_mode (mode_run *mr, char sign, char mode, char *nick,
			fe_update_channel_key (sess);
			fe_update_mode_buttons (sess, mode, sign);
			if (!quiet)
				EMIT_SIGNAL_TIMESTAMP (XP_TE_CHANSETKEY, sess, nick, arg, NULL,
											  NULL, 0, tags_data->timestamp);
				EMIT_SIGNAL_TAGS (XP_TE_CHANSETKEY, sess, nick, arg, NULL, NULL, 0, tags_data);
			return;
		case 'l':
			sess->limit = atoi (arg);
			fe_update_channel_limit (sess);
			fe_update_mode_buttons (sess, mode, sign);
			if (!quiet)
				EMIT_SIGNAL_TIMESTAMP (XP_TE_CHANSETLIMIT, sess, nick, arg, NULL,
											  NULL, 0, tags_data->timestamp);
				EMIT_SIGNAL_TAGS (XP_TE_CHANSETLIMIT, sess, nick, arg, NULL, NULL, 0, tags_data);
			return;
		case 'o':
			if (!quiet)


@@ 462,8 460,7 @@ handle_single_mode (mode_run *mr, char sign, char mode, char *nick,
			return;
		case 'h':
			if (!quiet)
				EMIT_SIGNAL_TIMESTAMP (XP_TE_CHANHOP, sess, nick, arg, NULL, NULL,
											  0, tags_data->timestamp);
				EMIT_SIGNAL_TAGS (XP_TE_CHANHOP, sess, nick, arg, NULL, NULL, 0, tags_data);
			return;
		case 'v':
			if (!quiet)


@@ 471,25 468,21 @@ handle_single_mode (mode_run *mr, char sign, char mode, char *nick,
			return;
		case 'b':
			if (!quiet)
				EMIT_SIGNAL_TIMESTAMP (XP_TE_CHANBAN, sess, nick, arg, NULL, NULL,
											  0, tags_data->timestamp);
				EMIT_SIGNAL_TAGS (XP_TE_CHANBAN, sess, nick, arg, NULL, NULL, 0, tags_data);
			return;
		case 'e':
			if (!quiet)
				EMIT_SIGNAL_TIMESTAMP (XP_TE_CHANEXEMPT, sess, nick, arg, NULL,
											  NULL, 0, tags_data->timestamp);
				EMIT_SIGNAL_TAGS (XP_TE_CHANEXEMPT, sess, nick, arg, NULL, NULL, 0, tags_data);
			return;
		case 'I':
			if (!quiet)
				EMIT_SIGNAL_TIMESTAMP (XP_TE_CHANINVITE, sess, nick, arg, NULL, NULL,
											  0, tags_data->timestamp);
				EMIT_SIGNAL_TAGS (XP_TE_CHANINVITE, sess, nick, arg, NULL, NULL, 0, tags_data);
			return;
		case 'q':
			if (!supportsq)
				break; /* +q is owner on this server */
			if (!quiet)
				EMIT_SIGNAL_TIMESTAMP (XP_TE_CHANQUIET, sess, nick, arg, NULL, NULL, 0,
								 tags_data->timestamp);
				EMIT_SIGNAL_TAGS (XP_TE_CHANQUIET, sess, nick, arg, NULL, NULL, 0, tags_data);
			return;
		}
		break;


@@ 501,16 494,14 @@ handle_single_mode (mode_run *mr, char sign, char mode, char *nick,
			fe_update_channel_key (sess);
			fe_update_mode_buttons (sess, mode, sign);
			if (!quiet)
				EMIT_SIGNAL_TIMESTAMP (XP_TE_CHANRMKEY, sess, nick, NULL, NULL,
											  NULL, 0, tags_data->timestamp);
				EMIT_SIGNAL_TAGS (XP_TE_CHANRMKEY, sess, nick, NULL, NULL, NULL, 0, tags_data);
			return;
		case 'l':
			sess->limit = 0;
			fe_update_channel_limit (sess);
			fe_update_mode_buttons (sess, mode, sign);
			if (!quiet)
				EMIT_SIGNAL_TIMESTAMP (XP_TE_CHANRMLIMIT, sess, nick, NULL, NULL,
											  NULL, 0, tags_data->timestamp);
				EMIT_SIGNAL_TAGS (XP_TE_CHANRMLIMIT, sess, nick, NULL, NULL, NULL, 0, tags_data);
			return;
		case 'o':
			if (!quiet)


@@ 518,8 509,7 @@ handle_single_mode (mode_run *mr, char sign, char mode, char *nick,
			return;
		case 'h':
			if (!quiet)
				EMIT_SIGNAL_TIMESTAMP (XP_TE_CHANDEHOP, sess, nick, arg, NULL,
											  NULL, 0, tags_data->timestamp);
				EMIT_SIGNAL_TAGS (XP_TE_CHANDEHOP, sess, nick, arg, NULL, NULL, 0, tags_data);
			return;
		case 'v':
			if (!quiet)


@@ 527,25 517,21 @@ handle_single_mode (mode_run *mr, char sign, char mode, char *nick,
			return;
		case 'b':
			if (!quiet)
				EMIT_SIGNAL_TIMESTAMP (XP_TE_CHANUNBAN, sess, nick, arg, NULL, NULL,
											  0, tags_data->timestamp);
				EMIT_SIGNAL_TAGS (XP_TE_CHANUNBAN, sess, nick, arg, NULL, NULL, 0, tags_data);
			return;
		case 'e':
			if (!quiet)
				EMIT_SIGNAL_TIMESTAMP (XP_TE_CHANRMEXEMPT, sess, nick, arg, NULL,
											  NULL, 0, tags_data->timestamp);
				EMIT_SIGNAL_TAGS (XP_TE_CHANRMEXEMPT, sess, nick, arg, NULL, NULL, 0, tags_data);
			return;
		case 'I':
			if (!quiet)
				EMIT_SIGNAL_TIMESTAMP (XP_TE_CHANRMINVITE, sess, nick, arg, NULL,
											  NULL, 0, tags_data->timestamp);
				EMIT_SIGNAL_TAGS (XP_TE_CHANRMINVITE, sess, nick, arg, NULL, NULL, 0, tags_data);
			return;
		case 'q':
			if (!supportsq)
				break; /* -q is owner on this server */
			if (!quiet)
				EMIT_SIGNAL_TIMESTAMP (XP_TE_CHANUNQUIET, sess, nick, arg, NULL,
											  NULL, 0, tags_data->timestamp);
				EMIT_SIGNAL_TAGS (XP_TE_CHANUNQUIET, sess, nick, arg, NULL, NULL, 0, tags_data);
			return;
		}
	}


@@ 562,13 548,11 @@ handle_single_mode (mode_run *mr, char sign, char mode, char *nick,
		if (*arg)
		{
			char *buf = g_strdup_printf ("%s %s", chan, arg);
			EMIT_SIGNAL_TIMESTAMP (XP_TE_CHANMODEGEN, sess, nick, outbuf,
										  outbuf + 2, buf, 0, tags_data->timestamp);
			EMIT_SIGNAL_TAGS (XP_TE_CHANMODEGEN, sess, nick, outbuf, outbuf + 2, buf, 0, tags_data);
			g_free (buf);
		}
		else
			EMIT_SIGNAL_TIMESTAMP (XP_TE_CHANMODEGEN, sess, nick, outbuf,
										  outbuf + 2, chan, 0, tags_data->timestamp);
			EMIT_SIGNAL_TAGS (XP_TE_CHANMODEGEN, sess, nick, outbuf, outbuf + 2, chan, 0, tags_data);
	}
}



@@ 634,32 618,28 @@ mode_print_grouped (session *sess, char *nick, mode_run *mr,
	/* print all the grouped Op/Deops */
	if (mr->op)
	{
		EMIT_SIGNAL_TIMESTAMP (XP_TE_CHANOP, sess, nick, mr->op, NULL, NULL, 0,
									  tags_data->timestamp);
		EMIT_SIGNAL_TAGS (XP_TE_CHANOP, sess, nick, mr->op, NULL, NULL, 0, tags_data);
		g_free(mr->op);
		mr->op = NULL;
	}

	if (mr->deop)
	{
		EMIT_SIGNAL_TIMESTAMP (XP_TE_CHANDEOP, sess, nick, mr->deop, NULL, NULL,
									  0, tags_data->timestamp);
		EMIT_SIGNAL_TAGS (XP_TE_CHANDEOP, sess, nick, mr->deop, NULL, NULL, 0, tags_data);
		g_free(mr->deop);
		mr->deop = NULL;
	}

	if (mr->voice)
	{
		EMIT_SIGNAL_TIMESTAMP (XP_TE_CHANVOICE, sess, nick, mr->voice, NULL, NULL,
									  0, tags_data->timestamp);
		EMIT_SIGNAL_TAGS (XP_TE_CHANVOICE, sess, nick, mr->voice, NULL, NULL, 0, tags_data);
		g_free(mr->voice);
		mr->voice = NULL;
	}

	if (mr->devoice)
	{
		EMIT_SIGNAL_TIMESTAMP (XP_TE_CHANDEVOICE, sess, nick, mr->devoice, NULL,
									  NULL, 0, tags_data->timestamp);
		EMIT_SIGNAL_TAGS (XP_TE_CHANDEVOICE, sess, nick, mr->devoice, NULL, NULL, 0, tags_data);
		g_free(mr->devoice);
		mr->devoice = NULL;
	}


@@ 670,7 650,7 @@ mode_print_grouped (session *sess, char *nick, mode_run *mr,

void
handle_mode (server * serv, char *word[], char *word_eol[],
				 char *nick, int numeric_324, const message_tags_data *tags_data)
		char *nick, int numeric_324, const message_tags_data *tags_data)
{
	session *sess;
	char *chan;


@@ 713,8 693,7 @@ handle_mode (server * serv, char *word[], char *word_eol[],
		word_eol[offset][len] = 0;

	if (prefs.hex_irc_raw_modes && !numeric_324)
		EMIT_SIGNAL_TIMESTAMP (XP_TE_RAWMODES, sess, nick, word_eol[offset], 0, 0, 0,
									  tags_data->timestamp);
		EMIT_SIGNAL_TAGS (XP_TE_RAWMODES, sess, nick, word_eol[offset], 0, 0, 0, tags_data);

	if (numeric_324 && !using_front_tab)
	{

M src/common/notify.c => src/common/notify.c +8 -13
@@ 216,9 216,8 @@ notify_announce_offline (server * serv, struct notify_per_server *servnot,
	servnot->ison = FALSE;
	servnot->lastoff = time (0);
	if (!quiet)
		EMIT_SIGNAL_TIMESTAMP (XP_TE_NOTIFYOFFLINE, sess, nick, serv->servername,
									  server_get_network (serv, TRUE), NULL, 0,
									  tags_data->timestamp);
		EMIT_SIGNAL_TAGS (XP_TE_NOTIFYOFFLINE, sess, nick, serv->servername,
				  server_get_network (serv, TRUE), NULL, 0, tags_data);
	fe_notify_update (nick);
	fe_notify_update (0);
}


@@ 237,9 236,8 @@ notify_announce_online (server * serv, struct notify_per_server *servnot,

	servnot->ison = TRUE;
	servnot->laston = time (0);
	EMIT_SIGNAL_TIMESTAMP (XP_TE_NOTIFYONLINE, sess, nick, serv->servername,
					 server_get_network (serv, TRUE), NULL, 0,
					 tags_data->timestamp);
	EMIT_SIGNAL_TAGS (XP_TE_NOTIFYONLINE, sess, nick, serv->servername,
			  server_get_network (serv, TRUE), NULL, 0, tags_data);
	fe_notify_update (nick);
	fe_notify_update (0);



@@ 553,8 551,7 @@ notify_showlist (struct session *sess, const message_tags_data *tags_data)
	struct notify_per_server *servnot;
	int i = 0;

	EMIT_SIGNAL_TIMESTAMP (XP_TE_NOTIFYHEAD, sess, NULL, NULL, NULL, NULL, 0,
								  tags_data->timestamp);
	EMIT_SIGNAL_TAGS (XP_TE_NOTIFYHEAD, sess, NULL, NULL, NULL, NULL, 0, tags_data);
	while (list)
	{
		i++;


@@ 564,17 561,15 @@ notify_showlist (struct session *sess, const message_tags_data *tags_data)
			g_snprintf (outbuf, sizeof (outbuf), _("  %-20s online\n"), notify->name);
		else
			g_snprintf (outbuf, sizeof (outbuf), _("  %-20s offline\n"), notify->name);
		PrintTextTimeStamp (sess, outbuf, tags_data->timestamp);
		PrintTextTimeStamp (sess, outbuf, tags_data->msgid, tags_data->timestamp);
		list = list->next;
	}
	if (i)
	{
		sprintf (outbuf, "%d", i);
		EMIT_SIGNAL_TIMESTAMP (XP_TE_NOTIFYNUMBER, sess, outbuf, NULL, NULL, NULL,
									  0, tags_data->timestamp);
		EMIT_SIGNAL_TAGS (XP_TE_NOTIFYNUMBER, sess, outbuf, NULL, NULL, NULL, 0, tags_data);
	} else
		EMIT_SIGNAL_TIMESTAMP (XP_TE_NOTIFYEMPTY, sess, NULL, NULL, NULL, NULL, 0,
									  tags_data->timestamp);
		EMIT_SIGNAL_TAGS (XP_TE_NOTIFYEMPTY, sess, NULL, NULL, NULL, NULL, 0, tags_data);
}

int

M src/common/proto-irc.c => src/common/proto-irc.c +98 -119
@@ 456,8 456,7 @@ channel_date (session *sess, char *chan, char *timestr,
	char *tim = ctime (&timestamp);
	if (tim != NULL)
		tim[24] = 0;	/* get rid of the \n */
	EMIT_SIGNAL_TIMESTAMP (XP_TE_CHANDATE, sess, chan, tim, NULL, NULL, 0,
								  tags_data->timestamp);
	EMIT_SIGNAL_TAGS (XP_TE_CHANDATE, sess, chan, tim, NULL, NULL, 0, tags_data);
}

static int


@@ 556,8 555,7 @@ process_numeric (session * sess, int n,

	case 312:
		if (!serv->skip_next_whois)
			EMIT_SIGNAL_TIMESTAMP (XP_TE_WHOIS3, whois_sess, word[4], word_eol[5],
										  NULL, NULL, 0, tags_data->timestamp);
			EMIT_SIGNAL_TAGS (XP_TE_WHOIS3, whois_sess, word[4], word_eol[5], NULL, NULL, 0, tags_data);
		else
			inbound_user_info (sess, NULL, NULL, NULL, word[5], word[4], NULL, NULL,
									 0xff, tags_data);


@@ 567,19 565,18 @@ process_numeric (session * sess, int n,
		serv->inside_whois = 1;
		inbound_user_info_start (sess, word[4], tags_data);
		if (!serv->skip_next_whois)
			EMIT_SIGNAL_TIMESTAMP (XP_TE_WHOIS1, whois_sess, word[4], word[5],
										  word[6], (word_eol[8][0] == ':') ? word_eol[8] + 1 : word_eol[8],
										  0, tags_data->timestamp);
			EMIT_SIGNAL_TAGS (XP_TE_WHOIS1, whois_sess, word[4], word[5], word[6],
						(word_eol[8][0] == ':') ? word_eol[8] + 1 : word_eol[8],
						0, tags_data);
		else
			inbound_user_info (sess, NULL, word[5], word[6], NULL, word[4],
									 word_eol[8][0] == ':' ? word_eol[8] + 1 : word_eol[8],
									 NULL, 0xff, tags_data);
						word_eol[8][0] == ':' ? word_eol[8] + 1 : word_eol[8],
						NULL, 0xff, tags_data);
		break;

	case 314:	/* WHOWAS */
		inbound_user_info_start (sess, word[4], tags_data);
		EMIT_SIGNAL_TIMESTAMP (XP_TE_WHOIS1, whois_sess, word[4], word[5],
									  word[6], word_eol[8] + 1, 0, tags_data->timestamp);
		EMIT_SIGNAL_TAGS (XP_TE_WHOIS1, whois_sess, word[4], word[5], word[6], word_eol[8] + 1, 0, tags_data);
		break;

	case 317:


@@ 594,23 591,20 @@ process_numeric (session * sess, int n,
						"%02ld:%02ld:%02ld", idle / 3600, (idle / 60) % 60,
						idle % 60);
			if (timestamp == 0)
				EMIT_SIGNAL_TIMESTAMP (XP_TE_WHOIS4, whois_sess, word[4],
											  outbuf, NULL, NULL, 0, tags_data->timestamp);
				EMIT_SIGNAL_TAGS (XP_TE_WHOIS4, whois_sess, word[4], outbuf, NULL, NULL, 0, tags_data);
			else
			{
				tim = ctime (&timestamp);
				if (tim != NULL)
					tim[19] = 0; 	/* get rid of the \n */
				EMIT_SIGNAL_TIMESTAMP (XP_TE_WHOIS4T, whois_sess, word[4],
											  outbuf, tim, NULL, 0, tags_data->timestamp);
				EMIT_SIGNAL_TAGS (XP_TE_WHOIS4T, whois_sess, word[4], outbuf, tim, NULL, 0, tags_data);
			}
		}
		break;

	case 318:	/* END OF WHOIS */
		if (!serv->skip_next_whois)
			EMIT_SIGNAL_TIMESTAMP (XP_TE_WHOIS6, whois_sess, word[4], NULL,
										  NULL, NULL, 0, tags_data->timestamp);
			EMIT_SIGNAL_TAGS (XP_TE_WHOIS6, whois_sess, word[4], NULL, NULL, NULL, 0, tags_data);
		serv->skip_next_whois = 0;
		serv->inside_whois = 0;
		break;


@@ 618,23 612,23 @@ process_numeric (session * sess, int n,
	case 313:
	case 319:
		if (!serv->skip_next_whois)
			EMIT_SIGNAL_TIMESTAMP (XP_TE_WHOIS2, whois_sess, word[4],
										  word_eol[5][0] == ':' ? word_eol[5] + 1 : word_eol[5], NULL, NULL, 0,
										  tags_data->timestamp);
			EMIT_SIGNAL_TAGS (XP_TE_WHOIS2, whois_sess, word[4],
						word_eol[5][0] == ':' ? word_eol[5] + 1 : word_eol[5], NULL, NULL, 0,
						tags_data);
		break;

	case 307:	/* dalnet version */
	case 320:	/* :is an identified user */
		if (!serv->skip_next_whois)
			EMIT_SIGNAL_TIMESTAMP (XP_TE_WHOIS_ID, whois_sess, word[4],
										  word_eol[5][0] == ':' ? word_eol[5] + 1 : word_eol[5], NULL, NULL, 0,
										  tags_data->timestamp);
			EMIT_SIGNAL_TAGS (XP_TE_WHOIS_ID, whois_sess, word[4],
						word_eol[5][0] == ':' ? word_eol[5] + 1 : word_eol[5], NULL, NULL, 0,
						tags_data);
		break;

	case 321:
		if (!fe_is_chanwindow (sess->server))
			EMIT_SIGNAL_TIMESTAMP (XP_TE_CHANLISTHEAD, serv->server_session, NULL,
										  NULL, NULL, NULL, 0, tags_data->timestamp);
			EMIT_SIGNAL_TAGS (XP_TE_CHANLISTHEAD, serv->server_session, NULL,
						NULL, NULL, NULL, 0, tags_data);
		break;

	case 322:


@@ 643,16 637,15 @@ process_numeric (session * sess, int n,
			fe_add_chan_list (sess->server, word[4], word[5], word_eol[6] + 1);
		} else
		{
			PrintTextTimeStampf (serv->server_session, tags_data->timestamp,
										"%-16s %-7d %s\017\n", word[4], atoi (word[5]),
										word_eol[6] + 1);
			PrintTextTimeStampf (serv->server_session, tags_data->msgid, tags_data->timestamp,
					     "%-16s %-7d %s\017\n", word[4], atoi (word[5]), word_eol[6] + 1);
		}
		break;

	case 323:
		if (!fe_is_chanwindow (sess->server))
			EMIT_SIGNAL_TIMESTAMP (XP_TE_SERVTEXT, serv->server_session, text, 
										  word[1], word[2], NULL, 0, tags_data->timestamp);
			EMIT_SIGNAL_TAGS (XP_TE_SERVTEXT, serv->server_session, text, 
						word[1], word[2], NULL, 0, tags_data);
		else
			fe_chan_list_end (sess->server);
		break;


@@ 664,8 657,8 @@ process_numeric (session * sess, int n,
		if (sess->ignore_mode)
			sess->ignore_mode = FALSE;
		else
			EMIT_SIGNAL_TIMESTAMP (XP_TE_CHANMODES, sess, word[4], (word_eol[5][0] == ':') ? word_eol[5] + 1 : word_eol[5],
										  NULL, NULL, 0, tags_data->timestamp);
			EMIT_SIGNAL_TAGS (XP_TE_CHANMODES, sess, word[4], (word_eol[5][0] == ':') ? word_eol[5] + 1 : word_eol[5],
						NULL, NULL, 0, tags_data);
		fe_update_mode_buttons (sess, 'c', '-');
		fe_update_mode_buttons (sess, 't', '-');
		fe_update_mode_buttons (sess, 'n', '-');


@@ 680,8 673,8 @@ process_numeric (session * sess, int n,
		sess = find_channel (serv, word[4]);
		if (sess)
		{
			EMIT_SIGNAL_TIMESTAMP (XP_TE_CHANURL, sess, word[4], (word_eol[5][0] == ':') ? word_eol[5] + 1 : word_eol[5],
									NULL, NULL, 0, tags_data->timestamp); 
			EMIT_SIGNAL_TAGS (XP_TE_CHANURL, sess, word[4], (word_eol[5][0] == ':') ? word_eol[5] + 1 : word_eol[5],
						NULL, NULL, 0, tags_data); 
		}
		break;



@@ 698,9 691,8 @@ process_numeric (session * sess, int n,

	case 330:
		if (!serv->skip_next_whois)
			EMIT_SIGNAL_TIMESTAMP (XP_TE_WHOIS_AUTH, whois_sess, word[4],
										  word_eol[6] + 1, word[5], NULL, 0,
										  tags_data->timestamp);
			EMIT_SIGNAL_TAGS (XP_TE_WHOIS_AUTH, whois_sess, word[4], word_eol[6] + 1,
						word[5], NULL, 0, tags_data);
		inbound_user_info (sess, NULL, NULL, NULL, NULL, word[4], NULL, word[5],
								 0xff, tags_data);
		break;


@@ 717,15 709,15 @@ process_numeric (session * sess, int n,

#if 0
	case 338:  /* Undernet Real user@host, Real IP */
		EMIT_SIGNAL_TIMESTAMP (XP_TE_WHOIS_REALHOST, sess, word[4], word[5], word[6], 
									  (word_eol[7][0]==':') ? word_eol[7]+1 : word_eol[7],
									  0, tags_data->timestamp);
		EMIT_SIGNAL_TAGS (XP_TE_WHOIS_REALHOST, sess, word[4], word[5], word[6], 
					(word_eol[7][0]==':') ? word_eol[7]+1 : word_eol[7],
					0, tags_data);
		break;
#endif

	case 341:						  /* INVITE ACK */
		EMIT_SIGNAL_TIMESTAMP (XP_TE_UINVITE, sess, word[4], STRIP_COLON(word, word_eol, 5),
									  serv->servername, NULL, 0, tags_data->timestamp);
		EMIT_SIGNAL_TAGS (XP_TE_UINVITE, sess, word[4], STRIP_COLON(word, word_eol, 5),
					serv->servername, NULL, 0, tags_data);
		break;

	case 352:						  /* WHO */


@@ 742,8 734,8 @@ process_numeric (session * sess, int n,

			/* try to show only user initiated whos */
			if (!who_sess || !who_sess->doing_who)
				EMIT_SIGNAL_TIMESTAMP (XP_TE_SERVTEXT, serv->server_session, text, word[1],
											  word[2], NULL, 0, tags_data->timestamp);
				EMIT_SIGNAL_TAGS (XP_TE_SERVTEXT, serv->server_session, text, word[1],
							word[2], NULL, 0, tags_data);
		}
		break;



@@ 767,9 759,8 @@ process_numeric (session * sess, int n,

				/* try to show only user initiated whos */
				if (!who_sess || !who_sess->doing_who)
					EMIT_SIGNAL_TIMESTAMP (XP_TE_SERVTEXT, serv->server_session, text,
												  word[1], word[2], NULL, 0,
												  tags_data->timestamp);
					EMIT_SIGNAL_TAGS (XP_TE_SERVTEXT, serv->server_session, text,
								word[1], word[2], NULL, 0, tags_data);
			} else
				goto def;
		}


@@ 782,15 773,14 @@ process_numeric (session * sess, int n,
			if (who_sess)
			{
				if (!who_sess->doing_who)
					EMIT_SIGNAL_TIMESTAMP (XP_TE_SERVTEXT, serv->server_session, text,
												  word[1], word[2], NULL, 0,
												  tags_data->timestamp);
					EMIT_SIGNAL_TAGS (XP_TE_SERVTEXT, serv->server_session, text,
								word[1], word[2], NULL, 0, tags_data);
				who_sess->doing_who = FALSE;
			} else
			{
				if (!serv->doing_dns)
					EMIT_SIGNAL_TIMESTAMP (XP_TE_SERVTEXT, serv->server_session, text,
												  word[1], word[2], NULL, 0, tags_data->timestamp);
					EMIT_SIGNAL_TAGS (XP_TE_SERVTEXT, serv->server_session, text,
								word[1], word[2], NULL, 0, tags_data);
				serv->doing_dns = FALSE;
			}
		}


@@ 798,7 788,7 @@ process_numeric (session * sess, int n,

	case 346:	/* +I-list entry */
		if (!inbound_banlist (sess, atol (STRIP_COLON (word, word_eol, 7)), word[4], word[5], word[6], 346,
									 tags_data))
					tags_data))
			goto def;
		break;



@@ 809,7 799,7 @@ process_numeric (session * sess, int n,

	case 348:	/* +e-list entry */
		if (!inbound_banlist (sess, atol (STRIP_COLON (word, word_eol, 7)), word[4], word[5], word[6], 348,
									 tags_data))
					tags_data))
			goto def;
		break;



@@ 821,10 811,10 @@ process_numeric (session * sess, int n,
			goto def;
		break;

	case 353:						  /* NAMES */
	case 353:			/* NAMES */
		inbound_nameslist (serv, word[5],
								 (word_eol[6][0] == ':') ? word_eol[6] + 1 : word_eol[6],
								 tags_data);
					(word_eol[6][0] == ':') ? word_eol[6] + 1 : word_eol[6],
					tags_data);
		break;

	case 366:


@@ 834,7 824,7 @@ process_numeric (session * sess, int n,

	case 367: /* banlist entry */
		if (!inbound_banlist (sess, atol (STRIP_COLON (word, word_eol, 7)), word[4], word[5], word[6], 367,
									 tags_data))
					tags_data))
			goto def;
		break;



@@ 848,15 838,14 @@ process_numeric (session * sess, int n,

	case 369:	/* WHOWAS end */
	case 406:	/* WHOWAS error */
		EMIT_SIGNAL_TIMESTAMP (XP_TE_SERVTEXT, whois_sess, text, word[1], word[2],
									  NULL, 0, tags_data->timestamp);
		EMIT_SIGNAL_TAGS (XP_TE_SERVTEXT, whois_sess, text, word[1], word[2], NULL, 0, tags_data);
		serv->inside_whois = 0;
		break;

	case 372:	/* motd text */
	case 375:	/* motd start */
		if (!prefs.hex_irc_skip_motd || serv->motd_skipped)
			EMIT_SIGNAL_TIMESTAMP (XP_TE_MOTD, serv->server_session, text, NULL,
			EMIT_SIGNAL_TAGS (XP_TE_MOTD, serv->server_session, text, NULL,
										  NULL, NULL, 0, tags_data->timestamp);
		break;



@@ 888,23 877,19 @@ process_numeric (session * sess, int n,
		break;

	case 471:
		EMIT_SIGNAL_TIMESTAMP (XP_TE_USERLIMIT, sess, word[4], NULL, NULL, NULL, 0,
									  tags_data->timestamp);
		EMIT_SIGNAL_TAGS (XP_TE_USERLIMIT, sess, word[4], NULL, NULL, NULL, 0, tags_data);
		break;

	case 473:
		EMIT_SIGNAL_TIMESTAMP (XP_TE_INVITE, sess, word[4], NULL, NULL, NULL, 0,
									  tags_data->timestamp);
		EMIT_SIGNAL_TAGS (XP_TE_INVITE, sess, word[4], NULL, NULL, NULL, 0, tags_data);
		break;

	case 474:
		EMIT_SIGNAL_TIMESTAMP (XP_TE_BANNED, sess, word[4], NULL, NULL, NULL, 0,
									  tags_data->timestamp);
		EMIT_SIGNAL_TAGS (XP_TE_BANNED, sess, word[4], NULL, NULL, NULL, 0, tags_data);
		break;

	case 475:
		EMIT_SIGNAL_TIMESTAMP (XP_TE_KEYWORD, sess, word[4], NULL, NULL, NULL, 0,
									  tags_data->timestamp);
		EMIT_SIGNAL_TAGS (XP_TE_KEYWORD, sess, word[4], NULL, NULL, NULL, 0, tags_data);
		break;

	case 601:


@@ 924,8 909,8 @@ process_numeric (session * sess, int n,
	case 704: // RPL_HELPSTART
	case 705: // RPL_HELPTXT
	case 706: // RPL_ENDOFHELP
		EMIT_SIGNAL_TIMESTAMP (XP_TE_SERVTEXT, sess, STRIP_COLON(word, word_eol, 5), NULL, NULL, NULL,
									  0, tags_data->timestamp);
		EMIT_SIGNAL_TAGS (XP_TE_SERVTEXT, sess, STRIP_COLON(word, word_eol, 5), NULL, NULL, NULL,
					0, tags_data);
		break;

	case 728:	/* +q-list entry */


@@ 950,9 935,8 @@ process_numeric (session * sess, int n,
		break;

	case 900:	/* successful SASL 'logged in as ' */
		EMIT_SIGNAL_TIMESTAMP (XP_TE_SERVTEXT, serv->server_session, 
									  word_eol[6]+1, word[1], word[2], NULL, 0,
									  tags_data->timestamp);
		EMIT_SIGNAL_TAGS (XP_TE_SERVTEXT, serv->server_session, word_eol[6]+1,
					word[1], word[2], NULL, 0, tags_data);
		break;
	case 904:	/* failed SASL auth */
		inbound_sasl_error (serv);


@@ 960,9 944,8 @@ process_numeric (session * sess, int n,
	case 905:	/* failed SASL auth */
	case 906:	/* aborted */
	case 907:	/* attempting to re-auth after a successful auth */
		EMIT_SIGNAL_TIMESTAMP (XP_TE_SASLRESPONSE, serv->server_session, word[1],
									  word[2], word[3], ++word_eol[4], 0,
									  tags_data->timestamp);
		EMIT_SIGNAL_TAGS (XP_TE_SASLRESPONSE, serv->server_session, word[1],
					word[2], word[3], ++word_eol[4], 0, tags_data);
		serv->waiting_on_sasl = FALSE;
		if (!serv->sent_capend)
		{


@@ 980,9 963,9 @@ process_numeric (session * sess, int n,
		{
			/* some unknown WHOIS reply, ircd coders make them up weekly */
			if (!serv->skip_next_whois)
				EMIT_SIGNAL_TIMESTAMP (XP_TE_WHOIS_SPECIAL, whois_sess, word[4],
											  (word_eol[5][0] == ':') ? word_eol[5] + 1 : word_eol[5],
											  word[2], NULL, 0, tags_data->timestamp);
				EMIT_SIGNAL_TAGS (XP_TE_WHOIS_SPECIAL, whois_sess, word[4],
						  (word_eol[5][0] == ':') ? word_eol[5] + 1 : word_eol[5],
						  word[2], NULL, 0, tags_data);
			return;
		}



@@ 1001,8 984,7 @@ process_numeric (session * sess, int n,
			else
				sess=serv->server_session;
			
			EMIT_SIGNAL_TIMESTAMP (XP_TE_SERVTEXT, sess, text, word[1], word[2],
										  NULL, 0, tags_data->timestamp);
			EMIT_SIGNAL_TAGS (XP_TE_SERVTEXT, sess, text, word[1], word[2], NULL, 0, tags_data);
		}
	}
}


@@ 1011,7 993,7 @@ process_numeric (session * sess, int n,

static void
process_named_msg (session *sess, char *type, char *word[], char *word_eol[],
						 const message_tags_data *tags_data)
		   const message_tags_data *tags_data)
{
	server *serv = sess->server;
	char *account;


@@ 1091,8 1073,8 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[],
				if (*reason == ':')
					reason++;

				EMIT_SIGNAL_TIMESTAMP (XP_TE_KILL, sess, nick, reason, NULL, NULL,
											  0, tags_data->timestamp);
				EMIT_SIGNAL_TAGS (XP_TE_KILL, sess, nick, reason, NULL, NULL,
						  0, tags_data);
			}
			return;



@@ 1102,8 1084,8 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[],

		case WORDL('N','I','C','K'):
			inbound_newnick (serv, nick, 
								  (word_eol[3][0] == ':') ? word_eol[3] + 1 : word_eol[3],
								  FALSE, tags_data);
					 (word_eol[3][0] == ':') ? word_eol[3] + 1 : word_eol[3],
					 FALSE, tags_data);
			return;

		case WORDL('P','A','R','T'):


@@ 1140,18 1122,18 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[],

		case WORDL('A','W','A','Y'):
			inbound_away_notify (serv, nick,
										(word_eol[3][0] == ':') ? word_eol[3] + 1 : NULL,
										tags_data);
					     (word_eol[3][0] == ':') ? word_eol[3] + 1 : NULL,
					     tags_data);
			return;

		case WORDL('F','A','I','L'):
			text = STRIP_COLON(word, word_eol, trailing_index(word_eol));
			if (g_strcmp0(word[3], "*") == 0)
			{
				EMIT_SIGNAL_TIMESTAMP (XP_TE_FAIL, sess, word[4], text, NULL, NULL, NULL, tags_data->timestamp);
				EMIT_SIGNAL_TAGS (XP_TE_FAIL, sess, word[4], text, NULL, NULL, NULL, tags_data);
			} else
			{
				EMIT_SIGNAL_TIMESTAMP (XP_TE_FAILCMD, sess, word[3], word[4], text, NULL, NULL, tags_data->timestamp);
				EMIT_SIGNAL_TAGS (XP_TE_FAILCMD, sess, word[3], word[4], text, NULL, NULL, tags_data);
			}
			return;



@@ 1159,10 1141,10 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[],
			text = STRIP_COLON(word, word_eol, trailing_index(word_eol));
			if (g_strcmp0(word[3], "*") == 0)
			{
				EMIT_SIGNAL_TIMESTAMP (XP_TE_WARN, sess, word[4], text, NULL, NULL, NULL, tags_data->timestamp);
				EMIT_SIGNAL_TAGS (XP_TE_WARN, sess, word[4], text, NULL, NULL, NULL, tags_data);
			} else
			{
				EMIT_SIGNAL_TIMESTAMP (XP_TE_WARNCMD, sess, word[3], word[4], text, NULL, NULL, tags_data->timestamp);
				EMIT_SIGNAL_TAGS (XP_TE_WARNCMD, sess, word[3], word[4], text, NULL, NULL, tags_data);
			}
			return;



@@ 1170,10 1152,10 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[],
			text = STRIP_COLON(word, word_eol, trailing_index(word_eol));
			if (g_strcmp0(word[3], "*") == 0)
			{
				EMIT_SIGNAL_TIMESTAMP (XP_TE_NOTE, sess, word[4], text, NULL, NULL, NULL, tags_data->timestamp);
				EMIT_SIGNAL_TAGS (XP_TE_NOTE, sess, word[4], text, NULL, NULL, NULL, tags_data);
			} else
			{
				EMIT_SIGNAL_TIMESTAMP (XP_TE_NOTECMD, sess, word[3], word[4], text, NULL, NULL, tags_data->timestamp);
				EMIT_SIGNAL_TAGS (XP_TE_NOTECMD, sess, word[3], word[4], text, NULL, NULL, tags_data);
			}
			return;
		}


@@ 1214,13 1196,11 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[],

			text = STRIP_COLON(word, word_eol, 4);
			if (serv->p_cmp (word[3], serv->nick))
				EMIT_SIGNAL_TIMESTAMP (XP_TE_INVITEDOTHER, sess, text, nick,
											  word[3], serv->servername, 0,
											  tags_data->timestamp);
				EMIT_SIGNAL_TAGS (XP_TE_INVITEDOTHER, sess, text, nick,
						  word[3], serv->servername, 0, tags_data);
			else
				EMIT_SIGNAL_TIMESTAMP (XP_TE_INVITED, sess, text, nick,
											  serv->servername, NULL, 0,
											  tags_data->timestamp);
				EMIT_SIGNAL_TAGS (XP_TE_INVITED, sess, text, nick,
						  serv->servername, NULL, 0, tags_data);
				
			return;



@@ 1339,8 1319,7 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[],
			text = word_eol[3];
			if (*text == ':')
				text++;
			EMIT_SIGNAL_TIMESTAMP (XP_TE_WALLOPS, sess, nick, text, NULL, NULL, 0,
										  tags_data->timestamp);
			EMIT_SIGNAL_TAGS (XP_TE_WALLOPS, sess, nick, text, NULL, NULL, 0, tags_data);
			return;
		}
	}


@@ 1356,14 1335,14 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[],
				if (strncasecmp (word[4], "ACK", 3) == 0)
				{
					inbound_cap_ack (serv, word[1], 
										  word[5][0] == ':' ? word_eol[5] + 1 : word_eol[5],
										  tags_data);
							 word[5][0] == ':' ? word_eol[5] + 1 : word_eol[5],
							 tags_data);
				}
				else if (strncasecmp (word[4], "LS", 2) == 0 || strncasecmp (word[4], "NEW", 3) == 0)
				{
					inbound_cap_ls (serv, word[1], 
										 word[5][0] == ':' ? word_eol[5] + 1 : word_eol[5],
										 tags_data);
							word[5][0] == ':' ? word_eol[5] + 1 : word_eol[5],
							tags_data);
				}
				else if (strncasecmp (word[4], "NAK", 3) == 0)
				{


@@ 1372,14 1351,14 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[],
				else if (strncasecmp (word[4], "LIST", 4) == 0)	
				{
					inbound_cap_list (serv, word[1], 
											word[5][0] == ':' ? word_eol[5] + 1 : word_eol[5],
											tags_data);
							  word[5][0] == ':' ? word_eol[5] + 1 : word_eol[5],
							  tags_data);
				}
				else if (strncasecmp (word[4], "DEL", 3) == 0)
				{
					inbound_cap_del (serv, word[1],
											word[5][0] == ':' ? word_eol[5] + 1 : word_eol[5],
											tags_data);
							 word[5][0] == ':' ? word_eol[5] + 1 : word_eol[5],
							 tags_data);
				}

				return;


@@ 1388,7 1367,7 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[],

garbage:
	/* unknown message */
	PrintTextTimeStampf (sess, tags_data->timestamp, "GARBAGE: %s\n", word_eol[1]);
	PrintTextTimeStampf (sess, tags_data->msgid, tags_data->timestamp, "GARBAGE: %s\n", word_eol[1]);
}

/* handle named messages that DON'T start with a ':' */


@@ 1406,8 1385,7 @@ process_named_servermsg (session *sess, char *buf, char *rawname, char *word_eol
	}
	if (!strncmp (buf, "ERROR", 5))
	{
		EMIT_SIGNAL_TIMESTAMP (XP_TE_SERVERERROR, sess, buf + 7, NULL, NULL, NULL,
									  0, tags_data->timestamp);
		EMIT_SIGNAL_TAGS (XP_TE_SERVERERROR, sess, buf + 7, NULL, NULL, NULL, 0, tags_data);
		return;
	}
	if (!strncmp (buf, "NOTICE ", 7))


@@ 1415,9 1393,7 @@ process_named_servermsg (session *sess, char *buf, char *rawname, char *word_eol
		buf = word_eol[3];
		if (*buf == ':')
			buf++;
		EMIT_SIGNAL_TIMESTAMP (XP_TE_SERVNOTICE, sess, buf, 
									  sess->server->servername, NULL, NULL, 0,
									  tags_data->timestamp);
		EMIT_SIGNAL_TAGS (XP_TE_SERVNOTICE, sess, buf,  sess->server->servername, NULL, NULL, 0, tags_data);
		return;
	}
	if (!strncmp (buf, "AUTHENTICATE", 12))


@@ 1426,8 1402,7 @@ process_named_servermsg (session *sess, char *buf, char *rawname, char *word_eol
		return;
	}

	EMIT_SIGNAL_TIMESTAMP (XP_TE_SERVTEXT, sess, buf, sess->server->servername,
								  rawname, NULL, 0, tags_data->timestamp);
	EMIT_SIGNAL_TAGS (XP_TE_SERVTEXT, sess, buf, sess->server->servername, rawname, NULL, 0, tags_data);
}

/* Returns the timezone offset. This should be the same as the variable


@@ 1552,6 1527,9 @@ handle_message_tags (server *serv, const char *tags_str,

		if (serv->have_account_tag && !strcmp (key, "account"))
			tags_data->account = g_strdup (value);
		
		if (serv->have_message_tags && !strcmp (key, "msgid"))
			tags_data->msgid = g_strdup (value);

		if (serv->have_idmsg && strcmp (key, "solanum.chat/identified"))
			tags_data->identified = TRUE;


@@ 1661,6 1639,7 @@ void
message_tags_data_free (message_tags_data *tags_data)
{
	g_clear_pointer (&tags_data->account, g_free);
	g_clear_pointer (&tags_data->msgid, g_free);
}

void

M src/common/proto-irc.h => src/common/proto-irc.h +5 -3
@@ 24,10 24,11 @@
#define HEXCHAT_PROTO_H

#define MESSAGE_TAGS_DATA_INIT			\
	{									\
		NULL, /* account name */		\
	{					\
		NULL, /* account name */	\
		NULL, /* message id */		\
		FALSE, /* identified to nick */ \
		(time_t)0, /* timestamp */		\
		(time_t)0, /* timestamp */	\
	}

#define STRIP_COLON(word, word_eol, idx) (word)[(idx)][0] == ':' ? (word_eol)[(idx)]+1 : (word)[(idx)]


@@ 39,6 40,7 @@
typedef struct 
{
	char *account;
	char *msgid;
	gboolean identified;
	time_t timestamp;
} message_tags_data;

M src/common/text.c => src/common/text.c +59 -26
@@ 43,6 43,7 @@
#include "hexchatc.h"
#include "text.h"
#include "typedef.h"
#include "proto-irc.h"
#ifdef WIN32
#include <windows.h>
#endif


@@ 156,7 157,7 @@ scrollback_shrink (session *sess)
}

static void
scrollback_save (session *sess, char *text, time_t stamp)
scrollback_save (session *sess, char *text, char *msgid, time_t stamp)
{
	GOutputStream *ostream;
	char *buf;


@@ 195,6 196,12 @@ scrollback_save (session *sess, char *text, time_t stamp)
	if (!ostream)
		return;

	if (msgid) {
		buf = g_strdup_printf("I %s ", msgid);
		g_output_stream_write(ostream, buf, strlen (buf), NULL, NULL);
		g_free (buf);
	}

	if (!stamp)
		stamp = time(0);
	if (sizeof (stamp) == 4)	/* gcc will optimize one of these out */


@@ 222,7 229,7 @@ scrollback_load (session *sess)
{
	GInputStream *stream;
	GDataInputStream *istream;
	gchar *buf, *text;
	gchar *buf, *text, *msgid;
	gint lines = 0;
	time_t stamp = 0;



@@ 274,12 281,25 @@ scrollback_load (session *sess)
			 * Some don't even have a timestamp
			 * Some don't have any text at all
			 */
			if (buf[0] == 'T' && buf[1] == ' ')
			/* and now she's gone and added fucking ids to the mix!? */
			if (buf[0] == 'I' && buf[1] == ' ')
			{
				msgid = buf + 2;
				text = strchr (buf + 3, ' ');
				text[0] = '\0';
				text++;
			} else
			{
				msgid = NULL;
				text = buf;
			}
			
			if (text[0] == 'T' && text[1] == ' ')
			{
				if (sizeof (time_t) == 4)
					stamp = strtoul (buf + 2, NULL, 10);
					stamp = strtoul (text + 2, NULL, 10);
				else
					stamp = g_ascii_strtoull (buf + 2, NULL, 10); /* in case time_t is 64 bits */
					stamp = g_ascii_strtoull (text + 2, NULL, 10); /* in case time_t is 64 bits */

				if (G_UNLIKELY(stamp == 0))
				{


@@ 287,7 307,7 @@ scrollback_load (session *sess)
					continue;
				}

				text = strchr (buf + 3, ' ');
				text = strchr (text + 3, ' ');
				if (text && text[1])
				{
					if (prefs.hex_text_stripcolor_replay)


@@ 295,7 315,7 @@ scrollback_load (session *sess)
						text = strip_color (text + 1, -1, STRIP_COLOR);
					}

					fe_print_text (sess, text, stamp, TRUE);
					fe_print_text (sess, text, msgid, stamp, TRUE);

					if (prefs.hex_text_stripcolor_replay)
					{


@@ 304,15 324,15 @@ scrollback_load (session *sess)
				}
				else
				{
					fe_print_text (sess, "  ", stamp, TRUE);
					fe_print_text (sess, "  ", msgid, stamp, TRUE);
				}
			}
			else
			{
				if (strlen (buf))
					fe_print_text (sess, buf, 0, TRUE);
				if (strlen (text))
					fe_print_text (sess, text, msgid, 0, TRUE);
				else
					fe_print_text (sess, "  ", 0, TRUE);
					fe_print_text (sess, "  ", msgid, 0, TRUE);
			}
			lines++;



@@ 346,7 366,7 @@ scrollback_load (session *sess)
	{
		text = ctime (&stamp);
		buf = g_strdup_printf ("\n*\t%s %s\n", _("Loaded log from"), text);
		fe_print_text (sess, buf, 0, TRUE);
		fe_print_text (sess, buf, NULL, 0, TRUE);
		g_free (buf);
		/*EMIT_SIGNAL (XP_TE_GENMSG, sess, "*", buf, NULL, NULL, NULL, 0);*/
	}


@@ 835,7 855,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
}

void
PrintTextTimeStamp (session *sess, char *text, time_t timestamp)
PrintTextTimeStamp (session *sess, char *text, char *msgid, time_t timestamp)
{
	if (!sess)
	{


@@ 855,15 875,15 @@ PrintTextTimeStamp (session *sess, char *text, time_t timestamp)
	}

	log_write (sess, text, timestamp);
	scrollback_save (sess, text, timestamp);
	fe_print_text (sess, text, timestamp, FALSE);
	scrollback_save (sess, text, msgid, timestamp);
	fe_print_text (sess, text, msgid, timestamp, FALSE);
	g_free (text);
}

void
PrintText (session *sess, char *text)
{
	PrintTextTimeStamp (sess, text, 0);
	PrintTextTimeStamp (sess, text, NULL, 0);
}

void


@@ 881,7 901,7 @@ PrintTextf (session *sess, const char *format, ...)
}

void
PrintTextTimeStampf (session *sess, time_t timestamp, const char *format, ...)
PrintTextTimeStampf (session *sess, char *msgid, time_t timestamp, const char *format, ...)
{
	va_list args;
	char *buf;


@@ 890,7 910,7 @@ PrintTextTimeStampf (session *sess, time_t timestamp, const char *format, ...)
	buf = g_strdup_vprintf (format, args);
	va_end (args);

	PrintTextTimeStamp (sess, buf, timestamp);
	PrintTextTimeStamp (sess, buf, msgid, timestamp);
	g_free (buf);
}



@@ 1778,8 1798,8 @@ format_event (session *sess, int index, char **args, char *o, gsize sizeofo, uns
			if (a > numargs)
			{
				fprintf (stderr,
							"HexChat DEBUG: display_event: arg > numargs (%d %d %s)\n",
							a, numargs, i);
						"HexChat DEBUG: display_event: arg > numargs (%d %d %s)\n",
						a, numargs, i);
				break;
			}
			ar = args[(int) a + 1];


@@ 1809,12 1829,12 @@ format_event (session *sess, int index, char **args, char *o, gsize sizeofo, uns

static void
display_event (session *sess, int event, char **args, 
					unsigned int stripcolor_args, time_t timestamp)
		unsigned int stripcolor_args, char *msgid, time_t timestamp)
{
	char o[4096];
	format_event (sess, event, args, o, sizeof (o), stripcolor_args);
	if (o[0])
		PrintTextTimeStamp (sess, o, timestamp);
		PrintTextTimeStamp (sess, o, msgid, timestamp);
}

int


@@ 2020,7 2040,7 @@ text_color_of (char *name)

void
text_emit (int index, session *sess, char *a, char *b, char *c, char *d,
			  time_t timestamp)
	   const message_tags_data *tags_data)
{
	char *word[PDIWORDS];
	int i;


@@ 2028,6 2048,17 @@ text_emit (int index, session *sess, char *a, char *b, char *c, char *d,
	tab_state_flags plugin_state = sess->last_tab_state;
	unsigned int stripcolor_args = (chanopt_is_set (prefs.hex_text_stripcolor_msg, sess->text_strip) ? 0xFFFFFFFF : 0);
	char tbuf[NICKLEN + 4];
	char *msgid;
	time_t timestamp;
	
	if (tags_data) {
		msgid = tags_data->msgid;
		timestamp = tags_data->timestamp;
	} else
	{
		msgid = NULL;
		timestamp = 0;
	}

	if (a != NULL && prefs.hex_text_color_nicks && (index == XP_TE_CHANACTION || index == XP_TE_CHANMSG))
	{


@@ 2116,7 2147,7 @@ text_emit (int index, session *sess, char *a, char *b, char *c, char *d,

	if (!prefs.hex_away_omit_alerts || !sess->server->is_away)
		sound_play_event (index);
	display_event (sess, index, word, stripcolor_args, timestamp);
	display_event (sess, index, word, stripcolor_args, msgid, timestamp);
}

char *


@@ 2133,14 2164,16 @@ text_find_format_string (char *name)

int
text_emit_by_name (char *name, session *sess, time_t timestamp,
				   char *a, char *b, char *c, char *d)
		   char *a, char *b, char *c, char *d)
{
	int i = 0;
	message_tags_data tags_data = MESSAGE_TAGS_DATA_INIT;
	tags_data.timestamp = timestamp;

	i = pevent_find (name, &i);
	if (i >= 0)
	{
		text_emit (i, sess, a, b, c, d, timestamp);
		text_emit (i, sess, a, b, c, d, &tags_data);
		return 1;
	}


M src/common/text.h => src/common/text.h +8 -7
@@ 19,15 19,16 @@

#include <time.h>
#include "textenums.h"
#include "proto-irc.h"

#ifndef HEXCHAT_TEXT_H
#define HEXCHAT_TEXT_H

/* timestamp is non-zero if we are using server-time */
#define EMIT_SIGNAL_TIMESTAMP(i, sess, a, b, c, d, e, timestamp) \
	text_emit(i, sess, a, b, c, d, timestamp)
#define EMIT_SIGNAL_TAGS(i, sess, a, b, c, d, e, tags) \
	text_emit(i, sess, a, b, c, d, tags)
#define EMIT_SIGNAL(i, sess, a, b, c, d, e) \
	text_emit(i, sess, a, b, c, d, 0)
	text_emit(i, sess, a, b, c, d, NULL)

struct text_event
{


@@ 42,9 43,9 @@ void scrollback_load (session *sess);

int text_word_check (char *word, int len);
void PrintText (session *sess, char *text);
void PrintTextTimeStamp (session *sess, char *text, time_t timestamp);
void PrintTextTimeStamp (session *sess, char *text, char *msgid, time_t timestamp);
void PrintTextf (session *sess, const char *format, ...) G_GNUC_PRINTF (2, 3);
void PrintTextTimeStampf (session *sess, time_t timestamp, const char *format, ...) G_GNUC_PRINTF (3, 4);
void PrintTextTimeStampf (session *sess, char *msgid, time_t timestamp, const char *format, ...) G_GNUC_PRINTF (4, 5);
void log_close (session *sess);
void log_open_or_close (session *sess);
void load_text_events (void);


@@ 54,9 55,9 @@ int pevent_load (char *filename);
void pevent_make_pntevts (void);
int text_color_of (char *name);
void text_emit (int index, session *sess, char *a, char *b, char *c, char *d,
		time_t timestamp);
		const message_tags_data *tags_data);
int text_emit_by_name (char *name, session *sess, time_t timestamp,
					   char *a, char *b, char *c, char *d);
			char *a, char *b, char *c, char *d);
gchar *text_convert_invalid (const gchar* text, gssize len, GIConv converter, const gchar *fallback, gsize *len_out);
gchar *text_fixup_invalid_utf8 (const gchar* text, gssize len, gsize *len_out);
int get_stamp_str (char *fmt, time_t tim, char **ret);

M src/fe-gtk/fe-gtk.c => src/fe-gtk/fe-gtk.c +2 -3
@@ 655,10 655,9 @@ fe_progressbar_end (server *serv)
}

void
fe_print_text (struct session *sess, char *text, time_t stamp,
			   gboolean no_activity)
fe_print_text (struct session *sess, char *text, unsigned char *msgid, time_t stamp, gboolean no_activity)
{
	PrintTextRaw (sess->res->buffer, (unsigned char *)text, prefs.hex_text_indent, stamp);
	PrintTextRaw (sess->res->buffer, (unsigned char *)text, prefs.hex_text_indent, msgid, stamp);

	if (no_activity || !sess->gui->is_tab)
		return;

M src/fe-gtk/fkeys.c => src/fe-gtk/fkeys.c +1 -1
@@ 393,7 393,7 @@ key_dialog_print_text (GtkXText *xtext, char *text)
	unsigned int old = prefs.hex_stamp_text;
	prefs.hex_stamp_text = 0;	/* temporarily disable stamps */
	gtk_xtext_clear (GTK_XTEXT (xtext)->buffer, 0);
	PrintTextRaw (GTK_XTEXT (xtext)->buffer, text, 0, 0);
	PrintTextRaw (GTK_XTEXT (xtext)->buffer, text, 0, NULL, 0);
	prefs.hex_stamp_text = old;
}


M src/fe-gtk/rawlog.c => src/fe-gtk/rawlog.c +1 -1
@@ 163,7 163,7 @@ fe_add_rawlog (server *serv, char *text, int len, int outbound)
		else
			new_text = g_strconcat ("\0033>>\017 ", split_text[i], NULL);

		gtk_xtext_append (GTK_XTEXT (serv->gui->rawlog_textlist)->buffer, new_text, strlen (new_text), 0);
		gtk_xtext_append (GTK_XTEXT (serv->gui->rawlog_textlist)->buffer, new_text, strlen (new_text), NULL,  0);

		g_free (new_text);
	}

M src/fe-gtk/textgui.c => src/fe-gtk/textgui.c +10 -11
@@ 62,7 62,7 @@ xtext_get_stamp_str (time_t tim, char **ret)
}

static void
PrintTextLine (xtext_buffer *xtbuf, unsigned char *text, int len, int indent, time_t timet)
PrintTextLine (xtext_buffer *xtbuf, unsigned char *text, int len, int indent, unsigned char *msgid, time_t timet)
{
	unsigned char *tab, *new_text;
	int leftlen;


@@ 85,10 85,10 @@ PrintTextLine (xtext_buffer *xtbuf, unsigned char *text, int len, int indent, ti
			memcpy (new_text, stamp, stamp_size);
			g_free (stamp);
			memcpy (new_text + stamp_size, text, len);
			gtk_xtext_append (xtbuf, new_text, len + stamp_size, timet);
			gtk_xtext_append (xtbuf, new_text, len + stamp_size, msgid, timet);
			g_free (new_text);
		} else
			gtk_xtext_append (xtbuf, text, len, timet);
			gtk_xtext_append (xtbuf, text, len, msgid, timet);
		return;
	}



@@ 96,14 96,13 @@ PrintTextLine (xtext_buffer *xtbuf, unsigned char *text, int len, int indent, ti
	if (tab && tab < (text + len))
	{
		leftlen = tab - text;
		gtk_xtext_append_indent (xtbuf,
										 text, leftlen, tab + 1, len - (leftlen + 1), timet);
		gtk_xtext_append_indent (xtbuf, text, leftlen, tab + 1, len - (leftlen + 1), msgid, timet);
	} else
		gtk_xtext_append_indent (xtbuf, 0, 0, text, len, timet);
		gtk_xtext_append_indent (xtbuf, 0, 0, text, len, msgid, timet);
}

void
PrintTextRaw (void *xtbuf, unsigned char *text, int indent, time_t stamp)
PrintTextRaw (void *xtbuf, unsigned char *text, int indent, unsigned char *msgid, time_t stamp)
{
	char *last_text = text;
	int len = 0;


@@ 115,10 114,10 @@ PrintTextRaw (void *xtbuf, unsigned char *text, int indent, time_t stamp)
		switch (*text)
		{
		case 0:
			PrintTextLine (xtbuf, last_text, len, indent, stamp);
			PrintTextLine (xtbuf, last_text, len, indent, msgid, stamp);
			return;
		case '\n':
			PrintTextLine (xtbuf, last_text, len, indent, stamp);
			PrintTextLine (xtbuf, last_text, len, indent, msgid, stamp);
			text++;
			if (*text == 0)
				return;


@@ 199,7 198,7 @@ pevent_edited (GtkCellRendererText *render, gchar *pathstr, gchar *new_text, gpo
	out[len + 1] = 0;
	check_special_chars (out, TRUE);

	PrintTextRaw (xtext->buffer, out, 0, 0);
	PrintTextRaw (xtext->buffer, out, 0, NULL, 0);
	g_free (out);

	/* Scroll to bottom */


@@ 330,7 329,7 @@ pevent_test_cb (GtkWidget * wid, GtkWidget * twid)
		out[len + 1] = 0;
		check_special_chars (out, TRUE);

		PrintTextRaw (GTK_XTEXT (twid)->buffer, out, 0, 0);
		PrintTextRaw (GTK_XTEXT (twid)->buffer, out, 0, NULL, 0);
		g_free (out);
	}
}

M src/fe-gtk/textgui.h => src/fe-gtk/textgui.h +1 -1
@@ 20,7 20,7 @@
#ifndef HEXCHAT_TEXTGUI_H
#define HEXCHAT_TEXTGUI_H

void PrintTextRaw (void *xtbuf, unsigned char *text, int indent, time_t stamp);
void PrintTextRaw (void *xtbuf, unsigned char *text, int indent, unsigned char *msgid, time_t stamp);
void pevent_dialog_show (void);

#endif

M src/fe-gtk/xtext.c => src/fe-gtk/xtext.c +45 -20
@@ 69,6 69,9 @@
/* force scrolling off */
#define dontscroll(buf) (buf)->last_pixel_pos = 0x7fffffff

#define ent_msgid(ent) ((unsigned char *) (ent) + sizeof (textentry))
#define ent_msgid_pfx(ent) (*((unsigned int *) ent_msgid (ent)))

static GtkWidgetClass *parent_class = NULL;

struct textentry


@@ 77,6 80,7 @@ struct textentry
	struct textentry *prev;
	unsigned char *str;
	time_t stamp;
	gint16 msgid_len;
	gint16 str_width;
	gint16 str_len;
	gint16 mark_start;


@@ 85,9 89,6 @@ struct textentry
	gint16 left_len;
	GSList *slp;
	GSList *sublines;
	guchar tag;
	guchar pad1;
	guchar pad2;	/* 32-bit align : 44 bytes total */
	GList *marks;	/* List of found strings */
};



@@ 467,7 468,7 @@ gtk_xtext_init (GtkXText * xtext)
		static const gint n_targets = sizeof (targets) / sizeof (targets[0]);

		gtk_selection_add_targets (GTK_WIDGET (xtext), GDK_SELECTION_PRIMARY,
											targets, n_targets);
						targets, n_targets);
	}
}



@@ 2406,7 2407,7 @@ xtext_do_chunk(chunk_t *c)

static unsigned char *
gtk_xtext_strip_color (unsigned char *text, int len, unsigned char *outbuf,
							  int *newlen, GSList **slpp, int strip_hidden)
			int *newlen, GSList **slpp, int strip_hidden)
{
	chunk_t c;
	int i = 0;


@@ 2515,7 2516,7 @@ gtk_xtext_text_width_ent (GtkXText *xtext, textentry *ent)
	}

	new_buf = gtk_xtext_strip_color (ent->str, ent->str_len, xtext->scratch_buffer,
												NULL, &slp0, 2);
						NULL, &slp0, 2);

	width =  backend_get_text_width_slp (xtext, new_buf, slp0);
	ent->slp = slp0;


@@ 4640,9 4641,9 @@ gtk_xtext_append_entry (xtext_buffer *buf, textentry * ent, time_t stamp)
				buf->xtext->io_tag = 0;
			}
			buf->xtext->add_io_tag = g_timeout_add (REFRESH_TIMEOUT * 2,
															(GSourceFunc)
															gtk_xtext_render_page_timeout,
															buf->xtext);
								(GSourceFunc)
								gtk_xtext_render_page_timeout,
								buf->xtext);
		}
	}
	if (buf->scrollbar_down)


@@ 4664,15 4665,22 @@ gtk_xtext_append_entry (xtext_buffer *buf, textentry * ent, time_t stamp)

void
gtk_xtext_append_indent (xtext_buffer *buf,
								 unsigned char *left_text, int left_len,
								 unsigned char *right_text, int right_len,
								 time_t stamp)
				unsigned char *left_text, int left_len,
				unsigned char *right_text, int right_len,
				unsigned char *msgid,
				time_t stamp)
{
	textentry *ent;
	unsigned char *str;
	int space;
	int tempindent;
	int left_width;
	int id_len;
	
	if (msgid)
		id_len = strlen (msgid);
	else
		id_len = 0;

	if (left_len == -1)
		left_len = strlen (left_text);


@@ 4686,8 4694,12 @@ gtk_xtext_append_indent (xtext_buffer *buf,
	if (right_text[right_len-1] == '\n')
		right_len--;

	ent = g_malloc (left_len + right_len + 2 + sizeof (textentry));
	str = (unsigned char *) ent + sizeof (textentry);
	ent = g_malloc (id_len + 1 + left_len + right_len + 2 + sizeof (textentry));
	str = (unsigned char *) ent + id_len + 1 + sizeof (textentry);
	
	if (msgid)
		memcpy (ent_msgid(ent), msgid, id_len);
	ent_msgid(ent)[id_len] = '\0';

	if (left_len)
		memcpy (str, left_text, left_len);


@@ 4699,6 4711,7 @@ gtk_xtext_append_indent (xtext_buffer *buf,
	left_width = gtk_xtext_text_width (buf->xtext, left_text, left_len);

	ent->left_len = left_len;
	ent->msgid_len = id_len;
	ent->str = str;
	ent->str_len = left_len + 1 + right_len;
	ent->indent = (buf->indent - left_width) - buf->xtext->space_width;


@@ 4735,10 4748,16 @@ gtk_xtext_append_indent (xtext_buffer *buf,
}

void
gtk_xtext_append (xtext_buffer *buf, unsigned char *text, int len, time_t stamp)
gtk_xtext_append (xtext_buffer *buf, unsigned char *text, int len, unsigned char *msgid, time_t stamp)
{
	textentry *ent;
	gboolean truncate = FALSE;
	int id_len;
	
	if (msgid)
		id_len = strlen (msgid);
	else
		id_len = 0;

	if (len == -1)
		len = strlen (text);


@@ 4752,9 4771,15 @@ gtk_xtext_append (xtext_buffer *buf, unsigned char *text, int len, time_t stamp)
		truncate = TRUE;
	}

	ent = g_malloc (len + 1 + sizeof (textentry));
	ent->str = (unsigned char *) ent + sizeof (textentry);
	ent = g_malloc (id_len + 1 + len + 1 + sizeof (textentry));
	ent->msgid_len = id_len;
	ent->str = (unsigned char *) ent + sizeof (textentry) + 1 + id_len;
	ent->str_len = len;

	if (msgid)
		memcpy (ent_msgid(ent), msgid, id_len);
	ent_msgid(ent)[id_len] = '\0';
	
	if (len)
	{
		if (!truncate)


@@ 4801,12 4826,12 @@ gtk_xtext_lastlog (xtext_buffer *out, xtext_buffer *search_area)
			if (search_area->xtext->auto_indent)
			{
				gtk_xtext_append_indent (out, ent->str, ent->left_len,
												 ent->str + ent->left_len + 1,
												 ent->str_len - ent->left_len - 1, 0);
							 ent->str + ent->left_len + 1,
							 ent->str_len - ent->left_len - 1, NULL, 0);
			}
			else
			{
				gtk_xtext_append (out, ent->str, ent->str_len, 0);
				gtk_xtext_append (out, ent->str, ent->str_len, NULL, 0);
			}

			if (out->text_last)

M src/fe-gtk/xtext.h => src/fe-gtk/xtext.h +4 -4
@@ 253,11 253,11 @@ struct _GtkXTextClass
};

GtkWidget *gtk_xtext_new (GdkColor palette[], int separator);
void gtk_xtext_append (xtext_buffer *buf, unsigned char *text, int len, time_t stamp);
void gtk_xtext_append (xtext_buffer *buf, unsigned char *text, int len, unsigned char *msgid, time_t stamp);
void gtk_xtext_append_indent (xtext_buffer *buf,
										unsigned char *left_text, int left_len,
										unsigned char *right_text, int right_len,
										time_t stamp);
				unsigned char *left_text, int left_len,
				unsigned char *right_text, int right_len,
				unsigned char *msgid, time_t stamp);
int gtk_xtext_set_font (GtkXText *xtext, char *name);
void gtk_xtext_set_background (GtkXText * xtext, GdkPixmap * pixmap);
void gtk_xtext_set_palette (GtkXText * xtext, GdkColor palette[]);