Skip to content

Commit

Permalink
Remove negative user caching
Browse files Browse the repository at this point in the history
  • Loading branch information
thommey committed May 25, 2024
1 parent 4a93ace commit c14d816
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/chan.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
int tried_getuser;
struct memstruct *next;
} memberlist;

Expand Down Expand Up @@ -130,6 +129,7 @@ struct chan_t {
char *topic;
char *key;
unsigned int mode;
int tried_getuser; // TODO: use it to invalidate user cache
int maxmembers;
int members;
};
Expand Down
2 changes: 1 addition & 1 deletion src/chanprog.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ void clear_chanlist(void)
}

/* Clear the user pointer of a specific nick in the chanlists.
*
* Necessary when a hostmask is added/removed, a nick changes, etc.
* Does not completely invalidate the channel cache like clear_chanlist().
*/
Expand Down
3 changes: 0 additions & 3 deletions src/mod/irc.mod/chan.c
Original file line number Diff line number Diff line change
Expand Up @@ -910,9 +910,6 @@ 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 (!m->tried_getuser) {
m->tried_getuser = 1;
}
u = get_user_from_member(m);
get_user_flagrec(u, &fr, chan->dname);
if (glob_bot(fr) && chan_hasop(m) && !match_my_nick(m->nick))
Expand Down
7 changes: 0 additions & 7 deletions src/mod/irc.mod/tclirc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1045,10 +1045,6 @@ static int tcl_hand2nicks STDVAR
for (m = chan->channel.member; m && m->nick[0]; m = m->next) {
found = 0;
u = get_user_from_member(m);
/* Does this user have the account we're looking for? */
if (!u && !m->tried_getuser) {
m->tried_getuser = 1;
}
if (u && !strcasecmp(u->handle, argv[1])) {
/* Is the nick of the user already in the list? */
Tcl_ListObjGetElements(irp, nicks, &nicksc, &nicksv);
Expand Down Expand Up @@ -1090,9 +1086,6 @@ static int tcl_hand2nick STDVAR
while (chan && (thechan == NULL || thechan == chan)) {
for (m = chan->channel.member; m && m->nick[0]; m = m->next) {
u = get_user_from_member(m);
if (!u && !m->tried_getuser) {
m->tried_getuser = 1;
}
if (u && !strcasecmp(u->handle, argv[1])) {
Tcl_AppendResult(irp, m->nick, NULL);
return TCL_OK;
Expand Down

0 comments on commit c14d816

Please sign in to comment.