static int mo_privs(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]) { struct Client *target_p; if (parc < 2 || EmptyString(parv[1])) target_p = source_p; else { target_p = find_named_person(parv[1]); if (target_p == NULL) { sendto_one_numeric(source_p, ERR_NOSUCHNICK, form_str(ERR_NOSUCHNICK), parv[1]); return 0; } } if (MyClient(target_p)) show_privs(source_p, target_p); else sendto_one(target_p, ":%s ENCAP %s PRIVS %s", get_id(source_p, target_p), target_p->servptr->name, 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; }
static int me_privs(struct Client *client_p, struct Client *source_p, int parc, const char *parv[]) { struct Client *target_p; if (!IsOper(source_p) || parc < 2 || EmptyString(parv[1])) return 0; /* we cannot show privs for remote clients */ if((target_p = find_person(parv[1])) && MyClient(target_p)) show_privs(source_p, target_p); return 0; }