Skip to content

Commit

Permalink
Fix user/chanrecord checking on join (#1678)
Browse files Browse the repository at this point in the history
  • Loading branch information
vanosg authored Aug 20, 2024
1 parent f80f8ae commit a688fdd
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/mod/irc.mod/chan.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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,
Expand All @@ -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) {
Expand All @@ -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). <cybah>
Expand Down

0 comments on commit a688fdd

Please sign in to comment.