From aa300c1294e194284a0a150e721b9e961d9201f0 Mon Sep 17 00:00:00 2001 From: Geo Date: Tue, 20 Aug 2024 11:02:57 -0400 Subject: [PATCH] Fix user/chanrecord checking on join (#1678) (cherry picked from commit a688fdd5770f6505d6b7d507b782675b29e60145) --- src/mod/irc.mod/chan.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/mod/irc.mod/chan.c b/src/mod/irc.mod/chan.c index 851132990..2467b2d1b 100644 --- a/src/mod/irc.mod/chan.c +++ b/src/mod/irc.mod/chan.c @@ -2035,11 +2035,10 @@ static int gotjoin(char *from, char *channame) reset_chan_info(chan, CHAN_RESETALL, 1); } else { m = ismember(chan, nick); + u = lookup_user_record(m, account ? account : NULL, from); + get_user_flagrec(u, &fr, chan->dname); if (m && m->split && !strcasecmp(m->userhost, uhost)) { - u = get_user_from_member(m); - get_user_flagrec(u, &fr, chan->dname); check_tcl_rejn(nick, uhost, u, chan->dname); - chan = findchan(chname); if (!chan) { if (ch_dname) @@ -2057,6 +2056,7 @@ static int gotjoin(char *from, char *channame) m->last = now; m->delay = 0L; m->flags = (chan_hasop(m) ? WASOP : 0) | (chan_hashalfop(m) ? WASHALFOP : 0); + m->user = u; set_handle_laston(chan->dname, u, now); m->flags |= STOPWHO; putlog(LOG_JOIN, chan->dname, "%s (%s) returned to %s.", nick, uhost, @@ -2072,6 +2072,7 @@ static int gotjoin(char *from, char *channame) m->delay = 0L; strlcpy(m->nick, nick, sizeof m->nick); strlcpy(m->userhost, uhost, sizeof m->userhost); + m->user = u; m->flags |= STOPWHO; if (extjoin) { @@ -2093,9 +2094,6 @@ static int gotjoin(char *from, char *channame) goto exit; } - /* The record saved in the channel record always gets updated, - * so we can use that. */ - if (match_my_nick(nick)) { /* It was me joining! Need to update the channel record with the * unique name for the channel (as the server see's it).