extensions: add m_echotags extension to echo back your tags in NOTICE form

This commit is contained in:
William Pitcock 2016-02-10 21:00:27 -06:00
parent 428ca87b01
commit ca45daba73
3 changed files with 55 additions and 8 deletions

View file

@ -45,6 +45,7 @@ extension_LTLIBRARIES = \
sno_whois.la \
m_42.la \
m_adminwall.la \
m_echotags.la \
m_extendchans.la \
m_findforwards.la \
m_identify.la \

View file

@ -236,6 +236,9 @@ m_42_la_OBJECTS = m_42.lo
m_adminwall_la_LIBADD =
m_adminwall_la_SOURCES = m_adminwall.c
m_adminwall_la_OBJECTS = m_adminwall.lo
m_echotags_la_LIBADD =
m_echotags_la_SOURCES = m_echotags.c
m_echotags_la_OBJECTS = m_echotags.lo
m_extendchans_la_LIBADD =
m_extendchans_la_SOURCES = m_extendchans.c
m_extendchans_la_OBJECTS = m_extendchans.lo
@ -369,10 +372,10 @@ SOURCES = chm_adminonly.c chm_insecure.c chm_nonotice.c chm_operonly.c \
extb_ssl.c extb_usermode.c force_user_invis.c helpops.c \
hide_uncommon_channels.c hurt.c ip_cloaking.c \
ip_cloaking_3.0.c ip_cloaking_4.0.c ip_cloaking_old.c m_42.c \
m_adminwall.c m_extendchans.c m_findforwards.c m_identify.c \
m_mkpasswd.c m_ojoin.c m_okick.c m_omode.c m_opme.c m_remove.c \
m_roleplay.c m_sendbans.c m_webirc.c no_kill_services.c \
no_locops.c no_oper_invis.c override.c \
m_adminwall.c m_echotags.c m_extendchans.c m_findforwards.c \
m_identify.c m_mkpasswd.c m_ojoin.c m_okick.c m_omode.c \
m_opme.c m_remove.c m_roleplay.c m_sendbans.c m_webirc.c \
no_kill_services.c no_locops.c no_oper_invis.c override.c \
restrict-unauthenticated.c sno_channelcreate.c \
sno_farconnect.c sno_globalkline.c sno_globalnickchange.c \
sno_globaloper.c sno_whois.c spy_admin_notice.c \
@ -387,10 +390,10 @@ DIST_SOURCES = chm_adminonly.c chm_insecure.c chm_nonotice.c \
extb_server.c extb_ssl.c extb_usermode.c force_user_invis.c \
helpops.c hide_uncommon_channels.c hurt.c ip_cloaking.c \
ip_cloaking_3.0.c ip_cloaking_4.0.c ip_cloaking_old.c m_42.c \
m_adminwall.c m_extendchans.c m_findforwards.c m_identify.c \
m_mkpasswd.c m_ojoin.c m_okick.c m_omode.c m_opme.c m_remove.c \
m_roleplay.c m_sendbans.c m_webirc.c no_kill_services.c \
no_locops.c no_oper_invis.c override.c \
m_adminwall.c m_echotags.c m_extendchans.c m_findforwards.c \
m_identify.c m_mkpasswd.c m_ojoin.c m_okick.c m_omode.c \
m_opme.c m_remove.c m_roleplay.c m_sendbans.c m_webirc.c \
no_kill_services.c no_locops.c no_oper_invis.c override.c \
restrict-unauthenticated.c sno_channelcreate.c \
sno_farconnect.c sno_globalkline.c sno_globalnickchange.c \
sno_globaloper.c sno_whois.c spy_admin_notice.c \
@ -645,6 +648,7 @@ extension_LTLIBRARIES = \
sno_whois.la \
m_42.la \
m_adminwall.la \
m_echotags.la \
m_extendchans.la \
m_findforwards.la \
m_identify.la \
@ -838,6 +842,9 @@ m_42.la: $(m_42_la_OBJECTS) $(m_42_la_DEPENDENCIES) $(EXTRA_m_42_la_DEPENDENCIES
m_adminwall.la: $(m_adminwall_la_OBJECTS) $(m_adminwall_la_DEPENDENCIES) $(EXTRA_m_adminwall_la_DEPENDENCIES)
$(AM_V_CCLD)$(LINK) -rpath $(extensiondir) $(m_adminwall_la_OBJECTS) $(m_adminwall_la_LIBADD) $(LIBS)
m_echotags.la: $(m_echotags_la_OBJECTS) $(m_echotags_la_DEPENDENCIES) $(EXTRA_m_echotags_la_DEPENDENCIES)
$(AM_V_CCLD)$(LINK) -rpath $(extensiondir) $(m_echotags_la_OBJECTS) $(m_echotags_la_LIBADD) $(LIBS)
m_extendchans.la: $(m_extendchans_la_OBJECTS) $(m_extendchans_la_DEPENDENCIES) $(EXTRA_m_extendchans_la_DEPENDENCIES)
$(AM_V_CCLD)$(LINK) -rpath $(extensiondir) $(m_extendchans_la_OBJECTS) $(m_extendchans_la_LIBADD) $(LIBS)
@ -967,6 +974,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ip_cloaking_old.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/m_42.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/m_adminwall.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/m_echotags.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/m_extendchans.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/m_findforwards.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/m_identify.Plo@am__quote@

38
extensions/m_echotags.c Normal file
View file

@ -0,0 +1,38 @@
#include "stdinc.h"
#include "modules.h"
#include "client.h"
#include "ircd.h"
#include "send.h"
static int m_echotags(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[]);
struct Message echotags_msgtab = {
"ECHOTAGS", 0, 0, 0, MFLG_SLOW,
{ mg_ignore, {m_echotags, 0}, mg_ignore, mg_ignore, mg_ignore, {m_echotags, 0} }
};
mapi_clist_av1 echotags_clist[] = { &echotags_msgtab, NULL };
DECLARE_MODULE_AV1(echotags, NULL, NULL, echotags_clist, NULL, NULL, "$Id$");
static int
m_echotags(struct MsgBuf *msgbuf_p, struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
{
int i;
sendto_one_notice(source_p, ":*** You sent %zu tags.", msgbuf_p->n_tags);
for (i = 0; i < msgbuf_p->n_tags; i++)
{
struct MsgTag *tag = &msgbuf_p->tags[i];
if (tag->value)
sendto_one_notice(source_p, ":*** %d: %s => %s", i, tag->key, tag->value);
else
sendto_one_notice(source_p, ":*** %d: %s", i, tag->key);
}
return 0;
}