Finish adding custom operstring support.

This commit is contained in:
B.Greenham 2010-03-03 23:06:32 -05:00
parent 6d1f5fcc73
commit 32d464fe77
3 changed files with 11 additions and 6 deletions

View File

@ -1,6 +1,5 @@
Todo list for ShadowIRCd 6.0
-----------------------------
* custom operstrings
* norepeat cmode
* kicknorejoin (+J in inspircd chmode)
* Anything else we think of between now and release. :P

View File

@ -318,11 +318,14 @@ single_whois(struct Client *source_p, struct Client *target_p, int operspy)
if(IsOper(target_p))
{
sendto_one_numeric(source_p, RPL_WHOISOPERATOR, form_str(RPL_WHOISOPERATOR),
target_p->name,
IsService(target_p) ? ConfigFileEntry.servicestring :
(IsAdmin(target_p) ? GlobalSetOptions.adminstring :
GlobalSetOptions.operstring));
if(md = user_metadata_find(target_p, "OPERSTRING"))
sendto_one_numeric(source_p, 313, "%s :%s", target_p->name, md->value);
else
sendto_one_numeric(source_p, RPL_WHOISOPERATOR, form_str(RPL_WHOISOPERATOR),
target_p->name,
IsService(target_p) ? ConfigFileEntry.servicestring :
(IsAdmin(target_p) ? GlobalSetOptions.adminstring :
GlobalSetOptions.operstring));
if(md = user_metadata_find(target_p, "SWHOIS"))
sendto_one_numeric(source_p, 320, "%s :%s", target_p->name, md->value);
}

View File

@ -1340,6 +1340,9 @@ oper_up(struct Client *source_p, struct oper_conf *oper_p)
if(oper_p->swhois)
user_metadata_add(source_p, "SWHOIS", oper_p->swhois, 1);
if(oper_p->operstring)
user_metadata_add(source_p, "OPERSTRING", oper_p->operstring, 1);
if(oper_p->vhost || !EmptyString(ConfigFileEntry.default_operhost))
{
if(oper_p->vhost)