diff --git a/src/chan.h b/src/chan.h index 417e55990..91ebec80c 100644 --- a/src/chan.h +++ b/src/chan.h @@ -50,7 +50,6 @@ typedef struct memstruct { time_t split; /* in case they were just netsplit */ time_t last; /* for measuring idle time */ time_t delay; /* for delayed autoop */ -// struct userrec *user; int tried_getuser; struct memstruct *next; } memberlist; diff --git a/src/chanprog.c b/src/chanprog.c index ccb67cd63..49c046d1d 100644 --- a/src/chanprog.c +++ b/src/chanprog.c @@ -116,31 +116,6 @@ struct chanset_t *findchan_by_dname(const char *name) return NULL; } - -/* - * "caching" functions - */ - -/* Shortcut for get_user_by_host -- might have user record in one - * of the channel caches. - */ -struct userrec *check_chanlist(const char *host) -{ - char *nick, *uhost, buf[UHOSTLEN]; - 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)) -//XXXXXXXX loop? Does this whole func come out? - return get_user_from_channel(m); - return NULL; -} - /* Clear the user pointers in the chanlists. * * Necessary when a hostmask is added/removed, a user is added or a new @@ -175,24 +150,6 @@ void clear_chanlist_member(const char *nick) } } -/* If this user@host is in a channel, set it (it was null) - */ -void set_chanlist(const char *host, struct userrec *rec) -{ - char *nick, *uhost, buf[UHOSTLEN]; - 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)) -//XXXXXXXX Does this whole func come out? -// m->user = rec; -} - /* Calculate the memory we should be using */ int expmem_chanprog() diff --git a/src/mod/irc.mod/irc.c b/src/mod/irc.mod/irc.c index 83630aaa6..e94189ded 100644 --- a/src/mod/irc.mod/irc.c +++ b/src/mod/irc.mod/irc.c @@ -142,7 +142,6 @@ static void punish_badguy(struct chanset_t *chan, char *whobad, /* Set the offender +d */ if ((chan->revenge_mode > 0) && !(chan_deop(fr) || glob_deop(fr))) { char s[UHOSTLEN], s1[UHOSTLEN]; - memberlist *mx = NULL; /* Removing op */ if (chan_op(fr) || (glob_op(fr) && !chan_deop(fr))) { @@ -186,8 +185,6 @@ 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; 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/userrec.c b/src/userrec.c index 9b111d15b..9b67389d9 100644 --- a/src/userrec.c +++ b/src/userrec.c @@ -80,7 +80,6 @@ static int expmem_mask(struct maskrec *m) for (; m; m = m->next) { result += sizeof(struct maskrec); result += strlen(m->mask) + 1; -//XXXXXXXX How to handle this one? if (m->user) result += strlen(m->user) + 1; if (m->desc) @@ -172,23 +171,6 @@ static struct userrec *check_dcclist_hand(char *handle) return NULL; } -/* Shortcut for get_user_by_handle -- might have user record in channels - */ -static struct userrec *check_chanlist_hand(const char *hand) -{ - struct chanset_t *chan; - struct userrec *u; - memberlist *m; - - for (chan = chanset; chan; chan = chan->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; -} - /* Search userlist for a provided account name * Returns: userrecord for user containing the account */ @@ -230,11 +212,6 @@ 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; -// } cache_miss++; } for (u = bu; u; u = u->next) @@ -349,12 +326,7 @@ struct userrec *get_user_by_host(char *host) rmspace(host); if (!host[0]) return NULL; -// ret = check_chanlist(host); cnt = 0; -// if (ret != NULL) { -// cache_hit++; -// return ret; -// } cache_miss++; strlcpy(host2, host, sizeof host2); for (u = userlist; u; u = u->next) { @@ -369,7 +341,6 @@ struct userrec *get_user_by_host(char *host) } if (ret != NULL) { lastuser = ret; - set_chanlist(host2, ret); } return ret; }