localdata->marker = nextchanmarker();
else if (ctx->searchcmd == reg_nicksearch)
localdata->marker = nextnickmarker();
+ else if (ctx->searchcmd == reg_whowassearch)
+ localdata->marker = nextwhowasmarker();
else {
free(localdata);
parseError = "gline: invalid search type";
struct gline_localdata *localdata;
nick *np;
chanindex *cip;
+ whowas *ww;
localdata = thenode->localdata;
}
else {
np = (nick *)theinput;
- np->marker = localdata->marker;
+ if (ctx->searchcmd == reg_nicksearch)
+ np->marker = localdata->marker;
+ else {
+ ww = (whowas *)np->next;
+ ww->marker = localdata->marker;
+ }
localdata->count++;
}
struct gline_localdata *localdata;
nick *np, *nnp;
chanindex *cip, *ncip;
+ whowas *ww;
int i, j, hits, safe=0;
time_t ti = time(NULL);
glinebuf gbuf;
}
}
}
- }
- else {
+ } else if (ctx->searchcmd == reg_nicksearch) {
for (i=0;i<NICKHASHSIZE;i++) {
for (np=nicktable[i];np;np=nnp) {
nnp = np->next;
}
}
}
+ } else {
+ for (i = whowasoffset; i < whowasoffset + whowasmax; i++) {
+ ww = &whowasrecs[i % whowasmax];
+
+ if (ww->type == WHOWAS_UNUSED)
+ continue;
+
+ if (ww->marker == localdata->marker) {
+ if(!glineuser(&gbuf, &ww->nick, localdata, ti))
+ safe++;
+ }
+ }
}
- glinebufcounthits(&gbuf, &hits, NULL, NULL);
+ glinebufcounthits(&gbuf, &hits, NULL);
glinebufcommit(&gbuf, 1);
if (safe)