Skip to content

Commit

Permalink
Add account to Join event
Browse files Browse the repository at this point in the history
Also reorganizes some logic. The account will usually be NULL unless
extended-join capability enabled.

Closes hexchat#934
  • Loading branch information
TingPing committed Apr 6, 2014
1 parent 0f828dd commit b41bd59
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/common/inbound.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
6 changes: 5 additions & 1 deletion src/common/proto-irc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
1 change: 1 addition & 0 deletions src/common/text.c
Original file line number Diff line number Diff line change
Expand Up @@ -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[] = {
Expand Down
2 changes: 1 addition & 1 deletion src/common/textevents.in
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ Join
XP_TE_JOIN
pevt_join_help
%C23*$t$1 ($3%C23) has joined
3
4

Keyword
XP_TE_KEYWORD
Expand Down
2 changes: 1 addition & 1 deletion src/common/userlist.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b41bd59

Please sign in to comment.