~aleteoryx/sexchat

ff2a8d69791df413ad973da4ebf174e495103277 — Aleteoryx 4 months ago 9fd69c4
soju compatibility in DMs
4 files changed, 32 insertions(+), 12 deletions(-)

M src/common/dcc.c
M src/common/inbound.c
M src/common/inbound.h
M src/common/proto-irc.c
M src/common/dcc.c => src/common/dcc.c +1 -1
@@ 564,7 564,7 @@ dcc_chat_line (struct DCC *dcc, char *line)
							 FALSE, &no_tags);
	} else
	{
		inbound_privmsg (dcc->serv, dcc->nick, "", line, FALSE, &no_tags);
		inbound_privmsg (dcc->serv, dcc->nick, NULL, "", line, FALSE, &no_tags);
	}
	g_free (line);
	return 0;

M src/common/inbound.c => src/common/inbound.c +29 -9
@@ 164,15 164,21 @@ inbound_make_idtext (server *serv, char *idtext, int max, int id)
}

void
inbound_privmsg (server *serv, char *from, char *ip, char *text, int id,
inbound_privmsg (server *serv, char *from, char *to, char *ip, char *text, int id,
					  const message_tags_data *tags_data)
{
	session *sess;
	struct User *user;
	char idtext[64];
	gboolean nodiag = FALSE;
	char *chan;

	sess = find_dialog (serv, from);
	if (g_ascii_strcasecmp(from, serv->nick) == 0)
		chan = to;
	else
		chan = from;

	sess = find_dialog (serv, chan);

	if (sess || prefs.hex_gui_autoopen_dialog)
	{


@@ 181,7 187,7 @@ inbound_privmsg (server *serv, char *from, char *ip, char *text, int id,
		{
			if (flood_check (from, ip, serv, current_sess, 1))
				/* Create a dialog session */
				sess = inbound_open_dialog (serv, from, tags_data);
				sess = inbound_open_dialog (serv, chan, tags_data);
			else
				sess = serv->server_session;
			if (!sess)


@@ 190,11 196,15 @@ inbound_privmsg (server *serv, char *from, char *ip, char *text, int id,

		if (ip && ip[0])
			set_topic (sess, ip, ip);
		inbound_chanmsg (serv, NULL, NULL, from, text, FALSE, tags_data->identified, tags_data);

		if(chan == to)
			inbound_chanmsg (serv, NULL, to, from, text, TRUE, tags_data->identified, tags_data);
		else
			inbound_chanmsg (serv, NULL, NULL, from, text, FALSE, tags_data->identified, tags_data);
		return;
	}

	sess = find_session_from_nick (from, serv);
	sess = find_session_from_nick (chan, serv);
	if (!sess)
	{
		sess = serv->front_session;


@@ 338,7 348,10 @@ inbound_action (session *sess, char *chan, char *from, char *ip, char *text,
	char idtext[64];
	int privaction = FALSE;

	if (!fromme)
	if (g_ascii_strcasecmp(from, serv->nick) == 0)
		fromme = TRUE;

	if (TRUE)
	{
		if (is_channel (serv, chan))
		{


@@ 348,14 361,21 @@ inbound_action (session *sess, char *chan, char *from, char *ip, char *text,
			/* it's a private action! */
			privaction = TRUE;
			/* find a dialog tab for it */
			sess = find_dialog (serv, from);
			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))
					sess = inbound_open_dialog (serv, from, tags_data);
				else
				{
					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)

M src/common/inbound.h => src/common/inbound.h +1 -1
@@ 80,7 80,7 @@ void inbound_chanmsg (server *serv, session *sess, char *chan, char *from,
							 const message_tags_data *tags_data);
void clear_channel (session *sess);
void set_topic (session *sess, char *topic, char *stripped_topic);
void inbound_privmsg (server *serv, char *from, char *ip, char *text, int id, 
void inbound_privmsg (server *serv, char *from, char *to, char *ip, char *text, int id, 
							 const message_tags_data *tags_data);
void inbound_action (session *sess, char *chan, char *from, char *ip,
							char *text, int fromme, int id,

M src/common/proto-irc.c => src/common/proto-irc.c +1 -1
@@ 1322,7 1322,7 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[],
						{
							if (ignore_check (word[1], IG_PRIV))
								return;
							inbound_privmsg (serv, nick, ip, text, tags_data->identified, tags_data);
							inbound_privmsg (serv, nick, to, ip, text, tags_data->identified, tags_data);
						}
					}
				}