- {
- matchstr_user = user->ident;
- matchstr_host = user->hostname;
- }
- matchstr_full = alloca(strlen(matchstr_nick) + strlen(matchstr_user) + strlen(matchstr_host) + 4);
- sprintf(matchstr_full, "%s!%s@%s", matchstr_nick, matchstr_user, matchstr_host);
- return match_ircglob(matchstr_full, orig_glob);
+ sprintf(matchstr_full, "%s@%s", user->ident, user->hostname);
+ if(match_ircglob(matchstr_full, orig_glob))
+ return(1);
+
+ /* Check IP hostname (could skip this if same as above?)*/
+ matchstr_host = inet_ntoa(user->ip);
+ matchstr_full = alloca(strlen(user->nick) + strlen(user->ident) + strlen(matchstr_host) + 4);
+ if(include_nick)
+ sprintf(matchstr_full, "%s!%s@%s", user->nick, user->ident, matchstr_host);
+ else
+ sprintf(matchstr_full, "%s@%s", user->ident, matchstr_host);
+ if(match_ircglob(matchstr_full, orig_glob))
+ return(1);
+
+ return(0); /* Didnt match anything */