]> jfr.im git - solanum.git/blame - extensions/identify_msg.c
m_stats: z: remove unnecessary casting and fix format strings
[solanum.git] / extensions / identify_msg.c
CommitLineData
94613c78
EK
1#include <stdinc.h>
2#include <modules.h>
3#include <msgbuf.h>
4
5static const char identify_msg_desc[] = "Provides the solanum.chat/identify-msg client capability";
6
7static void identmsg_outbound(void *);
8unsigned int CLICAP_IDENTIFY_MSG = 0;
9
10mapi_cap_list_av2 identmsg_cap_list[] = {
11 { MAPI_CAP_CLIENT, "solanum.chat/identify-msg", NULL, &CLICAP_IDENTIFY_MSG },
12 { 0, NULL, NULL, NULL }
13};
14
15static mapi_hfn_list_av1 identmsg_hfnlist[] = {
16 { "outbound_msgbuf", identmsg_outbound },
17 { NULL, NULL }
18};
19
20static void identmsg_outbound(void *data_)
21{
22 hook_data *data = data_;
23 struct MsgBuf *msgbuf = data->arg1;
24
25 if (IsIdentified(data->client))
26 msgbuf_append_tag(msgbuf, "solanum.chat/identified", NULL, CLICAP_IDENTIFY_MSG);
27}
28
29DECLARE_MODULE_AV2(identify_msg, NULL, NULL, NULL, NULL, identmsg_hfnlist, identmsg_cap_list, NULL, identify_msg_desc);