/*
- * charybdis: an advanced ircd.
+ * Solanum: a slightly advanced ircd
* cap_account_tag.c: implement the account-tag IRCv3.2 capability
*
- * Copyright (c) 2016 William Pitcock <nenolod@dereferenced.org>
+ * Copyright (c) 2016 Ariadne Conill <ariadne@dereferenced.org>
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
#include "chmode.h"
#include "inline/stringops.h"
-static void cap_account_tag_process(hook_data *);
+static const char cap_account_tag_desc[] =
+ "Provides the account-tag client capability";
+
+static void cap_account_tag_process(void *);
+unsigned int CLICAP_ACCOUNT_TAG = 0;
mapi_hfn_list_av1 cap_account_tag_hfnlist[] = {
- { "outbound_msgbuf", (hookfn) cap_account_tag_process },
+ { "outbound_msgbuf", cap_account_tag_process },
{ NULL, NULL }
};
-
-unsigned int CLICAP_ACCOUNT_TAG = 0;
-
+mapi_cap_list_av2 cap_account_tag_cap_list[] = {
+ { MAPI_CAP_CLIENT, "account-tag", NULL, &CLICAP_ACCOUNT_TAG },
+ { 0, NULL, NULL, NULL },
+};
static void
-cap_account_tag_process(hook_data *data)
+cap_account_tag_process(void *data_)
{
+ hook_data *data = data_;
struct MsgBuf *msgbuf = data->arg1;
if (data->client != NULL && IsPerson(data->client) && *data->client->user->suser)
msgbuf_append_tag(msgbuf, "account", data->client->user->suser, CLICAP_ACCOUNT_TAG);
}
-static int
-_modinit(void)
-{
- CLICAP_ACCOUNT_TAG = capability_put(cli_capindex, "account-tag", NULL);
- return 0;
-}
-
-static void
-_moddeinit(void)
-{
- capability_orphan(cli_capindex, "account-tag");
-}
-
-DECLARE_MODULE_AV1(cap_account_tag, _modinit, _moddeinit, NULL, NULL, cap_account_tag_hfnlist, "$Revision$");
+DECLARE_MODULE_AV2(cap_account_tag, NULL, NULL, NULL, NULL, cap_account_tag_hfnlist, cap_account_tag_cap_list, NULL, cap_account_tag_desc);