#include "s_conf.h"
#include "s_newconf.h"
-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[]);
+static int m_privs(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
+static int me_privs(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
+static int mo_privs(struct MsgBuf *msgbuf_p, 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}}
+ "PRIVS", 0, 0, 0, 0,
+ {mg_unreg, {m_privs, 0}, mg_ignore, mg_ignore, {me_privs, 0}, {mo_privs, 0}}
};
mapi_clist_av1 privs_clist[] = {
struct mode_table
{
const char *name;
- int mode;
+ unsigned int mode;
};
/* there is no such table like this anywhere else */
{"spambot_exempt", FLAGS2_EXEMPTSPAMBOT },
{"shide_exempt", FLAGS2_EXEMPTSHIDE },
{"jupe_exempt", FLAGS2_EXEMPTJUPE },
+ {"extend_chans", FLAGS2_EXTENDCHANS },
{NULL, 0}
};
target_p->name, buf);
}
-static int me_privs(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
+static int me_privs(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
struct Client *target_p;
return 0;
}
-static int mo_privs(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
+static int mo_privs(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
struct Client *target_p;
use_id(target_p));
return 0;
}
+
+static int m_privs(struct MsgBuf *msgbuf_p, 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;
+}