diff --git a/src/core/nick-rec.h b/src/core/nick-rec.h index 1463f9f3..53bc7098 100644 --- a/src/core/nick-rec.h +++ b/src/core/nick-rec.h @@ -8,6 +8,7 @@ time_t last_check; /* last time gone was checked */ char *nick; char *host; char *realname; +char *account; int hops; /* status in server */ diff --git a/src/fe-common/core/fe-messages.c b/src/fe-common/core/fe-messages.c index 5edac26d..4e1c2596 100644 --- a/src/fe-common/core/fe-messages.c +++ b/src/fe-common/core/fe-messages.c @@ -349,14 +349,15 @@ static void sig_message_own_private(SERVER_REC *server, const char *msg, } static void sig_message_join(SERVER_REC *server, const char *channel, - const char *nick, const char *address) + const char *nick, const char *address, + const char *account, const char *realname) { int level = MSGLEVEL_JOINS; ignore_check_plus(server, nick, address, channel, NULL, &level, FALSE); printformat(server, channel, level, - TXT_JOIN, nick, address, channel); + TXT_JOIN, nick, address, channel, account, realname); } static void sig_message_part(SERVER_REC *server, const char *channel, diff --git a/src/fe-common/core/module-formats.c b/src/fe-common/core/module-formats.c index 0c41e68b..50d8d7cc 100644 --- a/src/fe-common/core/module-formats.c +++ b/src/fe-common/core/module-formats.c @@ -94,7 +94,7 @@ FORMAT_REC fecommon_core_formats[] = { /* ---- */ { NULL, "Channels", 0 }, - { "join", "{channick_hilight $0} {chanhost_hilight $1} has joined {channel $2}", 3, { 0, 0, 0 } }, + { "join", "{channick_hilight $0} {chanhost_hilight $1} has joined {channel $2}", 5, { 0, 0, 0, 0, 0 } }, { "part", "{channick $0} {chanhost $1} has left {channel $2} {reason $3}", 4, { 0, 0, 0, 0 } }, { "kick", "{channick $0} was kicked from {channel $1} by {nick $2} {reason $3}", 5, { 0, 0, 0, 0, 0 } }, { "quit", "{channick $0} {chanhost $1} has quit {reason $2}", 4, { 0, 0, 0, 0 } }, diff --git a/src/fe-common/irc/fe-events.c b/src/fe-common/irc/fe-events.c index 30f00efc..8b3fe3ec 100644 --- a/src/fe-common/irc/fe-events.c +++ b/src/fe-common/irc/fe-events.c @@ -113,16 +113,16 @@ static void event_notice(IRC_SERVER_REC *server, const char *data, static void event_join(IRC_SERVER_REC *server, const char *data, const char *nick, const char *addr) { - char *params, *channel, *tmp; + char *params, *channel, *tmp, *account, *realname; g_return_if_fail(data != NULL); - params = event_get_params(data, 1, &channel); + params = event_get_params(data, 3, &channel, &account, &realname); tmp = strchr(channel, 7); /* ^G does something weird.. */ if (tmp != NULL) *tmp = '\0'; - signal_emit("message join", 4, server, - get_visible_target(server, channel), nick, addr); + signal_emit("message join", 6, server, + get_visible_target(server, channel), nick, addr, account, realname); g_free(params); } diff --git a/src/irc/core/irc-servers.c b/src/irc/core/irc-servers.c index 118f7242..16bc9922 100644 --- a/src/irc/core/irc-servers.c +++ b/src/irc/core/irc-servers.c @@ -239,6 +239,7 @@ static void server_init(IRC_SERVER_REC *server) irc_cap_toggle(server, CAP_SASL, TRUE); irc_cap_toggle(server, CAP_MULTI_PREFIX, TRUE); + irc_cap_toggle(server, CAP_EXTENDED_JOIN, TRUE); irc_send_cmd_now(server, "CAP LS " CAP_LS_VERSION); diff --git a/src/irc/core/irc-servers.h b/src/irc/core/irc-servers.h index df0446cb..7539a1fa 100644 --- a/src/irc/core/irc-servers.h +++ b/src/irc/core/irc-servers.h @@ -8,6 +8,7 @@ #define CAP_LS_VERSION "302" #define CAP_SASL "sasl" #define CAP_MULTI_PREFIX "multi-prefix" +#define CAP_EXTENDED_JOIN "extended-join" /* returns IRC_SERVER_REC if it's IRC server, NULL if it isn't */ #define IRC_SERVER(server) \ diff --git a/src/irc/core/massjoin.c b/src/irc/core/massjoin.c index ec63a0b3..4a3f085d 100644 --- a/src/irc/core/massjoin.c +++ b/src/irc/core/massjoin.c @@ -35,7 +35,7 @@ static int massjoin_max_joins; static void event_join(IRC_SERVER_REC *server, const char *data, const char *nick, const char *address) { - char *params, *channel, *ptr; + char *params, *channel, *account, *realname, *ptr; IRC_CHANNEL_REC *chanrec; NICK_REC *nickrec; GSList *nicks, *tmp; @@ -47,7 +47,8 @@ static void event_join(IRC_SERVER_REC *server, const char *data, return; } - params = event_get_params(data, 1, &channel); + params = event_get_params(data, 3, &channel, &account, &realname); + ptr = strchr(channel, 7); /* ^G does something weird.. */ if (ptr != NULL) *ptr = '\0'; @@ -66,6 +67,11 @@ static void event_join(IRC_SERVER_REC *server, const char *data, /* add user to nicklist */ nickrec = irc_nicklist_insert(chanrec, nick, FALSE, FALSE, FALSE, TRUE, NULL); + if (*account != '\0' && g_strcmp0(nickrec->account, account) != 0) { + g_free(nickrec->account); + nickrec->account = g_strdup(account); + } + nicklist_set_host(CHANNEL(chanrec), nickrec, address); if (chanrec->massjoins == 0) { @@ -92,6 +98,11 @@ static void event_join(IRC_SERVER_REC *server, const char *data, g_slist_free(nicks); } + if (*realname != '\0' && g_strcmp0(nickrec->realname, realname) != 0) { + g_free(nickrec->realname); + nickrec->realname = g_strdup(realname); + } + chanrec->massjoins++; } diff --git a/src/perl/perl-common.c b/src/perl/perl-common.c index a2c7ffe4..31650cc4 100644 --- a/src/perl/perl-common.c +++ b/src/perl/perl-common.c @@ -426,6 +426,7 @@ void perl_nick_fill_hash(HV *hv, NICK_REC *nick) (void) hv_store(hv, "nick", 4, new_pv(nick->nick), 0); (void) hv_store(hv, "host", 4, new_pv(nick->host), 0); (void) hv_store(hv, "realname", 8, new_pv(nick->realname), 0); + (void) hv_store(hv, "account", 7, new_pv(nick->account), 0); (void) hv_store(hv, "hops", 4, newSViv(nick->hops), 0); (void) hv_store(hv, "gone", 4, newSViv(nick->gone), 0);