summary refs log tree commit diff stats
path: root/src/common
diff options
context:
space:
mode:
authorTingPing <tingping@tingping.se>2014-04-06 15:22:51 -0400
committerTingPing <tingping@tingping.se>2014-04-06 15:33:22 -0400
commitb41bd594b0324c4aa0d02ec35ad1efdcf2d4f6db (patch)
tree41a0e185a4d730f4100ffeb979bd4d4f28172b9f /src/common
parent0f828dd74f9ea81fe70c8a101a7aa7c40737437a (diff)
Add account to Join event
Also reorganizes some logic. The account will usually be NULL unless
extended-join capability enabled.

Closes #934
Diffstat (limited to 'src/common')
-rw-r--r--src/common/inbound.c2
-rw-r--r--src/common/proto-irc.c6
-rw-r--r--src/common/text.c1
-rw-r--r--src/common/textevents.in2
-rw-r--r--src/common/userlist.c2
5 files changed, 9 insertions, 4 deletions
diff --git a/src/common/inbound.c b/src/common/inbound.c
index 3737e479..401e9562 100644
--- a/src/common/inbound.c
+++ b/src/common/inbound.c
@@ -778,7 +778,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, NULL, 0,
+		EMIT_SIGNAL_TIMESTAMP (XP_TE_JOIN, sess, user, chan, ip, account, 0,
 									  tags_data->timestamp);
 		userlist_add (sess, user, ip, account, realname, tags_data);
 	}
diff --git a/src/common/proto-irc.c b/src/common/proto-irc.c
index 8f31d5c1..fa5446c4 100644
--- a/src/common/proto-irc.c
+++ b/src/common/proto-irc.c
@@ -1042,8 +1042,12 @@ process_named_msg (session *sess, char *type, char *word[], char *word_eol[],
 			{
 				char *chan = word[3];
 				char *account = word[4];
-				char *realname = word_eol[5] + 1;
+				char *realname = word_eol[5];
 
+				if (account && strcmp (account, "*") == 0)
+					account = NULL;
+				if (realname && *realname == ':')
+					realname++;
 				if (*chan == ':')
 					chan++;
 				if (!serv->p_cmp (nick, serv->nick))
diff --git a/src/common/text.c b/src/common/text.c
index e7cef398..cac76054 100644
--- a/src/common/text.c
+++ b/src/common/text.c
@@ -1026,6 +1026,7 @@ static char * const pevt_join_help[] = {
 	N_("The nick of the joining person"),
 	N_("The channel being joined"),
 	N_("The host of the person"),
+	N_("The account of the person"),
 };
 
 static char * const pevt_chanaction_help[] = {
diff --git a/src/common/textevents.in b/src/common/textevents.in
index 3631e363..26e2b3e3 100644
--- a/src/common/textevents.in
+++ b/src/common/textevents.in
@@ -494,7 +494,7 @@ Join
 XP_TE_JOIN
 pevt_join_help
 %C23*$t$1 ($3%C23) has joined
-3
+4
 
 Keyword
 XP_TE_KEYWORD
diff --git a/src/common/userlist.c b/src/common/userlist.c
index 7565fcd4..e08cb857 100644
--- a/src/common/userlist.c
+++ b/src/common/userlist.c
@@ -416,7 +416,7 @@ userlist_add (struct session *sess, char *name, char *hostname,
 	/* extended join info */
 	if (sess->server->have_extjoin)
 	{
-		if (account && strcmp (account, "*") != 0)
+		if (account && *account)
 			user->account = strdup (account);
 		if (realname && *realname)
 			user->realname = strdup (realname);