modelist* list;
chan->GetExt(be->GetInfoKey(), list);
- if (list)
+ if (!list)
{
- char mask[MAXBUF];
- snprintf(mask, MAXBUF, "%s!%s@%s", user->nick, user->ident, user->GetIPString());
- for (modelist::iterator it = list->begin(); it != list->end(); it++)
+ // No list, proceed normally
+ return 0;
+ }
+
+ char mask[MAXBUF];
+ snprintf(mask, MAXBUF, "%s!%s@%s", user->nick, user->ident, user->GetIPString());
+
+ for (modelist::iterator it = list->begin(); it != list->end(); it++)
+ {
+ if (match(user->GetFullRealHost(), it->mask.c_str()) || match(user->GetFullHost(), it->mask.c_str()) || (match(mask, it->mask.c_str(), true)))
{
- if (match(user->GetFullRealHost(), it->mask.c_str()) || match(user->GetFullHost(), it->mask.c_str()) || (match(mask, it->mask.c_str(), true)))
- {
- // They match an entry on the list, so let them in.
- return 1;
- }
+ // They match an entry on the list, so let them in.
+ return 1;
}
- return 0;
}
- // or if there wasn't a list, there can't be anyone on it, so we don't need to do anything.
}
return 0;
}