struct notice_localdata {
unsigned int marker;
int count;
- int type;
char message[NSMAX_NOTICE_LEN];
};
-struct searchNode *notice_parse(searchCtx *ctx, int type, int argc, char **argv) {
+struct searchNode *notice_parse(searchCtx *ctx, int argc, char **argv) {
struct notice_localdata *localdata;
struct searchNode *thenode;
int len;
return NULL;
}
localdata->count = 0;
- localdata->type = type;
- if (type == SEARCHTYPE_CHANNEL)
+ if (ctx->searchcmd == reg_chansearch)
localdata->marker = nextchanmarker();
- else
+ else if (ctx->searchcmd == reg_nicksearch)
localdata->marker = nextnickmarker();
-
+ else {
+ parseError = "notice: invalid search type";
+ return NULL;
+ }
if (argc==1) {
char *p = argv[0];
if(*p == '\"')
localdata = thenode->localdata;
- if (localdata->type == SEARCHTYPE_CHANNEL) {
+ if (ctx->searchcmd == reg_chansearch) {
cip = (chanindex *)theinput;
cip->marker = localdata->marker;
localdata->count += cip->channel->users->totalusers;
localdata = thenode->localdata;
- if (localdata->type == SEARCHTYPE_CHANNEL) {
+ if (ctx->searchcmd == reg_chansearch) {
nickmarker=nextnickmarker();
for (i=0;i<CHANNELHASHSIZE;i++) {
for (cip=chantable[i];cip;cip=ncip) {