1 make use of the SND_EXPLICIT flag to specify a pattern, reducing most output from 2 lines to 1 line
2 few minor other changes:
3 changed hidden to delayedjoin,
4 changed no modes <none> to just + same as /MODE shows
5 added zombie and delayedjoin prefix to header for check channel
7 diff -r 6242a5095d6d ircd/m_check.c
8 --- a/ircd/m_check.c Tue Mar 23 12:55:51 2010 +0100
9 +++ b/ircd/m_check.c Tue Mar 23 13:15:51 2010 +0100
11 char *zombie, *showlevel;
13 if (flags & CHECK_SHOWUSERS) {
14 - send_reply(sptr, RPL_DATASTR, "Users (@ = op, + = voice)");
15 + send_reply(sptr, RPL_DATASTR, ":Users (! = zombie, @ = op, + = voice, < = delayedjoin)");
18 if (flags & CHECK_CLONES) {
23 - send_reply(sptr, RPL_DATASTR, " ");
24 + send_reply(sptr, RPL_DATASTR, ": ");
26 if (flags & CHECK_CLONES) {
27 - ircd_snprintf(0, outbuf, sizeof(outbuf),
28 - "Total users:: %d (%d ops, %d voiced, %d clones, %d authed, %d hidden)",
29 - cntr, opcntr, vcntr, clones, authed, delayedjoin);
30 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR,
31 + ":Total users:: %d (%d ops, %d voiced, %d clones, %d authed, %d delayedjoin)",
32 + cntr, opcntr, vcntr, clones, authed, delayedjoin);
34 for (lp = chptr->members; lp; lp = lp->next_member) {
35 cli_marker(lp->user) = 0;
38 - ircd_snprintf(0, outbuf, sizeof(outbuf),
39 - "Total users:: %d (%d ops, %d voiced, %d authed, %d hidden)",
40 - cntr, opcntr, vcntr, authed, delayedjoin);
41 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR,
42 + ":Total users:: %d (%d ops, %d voiced, %d authed, %d delayedjoin)",
43 + cntr, opcntr, vcntr, authed, delayedjoin);
46 - send_reply(sptr, RPL_DATASTR, outbuf);
47 - send_reply(sptr, RPL_DATASTR, " ");
48 + send_reply(sptr, RPL_DATASTR, ": ");
50 /* Do not display bans if ! flags & CHECK_SHOWUSERS */
51 if (flags & CHECK_SHOWUSERS) {
52 - send_reply(sptr, RPL_DATASTR, "Bans on channel::");
53 + send_reply(sptr, RPL_DATASTR, ":Bans on channel::");
55 for (ban = chptr->banlist; ban; ban = ban->next) {
56 - ircd_snprintf(0, outbuf, sizeof(outbuf), "[%d] - %s - Set by %s, on %s (%Tu)",
57 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR,
58 + ":[%d] - %s - Set by %s, on %s (%Tu)",
59 ++bans, ban->banstr, ban->who, myctime(ban->when), ban->when);
60 - send_reply(sptr, RPL_DATASTR, outbuf);
64 - send_reply(sptr, RPL_DATASTR, "<none>");
65 + send_reply(sptr, RPL_DATASTR, ":<none>");
68 send_reply(sptr, RPL_ENDOFCHECK, " ");
71 void checkChannel(struct Client *sptr, struct Channel *chptr) {
72 - char outbuf[TOPICLEN + MODEBUFLEN + 64], modebuf[MODEBUFLEN], parabuf[MODEBUFLEN];
73 + char modebuf[MODEBUFLEN], parabuf[MODEBUFLEN];
76 - send_reply(sptr, RPL_DATASTR, " ");
77 - send_reply(sptr, RPL_CHKHEAD, "channel", chptr->chname);
78 - send_reply(sptr, RPL_DATASTR, " ");
79 + send_reply(sptr, RPL_DATASTR, ": ");
80 + send_reply(sptr, RPL_CHKHEAD, ":channel", chptr->chname);
81 + send_reply(sptr, RPL_DATASTR, ": ");
84 - ircd_snprintf(sptr, outbuf, sizeof(outbuf), " Creation time:: %s (%Tu)", myctime(chptr->creationtime), chptr->creationtime);
85 - send_reply(sptr, RPL_DATASTR, outbuf);
86 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Creation time:: %s (%Tu)",
87 + myctime(chptr->creationtime), chptr->creationtime);
90 if (strlen(chptr->topic) <= 0)
91 - send_reply(sptr, RPL_DATASTR, " Topic:: <none>");
92 + send_reply(sptr, RPL_DATASTR, ": Topic:: <none>");
94 - ircd_snprintf(sptr, outbuf, sizeof(outbuf), " Topic:: %s", chptr->topic);
95 - send_reply(sptr, RPL_DATASTR, outbuf);
96 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Topic:: %s", chptr->topic);
99 - ircd_snprintf(sptr, outbuf, sizeof(outbuf), " Set by:: %s", chptr->topic_nick);
100 - send_reply(sptr, RPL_DATASTR, outbuf);
101 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Set by:: %s", chptr->topic_nick);
103 - ircd_snprintf(sptr, outbuf, sizeof(outbuf), " Set at:: %s (%Tu)", myctime(chptr->topic_time), chptr->topic_time);
104 - send_reply(sptr, RPL_DATASTR, outbuf);
105 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Set at:: %s (%Tu)", myctime(chptr->topic_time), chptr->topic_time);
110 - strcpy(outbuf, "Channel mode(s):: ");
115 - channel_modes(sptr, modebuf, parabuf, sizeof(modebuf), chptr, NULL);
117 - if(modebuf[1] == '\0')
118 - strcat(outbuf, "<none>");
119 - else if(*parabuf) {
120 - strcat(outbuf, modebuf);
121 - strcat(outbuf, " ");
122 - strcat(outbuf, parabuf);
125 - strcat(outbuf, modebuf);
127 - send_reply(sptr, RPL_DATASTR, outbuf);
131 + channel_modes(sptr, modebuf, parabuf, sizeof(parabuf), chptr, NULL);
132 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ":Channel mode(s):: %s %s",
133 + modebuf ? modebuf : "+", parabuf);
135 /* Don't send 'END OF CHECK' message, it's sent in checkUsers, which is called after this. */
137 @@ -415,53 +398,45 @@
138 struct Channel *chptr;
139 struct Membership *lp;
140 struct irc_sockaddr sin;
141 - char outbuf[BUFSIZE];
146 - send_reply(sptr, RPL_DATASTR, " ");
147 - send_reply(sptr, RPL_CHKHEAD, "user", cli_name(acptr));
148 - send_reply(sptr, RPL_DATASTR, " ");
149 + send_reply(sptr, RPL_DATASTR, ": ");
150 + send_reply(sptr, RPL_CHKHEAD, ":user", cli_name(acptr));
151 + send_reply(sptr, RPL_DATASTR, ": ");
153 - ircd_snprintf(0, outbuf, sizeof(outbuf), " Nick:: %s (%s%s)", cli_name(acptr), NumNick(acptr));
154 - send_reply(sptr, RPL_DATASTR, outbuf);
155 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Nick:: %s (%s%s)", cli_name(acptr), NumNick(acptr));
157 - if (MyUser(acptr)) {
158 - ircd_snprintf(0, outbuf, sizeof(outbuf), " Signed on:: %s (%Tu)", myctime(acptr->cli_firsttime), acptr->cli_firsttime);
159 - send_reply(sptr, RPL_DATASTR, outbuf);
162 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Signed on:: %s (%Tu)", myctime(acptr->cli_firsttime), acptr->cli_firsttime);
164 - ircd_snprintf(0, outbuf, sizeof(outbuf), " Timestamp:: %s (%d)", myctime(acptr->cli_lastnick), acptr->cli_lastnick);
165 - send_reply(sptr, RPL_DATASTR, outbuf);
166 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Timestamp:: %s (%d)", myctime(acptr->cli_lastnick), acptr->cli_lastnick);
168 - ircd_snprintf(0, outbuf, sizeof(outbuf), " User/Hostmask:: %s@%s [%s] (Clients: %hu)", cli_user(acptr)->username, cli_user(acptr)->host,
169 - ircd_ntoa(&(cli_ip(acptr))), IPcheck_nr(acptr));
170 - send_reply(sptr, RPL_DATASTR, outbuf);
171 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": User/Hostmask:: %s@%s [%s] (Clients: %hu)",
172 + cli_user(acptr)->username, cli_user(acptr)->host, ircd_ntoa(&(cli_ip(acptr))), IPcheck_nr(acptr));
174 - if (IsSetHost(acptr) || HasHiddenHost(acptr)) {
175 - ircd_snprintf(0, outbuf, sizeof(outbuf), " Real User/Host:: %s@%s", cli_user(acptr)->realusername, cli_user(acptr)->realhost);
176 - send_reply(sptr, RPL_DATASTR, outbuf);
178 + if (IsSetHost(acptr) || HasHiddenHost(acptr))
179 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Real User/Host:: %s@%s", cli_user(acptr)->realusername, cli_user(acptr)->realhost);
181 - ircd_snprintf(0, outbuf, sizeof(outbuf), " Real Name:: %s%c", cli_info(acptr), COLOR_OFF);
182 - send_reply(sptr, RPL_DATASTR, outbuf);
184 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Real Name:: %s", cli_info(acptr));
186 if( IsService(cli_user(acptr)->server)) {
187 if (IsChannelService(acptr))
188 - send_reply(sptr, RPL_DATASTR, " Status:: Network Service");
189 + send_reply(sptr, RPL_DATASTR, ": Status:: Network Service");
190 else if (IsAnOper(acptr))
191 - send_reply(sptr, RPL_DATASTR, " Status:: IRC Operator (service) (ID: %s)", cli_user(acptr)->opername ? cli_user(acptr)->opername : "<unknown>");
192 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Status:: IRC Operator (service) (ID: %s)", cli_user(acptr)->opername ? cli_user(acptr)->opername : "<unknown>");
194 - send_reply(sptr, RPL_DATASTR, " Status:: Client (service)");
195 - } else if (IsAnOper(acptr)) {
196 - ircd_snprintf(0, outbuf, sizeof(outbuf), " Status:: IRC Operator (ID: %s)", cli_user(acptr)->opername ? cli_user(acptr)->opername : "<unknown>");
197 - send_reply(sptr, RPL_DATASTR, outbuf);
199 - send_reply(sptr, RPL_DATASTR, " Status:: Client");
200 + send_reply(sptr, RPL_DATASTR, ": Status:: Client (service)");
201 + } else if (IsAnOper(acptr))
202 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Status:: IRC Operator (ID: %s)",
203 + cli_user(acptr)->opername ? cli_user(acptr)->opername : "<unknown>");
205 + /* this really needed ? */
206 + send_reply(sptr, RPL_DATASTR, ": Status:: Client");
208 - ircd_snprintf(0, outbuf, sizeof(outbuf), " Connected to:: %s (Hops: %d)", cli_name(cli_user(acptr)->server), cli_hopcount(acptr));
209 - send_reply(sptr, RPL_DATASTR, outbuf);
210 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Connected to:: %s (Hops: %d)", cli_name(cli_user(acptr)->server), cli_hopcount(acptr));
212 /* +s (SERV_NOTICE) is not relayed to us from remote servers,
213 * so we cannot tell if a remote client has that mode set.
214 @@ -471,11 +446,10 @@
216 /* show the usermodes and account info (but not OperID and sethost) */
217 umodes = umode_str(acptr, UMODE_AND_ACCOUNT);
218 - ircd_snprintf(0, outbuf, sizeof(outbuf), " Usermode(s):: %s%s", *umodes ? "+" : "<none>", umodes);
219 - send_reply(sptr, RPL_DATASTR, outbuf);
220 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Usermode(s):: +%s", umodes);
222 if (cli_user(acptr)->joined == 0)
223 - send_reply(sptr, RPL_DATASTR, " Channel(s):: <none>");
224 + send_reply(sptr, RPL_DATASTR, ": Channel(s):: <none>");
225 else if (cli_user(acptr)->joined > 50) {
227 /* NB. As a sanity check, we DO NOT show the individual channels the
228 @@ -485,22 +459,21 @@
229 * they are on *that* many).
232 - ircd_snprintf(0, outbuf, sizeof(outbuf), " Channel(s):: - (total: %u)", cli_user(acptr)->joined);
233 - send_reply(sptr, RPL_DATASTR, outbuf);
234 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Channel(s):: - (total: %u)", cli_user(acptr)->joined);
237 char chntext[BUFSIZE];
238 - int len = strlen(" Channel(s):: ");
239 + int len = strlen(": Channel(s):: ");
240 int mlen = strlen(me.cli_name) + len + strlen(cli_name(sptr));
243 - strcpy(chntext, " Channel(s):: ");
244 + strcpy(chntext, ": Channel(s):: ");
245 for (lp = cli_user(acptr)->channel; lp; lp = lp->next_channel) {
247 if (len + strlen(chptr->chname) + mlen > BUFSIZE - 5) {
248 send_reply(sptr, RPL_DATASTR, chntext);
250 - strcpy(chntext, " Channel(s):: ");
251 + strcpy(chntext, ": Channel(s):: ");
252 len = strlen(chntext);
255 @@ -530,39 +503,31 @@
258 nowr = CurrentTime - cli_user(acptr)->last;
259 - ircd_snprintf(0, outbuf, sizeof(outbuf), " Idle for:: %d days, %02ld:%02ld:%02ld",
260 - nowr / 86400, (nowr / 3600) % 24, (nowr / 60) % 60, nowr % 60);
261 - send_reply(sptr, RPL_DATASTR, outbuf);
262 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Idle for:: %d days, %02ld:%02ld:%02ld",
263 + nowr / 86400, (nowr / 3600) % 24, (nowr / 60) % 60, nowr % 60);
266 /* Away message (if applicable) */
267 - if (cli_user(acptr)->away) {
268 - ircd_snprintf(0, outbuf, sizeof(outbuf), " Away message:: %s", cli_user(acptr)->away);
269 - send_reply(sptr, RPL_DATASTR, outbuf);
271 + if (cli_user(acptr)->away)
272 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Away message:: %s", cli_user(acptr)->away);
274 /* If local user.. */
276 os_get_peername(con_fd(cli_connect(sptr)), &sin);
278 send_reply(sptr, RPL_DATASTR, " ");
279 - ircd_snprintf(0, outbuf, sizeof(outbuf), " Ports:: %d -> %d (client -> server)",
280 - sin.port, cli_listener(acptr)->addr.port);
281 - send_reply(sptr, RPL_DATASTR, outbuf);
282 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Ports:: %d -> %d (client -> server)",
283 + sin.port, cli_listener(acptr)->addr.port);
284 if (feature_bool(FEAT_EXTENDED_CHECKCMD)) {
285 /* Note: sendq = receiveq for a client (it makes sense really) */
286 - ircd_snprintf(0, outbuf, sizeof(outbuf), " Data sent:: %lu.%0.3u Kb (%u protocol messages)",
287 - (unsigned long)cli_receiveB(acptr) / 1024, (unsigned long)cli_receiveB(acptr) % 1024, cli_receiveM(acptr));
288 - send_reply(sptr, RPL_DATASTR, outbuf);
289 - ircd_snprintf(0, outbuf, sizeof(outbuf), " Data received:: %lu.%0.3lu Kb (%u protocol messages)",
290 - (unsigned long)cli_sendB(acptr) / 1024, (unsigned long)cli_sendB(acptr) % 1024, cli_sendM(acptr));
291 - send_reply(sptr, RPL_DATASTR, outbuf);
292 - ircd_snprintf(0, outbuf, sizeof(outbuf), " receiveQ size:: %d bytes (max. %d bytes)",
293 - DBufLength(&(cli_recvQ(acptr))), feature_int(FEAT_CLIENT_FLOOD));
294 - send_reply(sptr, RPL_DATASTR, outbuf);
295 - ircd_snprintf(0, outbuf, sizeof(outbuf), " sendQ size:: %d bytes (max. %d bytes)",
296 - DBufLength(&(cli_sendQ(acptr))), get_sendq(acptr));
297 - send_reply(sptr, RPL_DATASTR, outbuf);
298 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Data sent:: %lu.%0.3u Kb (%u protocol messages)",
299 + (unsigned long)cli_receiveB(acptr) / 1024, (unsigned long)cli_receiveB(acptr) % 1024, cli_receiveM(acptr));
300 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Data received:: %lu.%0.3lu Kb (%u protocol messages)",
301 + (unsigned long)cli_sendB(acptr) / 1024, (unsigned long)cli_sendB(acptr) % 1024, cli_sendM(acptr));
302 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": receiveQ size:: %d bytes (max. %d bytes)",
303 + DBufLength(&(cli_recvQ(acptr))), feature_int(FEAT_CLIENT_FLOOD));
304 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": sendQ size:: %d bytes (max. %d bytes)",
305 + DBufLength(&(cli_sendQ(acptr))), get_sendq(acptr));
309 @@ -571,50 +536,50 @@
312 void checkServer(struct Client *sptr, struct Client *acptr) {
313 - char outbuf[BUFSIZE];
316 - send_reply(sptr, RPL_DATASTR, " ");
317 - send_reply(sptr, RPL_CHKHEAD, "server", acptr->cli_name);
318 - send_reply(sptr, RPL_DATASTR, " ");
319 + send_reply(sptr, RPL_DATASTR, ": ");
320 + send_reply(sptr, RPL_CHKHEAD, ":server", acptr->cli_name);
321 + send_reply(sptr, RPL_DATASTR, ": ");
323 - ircd_snprintf(0, outbuf, sizeof(outbuf), " Connected at:: %s (%Tu)", myctime(acptr->cli_serv->timestamp), acptr->cli_serv->timestamp);
324 - send_reply(sptr, RPL_DATASTR, outbuf);
325 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Connected at:: %s (%Tu)",
326 + myctime(acptr->cli_serv->timestamp), acptr->cli_serv->timestamp);
328 - ircd_snprintf(0, outbuf, sizeof(outbuf), " Server name:: %s", acptr->cli_name);
329 - send_reply(sptr, RPL_DATASTR, outbuf);
330 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Server name:: %s", acptr->cli_name);
332 - ircd_snprintf(0, outbuf, sizeof(outbuf), " Numeric:: %s --> %d", NumServ(acptr), base64toint(acptr->cli_yxx));
333 - send_reply(sptr, RPL_DATASTR, outbuf);
334 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Numeric:: %s --> %d",
335 + NumServ(acptr), base64toint(acptr->cli_yxx));
337 - ircd_snprintf(0, outbuf, sizeof(outbuf), " Users:: %d / %d", (acptr == &me) ? UserStats.local_clients : cli_serv(acptr)->clients,
338 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Users:: %d / %d",
339 + (acptr == &me) ? UserStats.local_clients : cli_serv(acptr)->clients,
340 base64toint(cli_serv(acptr)->nn_capacity));
341 - send_reply(sptr, RPL_DATASTR, outbuf);
344 - send_reply(sptr, RPL_DATASTR, " Status:: Bursting");
345 + send_reply(sptr, RPL_DATASTR, ": Status:: Bursting");
346 else if (IsBurstAck(acptr))
347 - send_reply(sptr, RPL_DATASTR, " Status:: Awaiting EOB Ack");
348 + send_reply(sptr, RPL_DATASTR, ": Status:: Awaiting EOB Ack");
349 else if (IsService(acptr))
350 - send_reply(sptr, RPL_DATASTR, " Status:: Network Service");
351 + send_reply(sptr, RPL_DATASTR, ": Status:: Network Service");
352 else if (IsHub(acptr))
353 - send_reply(sptr, RPL_DATASTR, " Status:: Network Hub");
354 + send_reply(sptr, RPL_DATASTR, ": Status:: Network Hub");
356 if (feature_bool(FEAT_EXTENDED_CHECKCMD)) {
358 struct DLink* slink = NULL;
360 - send_reply(sptr, RPL_DATASTR, " ");
361 - send_reply(sptr, RPL_DATASTR, "Downlinks::");
362 - for (slink = cli_serv(acptr)->down; slink; slink = slink->next) {
363 - ircd_snprintf(0, outbuf, sizeof(outbuf), "[%d] - %s%s", ++dlinkc,
364 - IsBurst(slink->value.cptr) ? "*" : IsBurstAck(slink->value.cptr) ? "!" : IsService(slink->value.cptr) ? "=" : IsHub(slink->value.cptr) ? "+" : " ",
365 - cli_name(slink->value.cptr));
366 - send_reply(sptr, RPL_DATASTR, outbuf);
368 + send_reply(sptr, RPL_DATASTR, ": ");
369 + send_reply(sptr, RPL_DATASTR, ":Downlinks::");
370 + for (slink = cli_serv(acptr)->down; slink; slink = slink->next)
371 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ":[%d] - %s%s",
373 + IsBurst(slink->value.cptr) ? "*" :
374 + (IsBurstAck(slink->value.cptr) ? "!" :
375 + (IsService(slink->value.cptr) ? "=" :
376 + (IsHub(slink->value.cptr) ? "+" : " "))),
377 + cli_name(slink->value.cptr));
380 - send_reply(sptr, RPL_DATASTR, "<none>");
381 + send_reply(sptr, RPL_DATASTR, ":<none>");
384 /* Send 'END OF CHECK' message */
386 struct Channel *chptr;
387 struct Membership *lp;
388 int count = 0, found = 0;
389 - char outbuf[BUFSIZE];
390 char targhost[NICKLEN + USERLEN + HOSTLEN + 3], curhost[NICKLEN + USERLEN + HOSTLEN + 3];
391 char hoststr[NICKLEN + USERLEN + HOSTLEN + 3];
392 char nickm[NICKLEN + 1], userm[USERLEN + 1], hostm[HOSTLEN + 1];
396 if(count >= 500) { /* sanity stuff */
397 - ircd_snprintf(0, outbuf, sizeof(outbuf), "More than %d results, truncating...", count);
398 - send_reply(sptr, RPL_DATASTR, outbuf);
399 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ":More than %d results, truncating...", count);
403 @@ -718,37 +681,43 @@
404 /* Show header if we've found at least 1 record */
407 - send_reply(sptr, RPL_DATASTR, " ");
408 - send_reply(sptr, RPL_CHKHEAD, "host", targhost);
409 + send_reply(sptr, RPL_DATASTR, ": ");
410 + send_reply(sptr, RPL_CHKHEAD, ":host", targhost);
412 - send_reply(sptr, RPL_DATASTR, " ");
413 + send_reply(sptr, RPL_DATASTR, ": ");
414 if (flags & CHECK_SHOWMORE)
415 - ircd_snprintf(0, outbuf, sizeof(outbuf), "No. %s nick user@host [IP] (usermodes) :realname", (flags & CHECK_CLONES) ? "[clients]" : "");
416 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ":No. %s nick user@host [IP] (usermodes) :realname",
417 + (flags & CHECK_CLONES) ? "[clients]" : "");
419 - ircd_snprintf(0, outbuf, sizeof(outbuf), "%s %-*s%-*s%s", "No.", (NICKLEN + 2), "Nick",
420 - (USERLEN + 2), "User", "Host");
421 - send_reply(sptr, RPL_DATASTR, outbuf);
422 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ":%s %-*s%-*s%s", "No.",
423 + (NICKLEN + 2), "Nick", (USERLEN + 2), "User", "Host");
426 if (flags & CHECK_SHOWMORE) {
427 /* show more information */
428 umodes = umode_str(acptr, UMODE_AND_ACCOUNT_SHORT);
429 - ircd_snprintf(0, outbuf, sizeof(outbuf), "%-4d ", (count+1));
430 if (flags & CHECK_CLONES)
431 - ircd_snprintf(0, outbuf, sizeof(outbuf), "%s[%+3hu] ", outbuf, IPcheck_nr(acptr));
432 - ircd_snprintf(0, outbuf, sizeof(outbuf), "%s%s %s@%s [%s] (%s%s) :%s", outbuf,
434 - cli_user(acptr)->realusername, cli_user(acptr)->realhost,
435 - ircd_ntoa(&(cli_ip(acptr))),
436 - *umodes ? "+" : "<none>", umodes,
437 - (flags & CHECK_SHOWSERVER) ? cli_name(cli_user(acptr)->server) : cli_info(acptr));
439 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ":%-4d [%+3hu] %s %s@%s [%s] (+%s) :%s",
443 + cli_user(acptr)->realusername, cli_user(acptr)->realhost,
444 + ircd_ntoa(&(cli_ip(acptr))),
446 + (flags & CHECK_SHOWSERVER) ? cli_name(cli_user(acptr)->server) : cli_info(acptr));
448 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ":%-4d %s %s@%s [%s] (+%s) :%s",
451 + cli_user(acptr)->realusername, cli_user(acptr)->realhost,
452 + ircd_ntoa(&(cli_ip(acptr))),
454 + (flags & CHECK_SHOWSERVER) ? cli_name(cli_user(acptr)->server) : cli_info(acptr));
457 - ircd_snprintf(0, outbuf, sizeof(outbuf), "%-4d %-*s%-*s%s", (count+1), (NICKLEN + 2),
458 - acptr->cli_name, (USERLEN + 2), cli_user(acptr)->realusername,
459 - (flags & CHECK_SHOWIPS) ? ircd_ntoa(&(cli_ip(acptr))) : cli_user(acptr)->realhost);
461 - send_reply(sptr, RPL_DATASTR, outbuf);
462 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ":%-4d %-*s%-*s%s",
463 + (count+1), (NICKLEN + 2), acptr->cli_name, (USERLEN + 2), cli_user(acptr)->realusername,
464 + (flags & CHECK_SHOWIPS) ? ircd_ntoa(&(cli_ip(acptr))) : cli_user(acptr)->realhost);
466 /* Show channel output (if applicable) - the 50 channel limit sanity check
467 * is specifically to prevent coredumping when someone lamely tries to /check
468 @@ -757,17 +726,17 @@
469 if (flags & CHECK_CHECKCHAN) {
470 if (cli_user(acptr)->joined > 0 && cli_user(acptr)->joined <= 50) {
471 char chntext[BUFSIZE];
472 - int len = strlen(" on channels: ");
473 + int len = strlen(": on channels: ");
474 int mlen = strlen(me.cli_name) + len + strlen(sptr->cli_name);
477 - strcpy(chntext, " on channels: ");
478 + strcpy(chntext, ": on channels: ");
479 for (lp = cli_user(acptr)->channel; lp; lp = lp->next_channel) {
481 if (len + strlen(chptr->chname) + mlen > BUFSIZE - 5) {
482 send_reply(sptr, RPL_DATASTR, chntext);
484 - strcpy(chntext, " on channels: ");
485 + strcpy(chntext, ": on channels: ");
486 len = strlen(chntext);
490 if (chntext[0] != '\0')
491 send_reply(sptr, RPL_DATASTR, chntext);
493 - send_reply(sptr, RPL_DATASTR, " ");
494 + send_reply(sptr, RPL_DATASTR, ": ");
502 - send_reply(sptr, RPL_DATASTR, " ");
504 - ircd_snprintf(0, outbuf, sizeof(outbuf), "Matching records found:: %d", count);
505 - send_reply(sptr, RPL_DATASTR, outbuf);
507 + send_reply(sptr, RPL_DATASTR, ": ");
508 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ":Matching records found:: %d", count);
509 send_reply(sptr, RPL_ENDOFCHECK, " ");
512 diff -r 6242a5095d6d ircd/s_err.c
513 --- a/ircd/s_err.c Tue Mar 23 12:55:51 2010 +0100
514 +++ b/ircd/s_err.c Tue Mar 23 13:15:51 2010 +0100
519 - { RPL_DATASTR, ":%s", "290" },
520 + { RPL_DATASTR, "%s", "290" },
522 { RPL_ENDOFCHECK, ":%s", "291" },