]> jfr.im git - solanum.git/blame - extensions/m_echotags.c
parse: ensure that aliases have a sufficient number of parameters before trying to...
[solanum.git] / extensions / m_echotags.c
CommitLineData
ca45daba
AC
1#include "stdinc.h"
2#include "modules.h"
3#include "client.h"
4#include "ircd.h"
5#include "send.h"
6
3c7d6fcc 7static void m_echotags(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
ca45daba
AC
8
9struct Message echotags_msgtab = {
02369fa7
EM
10 "ECHOTAGS", 0, 0, 0, 0,
11 { mg_ignore, {m_echotags, 0}, mg_ignore, mg_ignore, mg_ignore, {m_echotags, 0} }
ca45daba
AC
12};
13
14mapi_clist_av1 echotags_clist[] = { &echotags_msgtab, NULL };
15
8699801c 16static const char echotags_desc[] = "A test module for tags";
02369fa7
EM
17
18DECLARE_MODULE_AV2(echotags, NULL, NULL, echotags_clist, NULL, NULL, NULL, NULL, echotags_desc);
ca45daba 19
3c7d6fcc 20static void
ca45daba
AC
21m_echotags(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
22{
23 int i;
24
25 sendto_one_notice(source_p, ":*** You sent %zu tags.", msgbuf_p->n_tags);
26
27 for (i = 0; i < msgbuf_p->n_tags; i++)
28 {
29 struct MsgTag *tag = &msgbuf_p->tags[i];
30
31 if (tag->value)
32 sendto_one_notice(source_p, ":*** %d: %s => %s", i, tag->key, tag->value);
33 else
34 sendto_one_notice(source_p, ":*** %d: %s", i, tag->key);
35 }
ca45daba
AC
36}
37
38