whowas *ww;
int i;
- if (ctx->searchcmd == reg_nicksearch) {
+ if (ctx->searchcmd == reg_whowassearch) {
+ ww = (whowas *)np->next; /* Eww. */
+
+ for (i = 0; i < WW_MAXCHANNELS; i++)
+ if (ww->channels[i] == cip)
+ return (void *)1;
+ } else {
cp = cip->channel;
if (!cp)
if (getnumerichandlefromchanhash(cp->users, np->numeric))
return (void *)1;
- } else {
- ww = (whowas *)np->next; /* Eww. */
-
- for (i = 0; i < WW_MAXCHANNELS; i++)
- if (ww->channels[i] == cip)
- return (void *)1;
}
return (void *)0;
if (ctx->searchcmd == reg_chansearch) {
flaglist=cmodeflags;
- } else if (ctx->searchcmd == reg_nicksearch || ctx->searchcmd == reg_whowassearch) {
- flaglist=umodeflags;
} else {
- parseError="modes: unsupported search type";
- return NULL;
+ flaglist=umodeflags;
}
if (!(localdata=(struct modes_localdata *)malloc(sizeof(struct modes_localdata)))) {
if (!cip->channel)
return NULL;
flags=cip->channel->flags;
- } else if (ctx->searchcmd == reg_nicksearch || ctx->searchcmd == reg_whowassearch) {
+ } else {
np=(nick *)value;
flags=np->umodes;
- } else {
- return NULL;
}
if (~flags & (localdata->setmodes))
free(localdata);
return NULL;
}
- } else if (ctx->searchcmd == reg_nicksearch || ctx->searchcmd == reg_whowassearch) {
+ } else {
if (argc) {
parseError="nick: usage: (match (nick) target)";
free(localdata);
return NULL;
}
localdata->np = NULL;
- } else {
- parseError="nick: invalid search command";
- free(localdata);
- return NULL;
}
if (!(thenode=(struct searchNode *)malloc(sizeof(struct searchNode)))) {