0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-07-04 17:48:35 +02:00

Allow normal users to do PRIVS on themselves.

This basically shows a subset of the information shown by the notices
on connect like "*** You are exempt from K/X lines".
This commit is contained in:
Jilles Tjoelker 2012-02-04 18:46:28 +01:00
parent 3e910a1847
commit ed11b18f0f

View file

@ -40,12 +40,13 @@
#include "s_conf.h"
#include "s_newconf.h"
static int m_privs(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
static int me_privs(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
static int mo_privs(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
struct Message privs_msgtab = {
"PRIVS", 0, 0, 0, MFLG_SLOW,
{mg_unreg, mg_not_oper, mg_ignore, mg_ignore, {me_privs, 0}, {mo_privs, 0}}
{mg_unreg, {m_privs, 0}, mg_ignore, mg_ignore, {me_privs, 0}, {mo_privs, 0}}
};
mapi_clist_av1 privs_clist[] = {
@ -151,3 +152,16 @@ static int mo_privs(struct Client *client_p, struct Client *source_p, int parc,
use_id(target_p));
return 0;
}
static int m_privs(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
if (parc >= 2 && !EmptyString(parv[1]) &&
irccmp(parv[1], source_p->name)) {
sendto_one_numeric(source_p, ERR_NOPRIVILEGES,
form_str(ERR_NOPRIVILEGES));
return 0;
}
show_privs(source_p, source_p);
return 0;
}