/***********************************************************************
X3 ChangeLog
+2010-05-06 Matthew Beeching <jobe@mdbnet.co.uk>
+
+ * src/nickserv.c: Added NickServ search title criteria.
+
+ * src/nickserv.help: Added NickServ search title criteria.
+
2010-04-29 Matthew Beeching <jobe@mdbnet.co.uk>
* src/opserv.c: Minor typo in previous commit where returning 0
const char *hostmask;
const char *handlemask;
const char *emailmask;
+ const char *titlemask;
#ifdef WITH_LDAP
unsigned int inldap;
#endif
} else {
discrim->emailmask = argv[i];
}
+ } else if (!irccasecmp(argv[i], "title")) {
+ if (!irccasecmp(argv[++i], "*")) {
+ discrim->titlemask = 0;
+ } else {
+ discrim->titlemask = argv[i];
+ }
} else if (!irccasecmp(argv[i], "access")) {
const char *cmp = argv[++i];
if (cmp[0] == '<') {
static int
nickserv_discrim_match(struct nickserv_discrim *discrim, struct handle_info *hi)
{
+ char *title = NULL;
+
+ if (hi->fakehost && (hi->fakehost[0] == '.'))
+ title = hi->fakehost + 1;
+
if (((discrim->flags_on & hi->flags) != discrim->flags_on)
|| (discrim->flags_off & hi->flags)
|| (discrim->min_registered > hi->registered)
|| (discrim->lastseen < (hi->users?now:hi->lastseen))
|| (discrim->handlemask && !match_ircglob(hi->handle, discrim->handlemask))
|| (discrim->emailmask && (!hi->email_addr || !match_ircglob(hi->email_addr, discrim->emailmask)))
+ || (discrim->titlemask && (!title || !match_ircglob(title, discrim->titlemask)))
|| (discrim->min_level > hi->opserv_level)
|| (discrim->max_level < hi->opserv_level)
|| (discrim->min_karma > hi->karma)
" SEEN - Accounts not seen for at least this long",
" ACCOUNTMASK - A glob that must match the account name",
" EMAIL - A glob that must match the account's email address",
+ " TITLE - A glob that must match the account's title",
" HOSTMASK SUPERSET - Account matches if someone with this hostmask can auth to the account",
" HOSTMASK EXACT - Account matches if this exact hostmask is in list",
" HOSTMASK SUBSET - Account matches if this mask \"covers\" one in their userlist",
" SEEN - Accounts not seen for at least this long",
" ACCOUNTMASK - A glob that must match the account name",
" EMAIL - A glob that must match the account's email address",
+ " TITLE - A glob that must match the account's title",
" NICKMASK - A glob that must match a nick registered to the account",
" HOSTMASK SUPERSET - Account matches if someone with this hostmask can auth to the account",
" HOSTMASK EXACT - Account matches if this exact hostmask is in list",