| 23 |
|
*/ |
| 24 |
|
|
| 25 |
|
#include "stdinc.h" |
| 26 |
– |
#include "handlers.h" |
| 26 |
|
#include "client.h" |
| 27 |
|
#include "irc_string.h" |
| 29 |
– |
#include "sprintf_irc.h" |
| 28 |
|
#include "ircd.h" |
| 29 |
|
#include "numeric.h" |
| 30 |
|
#include "send.h" |
| 33 |
– |
#include "msg.h" |
| 31 |
|
#include "parse.h" |
| 32 |
|
#include "modules.h" |
| 36 |
– |
#include "s_conf.h" /* ConfigFileEntry */ |
| 33 |
|
|
| 38 |
– |
static void do_ison(struct Client *, struct Client *, int, char *[]); |
| 39 |
– |
static void m_ison(struct Client *, struct Client *, int, char *[]); |
| 40 |
– |
|
| 41 |
– |
struct Message ison_msgtab = { |
| 42 |
– |
"ISON", 0, 0, 1, 1, MFLG_SLOW, 0, |
| 43 |
– |
{m_unregistered, m_ison, m_ignore, m_ignore, m_ison, m_ignore} |
| 44 |
– |
}; |
| 45 |
– |
|
| 46 |
– |
#ifndef STATIC_MODULES |
| 47 |
– |
void |
| 48 |
– |
_modinit(void) |
| 49 |
– |
{ |
| 50 |
– |
mod_add_cmd(&ison_msgtab); |
| 51 |
– |
} |
| 52 |
– |
|
| 53 |
– |
void |
| 54 |
– |
_moddeinit(void) |
| 55 |
– |
{ |
| 56 |
– |
mod_del_cmd(&ison_msgtab); |
| 57 |
– |
} |
| 58 |
– |
const char *_version = "$Revision$"; |
| 59 |
– |
#endif |
| 60 |
– |
|
| 61 |
– |
|
| 62 |
– |
|
| 63 |
– |
/* |
| 64 |
– |
* m_ison added by Darren Reed 13/8/91 to act as an efficent user indicator |
| 65 |
– |
* with respect to cpu/bandwidth used. Implemented for NOTIFY feature in |
| 66 |
– |
* clients. Designed to reduce number of whois requests. Can process |
| 67 |
– |
* nicknames in batches as long as the maximum buffer length. |
| 68 |
– |
* |
| 69 |
– |
* format: |
| 70 |
– |
* ISON :nicklist |
| 71 |
– |
*/ |
| 72 |
– |
static void |
| 73 |
– |
m_ison(struct Client *client_p, struct Client *source_p, |
| 74 |
– |
int parc, char *parv[]) |
| 75 |
– |
{ |
| 76 |
– |
do_ison(client_p, source_p, parc, parv); |
| 77 |
– |
} |
| 34 |
|
|
| 35 |
|
static void |
| 36 |
|
do_ison(struct Client *client_p, struct Client *source_p, |
| 45 |
|
int i; |
| 46 |
|
int done = 0; |
| 47 |
|
|
| 48 |
< |
len = ircsprintf(buf, form_str(RPL_ISON), me.name, parv[0]); |
| 48 |
> |
len = snprintf(buf, sizeof(buf), form_str(RPL_ISON), me.name, source_p->name); |
| 49 |
|
current_insert_point = buf + len; |
| 50 |
|
|
| 51 |
|
/* |
| 88 |
|
|
| 89 |
|
sendto_one(source_p, "%s", buf); |
| 90 |
|
} |
| 91 |
+ |
|
| 92 |
+ |
/* |
| 93 |
+ |
* m_ison added by Darren Reed 13/8/91 to act as an efficent user indicator |
| 94 |
+ |
* with respect to cpu/bandwidth used. Implemented for NOTIFY feature in |
| 95 |
+ |
* clients. Designed to reduce number of whois requests. Can process |
| 96 |
+ |
* nicknames in batches as long as the maximum buffer length. |
| 97 |
+ |
* |
| 98 |
+ |
* format: |
| 99 |
+ |
* ISON :nicklist |
| 100 |
+ |
*/ |
| 101 |
+ |
static void |
| 102 |
+ |
m_ison(struct Client *client_p, struct Client *source_p, |
| 103 |
+ |
int parc, char *parv[]) |
| 104 |
+ |
{ |
| 105 |
+ |
do_ison(client_p, source_p, parc, parv); |
| 106 |
+ |
} |
| 107 |
+ |
|
| 108 |
+ |
static struct Message ison_msgtab = { |
| 109 |
+ |
"ISON", 0, 0, 2, 1, MFLG_SLOW, 0, |
| 110 |
+ |
{m_unregistered, m_ison, m_ignore, m_ignore, m_ison, m_ignore} |
| 111 |
+ |
}; |
| 112 |
+ |
|
| 113 |
+ |
static void |
| 114 |
+ |
module_init(void) |
| 115 |
+ |
{ |
| 116 |
+ |
mod_add_cmd(&ison_msgtab); |
| 117 |
+ |
} |
| 118 |
+ |
|
| 119 |
+ |
static void |
| 120 |
+ |
module_exit(void) |
| 121 |
+ |
{ |
| 122 |
+ |
mod_del_cmd(&ison_msgtab); |
| 123 |
+ |
} |
| 124 |
+ |
|
| 125 |
+ |
struct module module_entry = { |
| 126 |
+ |
.node = { NULL, NULL, NULL }, |
| 127 |
+ |
.name = NULL, |
| 128 |
+ |
.version = "$Revision$", |
| 129 |
+ |
.handle = NULL, |
| 130 |
+ |
.modinit = module_init, |
| 131 |
+ |
.modexit = module_exit, |
| 132 |
+ |
.flags = 0 |
| 133 |
+ |
}; |