--- ircd-hybrid/modules/m_eob.c 2005/10/02 20:41:23 32 +++ ircd-hybrid/releases/8.1.12/modules/m_eob.c 2013/12/23 00:34:15 2710 @@ -23,39 +23,13 @@ */ #include "stdinc.h" -#include "handlers.h" #include "client.h" #include "ircd.h" -#include "numeric.h" -#include "s_conf.h" -#include "s_serv.h" #include "send.h" -#include "msg.h" #include "parse.h" #include "modules.h" -#include - -static void ms_eob(struct Client*, struct Client*, int, char**); - -struct Message eob_msgtab = { - "EOB", 0, 0, 0, 0, MFLG_SLOW | MFLG_UNREG, 0, - {m_unregistered, m_ignore, ms_eob, m_ignore, m_ignore, m_ignore} -}; -#ifndef STATIC_MODULES -void -_modinit(void) -{ - mod_add_cmd(&eob_msgtab); -} - -void -_moddeinit(void) -{ - mod_del_cmd(&eob_msgtab); -} +#include "s_serv.h" -const char *_version = "$Revision$"; -#endif /* * ms_eob - EOB command handler @@ -66,8 +40,45 @@ static void ms_eob(struct Client *client_p, struct Client *source_p, int parc, char *parv[]) { - sendto_realops_flags(UMODE_ALL, L_ALL, "End of burst from %s (%u seconds)", - source_p->name, - (unsigned int)(CurrentTime - source_p->firsttime)); - SetEob(client_p); + assert(IsServer(source_p)); + + if (client_p == source_p) + sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE, + "End of burst from %s (%u seconds)", + source_p->name, + (unsigned int)(CurrentTime - source_p->localClient->firsttime)); + + AddFlag(source_p, FLAGS_EOB); + + sendto_server(client_p, CAP_TS6, NOCAPS, + ":%s EOB", ID(source_p)); + sendto_server(client_p, NOCAPS, CAP_TS6, + ":%s EOB", source_p->name); } + +static struct Message eob_msgtab = { + "EOB", 0, 0, 0, MAXPARA, MFLG_SLOW, 0, + {m_unregistered, m_ignore, ms_eob, m_ignore, m_ignore, m_ignore} +}; + +static void +module_init(void) +{ + mod_add_cmd(&eob_msgtab); +} + +static void +module_exit(void) +{ + mod_del_cmd(&eob_msgtab); +} + +struct module module_entry = { + .node = { NULL, NULL, NULL }, + .name = NULL, + .version = "$Revision$", + .handle = NULL, + .modinit = module_init, + .modexit = module_exit, + .flags = 0 +};