| 1 |
/* os_helpme.c - set user mode +h |
| 2 |
* [email protected] |
| 3 |
*/ |
| 4 |
|
| 5 |
#include "atheme-compat.h" |
| 6 |
|
| 7 |
#if (CURRENT_ABI_REVISION < 730000) |
| 8 |
# include "uplink.h" /* sts() */ |
| 9 |
#endif |
| 10 |
|
| 11 |
static void |
| 12 |
os_cmd_helpme(sourceinfo_t *si, int parc, char *parv[]) |
| 13 |
{ |
| 14 |
service_t *svs; |
| 15 |
|
| 16 |
svs = service_find("operserv"); |
| 17 |
|
| 18 |
sts(":%s MODE %s :+h", svs->nick, si->su->nick); |
| 19 |
command_success_nodata(si, _("You are now a network helper.")); |
| 20 |
} |
| 21 |
|
| 22 |
static command_t os_helpme = { |
| 23 |
.name = "HELPME", |
| 24 |
.desc = N_("Makes you into a network helper."), |
| 25 |
.access = PRIV_HELPER, |
| 26 |
.maxparc = 0, |
| 27 |
.cmd = &os_cmd_helpme, |
| 28 |
.help = { .path = "contrib/helpme" }, |
| 29 |
}; |
| 30 |
|
| 31 |
static void |
| 32 |
mod_init(module_t *const restrict m) |
| 33 |
{ |
| 34 |
service_named_bind_command("operserv", &os_helpme); |
| 35 |
} |
| 36 |
|
| 37 |
static void |
| 38 |
mod_deinit(const module_unload_intent_t intent) |
| 39 |
{ |
| 40 |
service_named_unbind_command("operserv", &os_helpme); |
| 41 |
} |
| 42 |
|
| 43 |
VENDOR_DECLARE_MODULE_V1("contrib/os_helpme", MODULE_UNLOAD_CAPABILITY_OK, CONTRIB_VENDOR_ELLY) |