From d821282260891f92db1b6c7068ef5a48cda71e86 Mon Sep 17 00:00:00 2001 From: Elizabeth Myers Date: Mon, 7 Mar 2016 01:05:24 -0600 Subject: [PATCH] cap_server_time: update doodads for AV2 --- modules/cap_account_tag.c | 2 +- modules/cap_server_time.c | 24 ++++++++---------------- 2 files changed, 9 insertions(+), 17 deletions(-) diff --git a/modules/cap_account_tag.c b/modules/cap_account_tag.c index f76a2d7c..d88da242 100644 --- a/modules/cap_account_tag.c +++ b/modules/cap_account_tag.c @@ -46,7 +46,7 @@ mapi_cap_list_av2 cap_account_tag_cap_list[] = { { 0, NULL, NULL, NULL }, }; static const char cap_account_tag_desc[] = - "Provides the account-tag capability"; + "Provides the account-tag client capability"; static void cap_account_tag_process(hook_data *data) diff --git a/modules/cap_server_time.c b/modules/cap_server_time.c index 98d4616e..698263a8 100644 --- a/modules/cap_server_time.c +++ b/modules/cap_server_time.c @@ -35,13 +35,18 @@ #include "inline/stringops.h" static void cap_server_time_process(hook_data *); +unsigned int CLICAP_SERVER_TIME = 0; mapi_hfn_list_av1 cap_server_time_hfnlist[] = { { "outbound_msgbuf", (hookfn) cap_server_time_process }, { NULL, NULL } }; - -unsigned int CLICAP_SERVER_TIME = 0; +mapi_cap_list_av2 cap_server_time_cap_list[] = { + { MAPI_CAP_CLIENT, "server-time", NULL, &CLICAP_SERVER_TIME }, + { 0, NULL, NULL, NULL } +}; +static const char cap_server_time_desc[] = + "Provides the server-time client capability"; static void cap_server_time_process(hook_data *data) @@ -55,17 +60,4 @@ cap_server_time_process(hook_data *data) msgbuf_append_tag(msgbuf, "time", buf, CLICAP_SERVER_TIME); } -static int -_modinit(void) -{ - CLICAP_SERVER_TIME = capability_put(cli_capindex, "server-time", NULL); - return 0; -} - -static void -_moddeinit(void) -{ - capability_orphan(cli_capindex, "server-time"); -} - -DECLARE_MODULE_AV2(cap_server_time, _modinit, _moddeinit, NULL, NULL, cap_server_time_hfnlist, NULL, NULL, NULL); +DECLARE_MODULE_AV2(cap_server_time, NULL, NULL, NULL, NULL, cap_server_time_hfnlist, cap_server_time_cap_list, NULL, cap_server_time_desc);