diff --git a/src/mod/irc.mod/chan.c b/src/mod/irc.mod/chan.c index 6395ce547..d9a25ef1d 100644 --- a/src/mod/irc.mod/chan.c +++ b/src/mod/irc.mod/chan.c @@ -240,11 +240,7 @@ static int detect_chan_flood(char *floodnick, char *floodhost, char *from, if (!m && (which != FLOOD_JOIN)) return 0; - if (which == FLOOD_JOIN) { - u = lookup_user_record(m, victim_or_account, from); - } else { - u = get_user_from_member(m); - } + u = lookup_user_record(m, victim_or_account, from); get_user_flagrec(u, &fr, chan->dname); if (glob_bot(fr) || ((which == FLOOD_DEOP) && (glob_master(fr) || chan_master(fr)) && (glob_friend(fr) || chan_friend(fr))) || @@ -329,11 +325,6 @@ static int detect_chan_flood(char *floodnick, char *floodhost, char *from, chan->floodwho[which][0] = 0; if (which == FLOOD_DEOP) chan->deopd[0] = 0; - if (which == FLOOD_JOIN) { - u = lookup_user_record(m, victim_or_account, from); - } else { - u = get_user_from_member(m); - } if (check_tcl_flud(floodnick, floodhost, u, ftype, chan->dname)) return 0; switch (which) { diff --git a/src/mod/irc.mod/irc.c b/src/mod/irc.mod/irc.c index 620239ccc..47a9d80c1 100644 --- a/src/mod/irc.mod/irc.c +++ b/src/mod/irc.mod/irc.c @@ -918,7 +918,7 @@ static int check_tcl_pub(char *nick, char *from, char *chname, char *msg) simple_sprintf(host, "%s!%s", nick, from); chan = findchan(chname); m = ismember(chan, nick); - lookup_user_record(m ? m : check_all_chan_records(nick), NULL, from); // TODO: get account from msgtags + u = lookup_user_record(m ? m : check_all_chan_records(nick), NULL, from); // TODO: get account from msgtags hand = u ? u->handle : "*"; get_user_flagrec(u, &fr, chname); Tcl_SetVar(interp, "_pub1", nick, 0); @@ -948,7 +948,7 @@ static int check_tcl_pubm(char *nick, char *from, char *chname, char *msg) simple_sprintf(host, "%s!%s", nick, from); chan = findchan(chname); m = ismember(chan, nick); - lookup_user_record(m ? m : check_all_chan_records(nick), NULL, from); // TODO: get account from msgtags + u = lookup_user_record(m ? m : check_all_chan_records(nick), NULL, from); // TODO: get account from msgtags get_user_flagrec(u, &fr, chname); Tcl_SetVar(interp, "_pubm1", nick, 0); Tcl_SetVar(interp, "_pubm2", from, 0); diff --git a/src/mod/irc.mod/mode.c b/src/mod/irc.mod/mode.c index f00c4a610..5350fafd7 100644 --- a/src/mod/irc.mod/mode.c +++ b/src/mod/irc.mod/mode.c @@ -1019,7 +1019,7 @@ static int gotmode(char *from, char *origmsg) nick = splitnick(&from); m = ismember(chan, nick); if (m) { - u = lookup_user_record(m, NULL, from); + u = get_user_from_member(m); get_user_flagrec(u, &user, ch); m->last = now; } else {