]> jfr.im git - solanum.git/blame - extensions/m_echotags.c
Move irc_* data structures to librb.
[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
7static int m_echotags(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
8
9struct Message echotags_msgtab = {
7baa37a9 10 "ECHOTAGS", 0, 0, 0, 0,
ca45daba
AC
11 { mg_ignore, {m_echotags, 0}, mg_ignore, mg_ignore, mg_ignore, {m_echotags, 0} }
12};
13
14mapi_clist_av1 echotags_clist[] = { &echotags_msgtab, NULL };
15
c6d81c6d 16DECLARE_MODULE_AV1(echotags, NULL, NULL, echotags_clist, NULL, NULL, "$Id$");
ca45daba
AC
17
18static int
19m_echotags(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
20{
21 int i;
22
23 sendto_one_notice(source_p, ":*** You sent %zu tags.", msgbuf_p->n_tags);
24
25 for (i = 0; i < msgbuf_p->n_tags; i++)
26 {
27 struct MsgTag *tag = &msgbuf_p->tags[i];
28
29 if (tag->value)
30 sendto_one_notice(source_p, ":*** %d: %s => %s", i, tag->key, tag->value);
31 else
32 sendto_one_notice(source_p, ":*** %d: %s", i, tag->key);
33 }
34
35 return 0;
36}
37
38