diff --git a/src/chanprog.c b/src/chanprog.c index 3cdbf63c7..ccb67cd63 100644 --- a/src/chanprog.c +++ b/src/chanprog.c @@ -183,14 +183,14 @@ void set_chanlist(const char *host, struct userrec *rec) memberlist *m; struct chanset_t *chan; - strlcpy(buf, host, sizeof buf); - uhost = buf; - nick = splitnick(&uhost); - for (chan = chanset; chan; chan = chan->next) - for (m = chan->channel.member; m && m->nick[0]; m = m->next) - if (!rfc_casecmp(nick, m->nick) && !strcasecmp(uhost, m->userhost)) +// strlcpy(buf, host, sizeof buf); +// uhost = buf; +// nick = splitnick(&uhost); +// for (chan = chanset; chan; chan = chan->next) +// for (m = chan->channel.member; m && m->nick[0]; m = m->next) +// if (!rfc_casecmp(nick, m->nick) && !strcasecmp(uhost, m->userhost)) //XXXXXXXX Does this whole func come out? - m->user = rec; +// m->user = rec; } /* Calculate the memory we should be using diff --git a/src/mod/channels.mod/tclchan.c b/src/mod/channels.mod/tclchan.c index 53ea7e1ad..512702703 100644 --- a/src/mod/channels.mod/tclchan.c +++ b/src/mod/channels.mod/tclchan.c @@ -1731,7 +1731,7 @@ static int tcl_do_masklist(maskrec *m, Tcl_Interp *irp) list[3] = ts1; snprintf(ts2, sizeof ts2, "%" PRId64, (int64_t) m->lastactive); list[4] = ts2; - list[5] = get_user_from_channel(m); + list[5] = m->user; p = Tcl_Merge(6, list); Tcl_AppendElement(irp, p); Tcl_Free((char *) p); diff --git a/src/mod/irc.mod/chan.c b/src/mod/irc.mod/chan.c index cdd8483d1..a7e8e392e 100644 --- a/src/mod/irc.mod/chan.c +++ b/src/mod/irc.mod/chan.c @@ -901,6 +901,7 @@ static void recheck_channel(struct chanset_t *chan, int dobans) { memberlist *m; struct flag_record fr = { FR_GLOBAL | FR_CHAN, 0, 0, 0, 0, 0 }; + struct userrec *u; static int stacking = 0; int stop_reset = 0; @@ -910,10 +911,10 @@ static void recheck_channel(struct chanset_t *chan, int dobans) stacking++; /* Okay, sort through who needs to be deopped. */ for (m = chan->channel.member; m && m->nick[0]; m = m->next) { - if (!get_user_from_channel(m) && !m->tried_getuser) { + if (!m->tried_getuser) { m->tried_getuser = 1; - u = get_user_from_channel(m); } + u = get_user_from_channel(m); get_user_flagrec(u, &fr, chan->dname); if (glob_bot(fr) && chan_hasop(m) && !match_my_nick(m->nick)) stop_reset = 1; diff --git a/src/mod/irc.mod/cmdsirc.c b/src/mod/irc.mod/cmdsirc.c index 8ec56b71a..631630bd3 100644 --- a/src/mod/irc.mod/cmdsirc.c +++ b/src/mod/irc.mod/cmdsirc.c @@ -706,7 +706,6 @@ static void cmd_channel(struct userrec *u, int idx, char *par) char handle[HANDLEN + 1], s[UHOSTLEN], s1[UHOSTLEN], atrflag, chanflag; struct chanset_t *chan; memberlist *m; - struct userrec *u; int maxnicklen, maxhandlen; chan = get_channel(idx, par); diff --git a/src/mod/irc.mod/irc.c b/src/mod/irc.mod/irc.c index 53c4756af..83630aaa6 100644 --- a/src/mod/irc.mod/irc.c +++ b/src/mod/irc.mod/irc.c @@ -186,8 +186,8 @@ static void punish_badguy(struct chanset_t *chan, char *whobad, fr.chan = USER_DEOP; fr.udef_chan = 0; u = get_user_by_handle(userlist, s1); - if ((mx = ismember(chan, badnick))) - mx->user = u; +// if ((mx = ismember(chan, badnick))) +// mx->user = u; set_user_flagrec(u, &fr, chan->dname); simple_sprintf(s, "(%s) %s (%s)", ct, reason, whobad); set_user(&USERENTRY_COMMENT, u, (void *) s); diff --git a/src/mod/irc.mod/mode.c b/src/mod/irc.mod/mode.c index 00d7d7933..52f74b1d5 100644 --- a/src/mod/irc.mod/mode.c +++ b/src/mod/irc.mod/mode.c @@ -1239,7 +1239,7 @@ static int gotmode(char *from, char *origmsg) refresh_who_chan(chan->name); } else { simple_sprintf(s, "%s!%s", m->nick, m->userhost); - get_user_flagrec(get_user_from_channel, &victim, chan->dname); + get_user_flagrec(get_user_from_channel(m), &victim, chan->dname); if (ms2[0] == '+') { m->flags &= ~SENTVOICE; m->flags |= CHANVOICE; diff --git a/src/mod/irc.mod/tclirc.c b/src/mod/irc.mod/tclirc.c index 732bfc518..b4b22e84c 100644 --- a/src/mod/irc.mod/tclirc.c +++ b/src/mod/irc.mod/tclirc.c @@ -27,6 +27,7 @@ static int tcl_chanlist STDVAR int f; memberlist *m; struct chanset_t *chan; + struct userrec *u; struct flag_record plus = { FR_CHAN | FR_GLOBAL | FR_BOT, 0, 0, 0, 0, 0 }, minus = { FR_CHAN | FR_GLOBAL | FR_BOT, 0, 0, 0, 0, 0}, user = { FR_CHAN | FR_GLOBAL | FR_BOT, 0, 0, 0, 0, 0 }; @@ -1106,6 +1107,7 @@ static int tcl_nick2hand STDVAR { memberlist *m; struct chanset_t *chan, *thechan = NULL; + struct userrec *u; BADARGS(2, 3, " nick ?channel?"); diff --git a/src/userrec.c b/src/userrec.c index 8083cc262..9b111d15b 100644 --- a/src/userrec.c +++ b/src/userrec.c @@ -181,10 +181,11 @@ static struct userrec *check_chanlist_hand(const char *hand) memberlist *m; for (chan = chanset; chan; chan = chan->next) - for (m = chan->channel.member; m && m->nick[0]; m = m->next) + for (m = chan->channel.member; m && m->nick[0]; m = m->next) { u = get_user_from_channel(m); if (u && !strcasecmp(u->handle, hand)) return u; + } return NULL; } @@ -229,11 +230,11 @@ struct userrec *get_user_by_handle(struct userrec *bu, char *handle) cache_hit++; return ret; } - ret = check_chanlist_hand(handle); - if (ret) { - cache_hit++; - return ret; - } +// ret = check_chanlist_hand(handle); +// if (ret) { +// cache_hit++; +// return ret; +// } cache_miss++; } for (u = bu; u; u = u->next) @@ -335,12 +336,10 @@ void clear_userlist(struct userrec *bu) /* Find CLOSEST host match * (if "*!*@*" and "*!*@*clemson.edu" both match, use the latter!) - * - * Checks the chanlist first, to possibly avoid needless search. */ struct userrec *get_user_by_host(char *host) { - struct userrec *u, *ret; + struct userrec *u, *ret = NULL; struct list_type *q; int cnt, i; char host2[UHOSTLEN]; @@ -350,12 +349,12 @@ struct userrec *get_user_by_host(char *host) rmspace(host); if (!host[0]) return NULL; - ret = check_chanlist(host); +// ret = check_chanlist(host); cnt = 0; - if (ret != NULL) { - cache_hit++; - return ret; - } +// if (ret != NULL) { +// cache_hit++; +// return ret; +// } cache_miss++; strlcpy(host2, host, sizeof host2); for (u = userlist; u; u = u->next) {