]> jfr.im git - irc/quakenet/snircd-patchqueue.git/blob - checkoutput.patch
checkoutput: restored for the most part, most output takes 1 command now instead...
[irc/quakenet/snircd-patchqueue.git] / checkoutput.patch
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
6
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
10 @@ -238,7 +238,7 @@
11 char *zombie, *showlevel;
12
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)");
16 }
17
18 if (flags & CHECK_CLONES) {
19 @@ -324,89 +324,72 @@
20 cntr++;
21 }
22
23 - send_reply(sptr, RPL_DATASTR, " ");
24 + send_reply(sptr, RPL_DATASTR, ": ");
25
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);
33
34 for (lp = chptr->members; lp; lp = lp->next_member) {
35 cli_marker(lp->user) = 0;
36 }
37 } else {
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);
44 }
45
46 - send_reply(sptr, RPL_DATASTR, outbuf);
47 - send_reply(sptr, RPL_DATASTR, " ");
48 + send_reply(sptr, RPL_DATASTR, ": ");
49
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::");
54
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);
61 }
62
63 if (bans == 0)
64 - send_reply(sptr, RPL_DATASTR, "<none>");
65 + send_reply(sptr, RPL_DATASTR, ":<none>");
66 }
67
68 send_reply(sptr, RPL_ENDOFCHECK, " ");
69 }
70
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];
74
75 /* Header */
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, ": ");
82
83 /* Creation Time */
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);
88
89 /* Topic */
90 if (strlen(chptr->topic) <= 0)
91 - send_reply(sptr, RPL_DATASTR, " Topic:: <none>");
92 + send_reply(sptr, RPL_DATASTR, ": Topic:: <none>");
93 else {
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);
97
98 /* ..set by */
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);
102
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);
106 }
107
108 /* Channel Modes */
109 -
110 - strcpy(outbuf, "Channel mode(s):: ");
111 -
112 - modebuf[0] = '\0';
113 - parabuf[0] = '\0';
114 -
115 - channel_modes(sptr, modebuf, parabuf, sizeof(modebuf), chptr, NULL);
116 -
117 - if(modebuf[1] == '\0')
118 - strcat(outbuf, "<none>");
119 - else if(*parabuf) {
120 - strcat(outbuf, modebuf);
121 - strcat(outbuf, " ");
122 - strcat(outbuf, parabuf);
123 - }
124 - else
125 - strcat(outbuf, modebuf);
126 -
127 - send_reply(sptr, RPL_DATASTR, outbuf);
128 + *modebuf = '\0';
129 + *parabuf = '\0';
130 + modebuf[1] = '\0';
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);
134
135 /* Don't send 'END OF CHECK' message, it's sent in checkUsers, which is called after this. */
136 }
137 @@ -415,53 +398,45 @@
138 struct Channel *chptr;
139 struct Membership *lp;
140 struct irc_sockaddr sin;
141 - char outbuf[BUFSIZE];
142 char *umodes;
143 time_t nowr;
144
145 /* Header */
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, ": ");
152
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));
156
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);
160 - }
161 + if (MyUser(acptr))
162 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Signed on:: %s (%Tu)", myctime(acptr->cli_firsttime), acptr->cli_firsttime);
163
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);
167
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));
173
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);
177 - }
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);
180
181 - ircd_snprintf(0, outbuf, sizeof(outbuf), " Real Name:: %s%c", cli_info(acptr), COLOR_OFF);
182 - send_reply(sptr, RPL_DATASTR, outbuf);
183 + /* COLOR_OFF ? */
184 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Real Name:: %s", cli_info(acptr));
185
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>");
193 else
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);
198 - } else
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>");
204 + else
205 + /* this really needed ? */
206 + send_reply(sptr, RPL_DATASTR, ": Status:: Client");
207
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));
211
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 @@
215
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);
221
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) {
226
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).
230 */
231
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);
235 }
236 else {
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));
241 *chntext = '\0';
242
243 - strcpy(chntext, " Channel(s):: ");
244 + strcpy(chntext, ": Channel(s):: ");
245 for (lp = cli_user(acptr)->channel; lp; lp = lp->next_channel) {
246 chptr = lp->channel;
247 if (len + strlen(chptr->chname) + mlen > BUFSIZE - 5) {
248 send_reply(sptr, RPL_DATASTR, chntext);
249 *chntext = '\0';
250 - strcpy(chntext, " Channel(s):: ");
251 + strcpy(chntext, ": Channel(s):: ");
252 len = strlen(chntext);
253 }
254 if (IsDeaf(acptr))
255 @@ -530,39 +503,31 @@
256
257 if (MyUser(acptr)) {
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);
264 }
265
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);
270 - }
271 + if (cli_user(acptr)->away)
272 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ": Away message:: %s", cli_user(acptr)->away);
273
274 /* If local user.. */
275 if (MyUser(acptr)) {
276 os_get_peername(con_fd(cli_connect(sptr)), &sin);
277
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));
306 }
307 }
308
309 @@ -571,50 +536,50 @@
310 }
311
312 void checkServer(struct Client *sptr, struct Client *acptr) {
313 - char outbuf[BUFSIZE];
314
315 /* Header */
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, ": ");
322
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);
327
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);
331
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));
336
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);
342
343 if (IsBurst(acptr))
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");
355
356 if (feature_bool(FEAT_EXTENDED_CHECKCMD)) {
357 int dlinkc = 0;
358 struct DLink* slink = NULL;
359
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);
367 - }
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",
372 + ++dlinkc,
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));
378
379 if (!dlinkc)
380 - send_reply(sptr, RPL_DATASTR, "<none>");
381 + send_reply(sptr, RPL_DATASTR, ":<none>");
382 }
383
384 /* Send 'END OF CHECK' message */
385 @@ -626,7 +591,6 @@
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];
393 @@ -686,8 +650,7 @@
394 break;
395
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);
400 break;
401 }
402
403 @@ -718,37 +681,43 @@
404 /* Show header if we've found at least 1 record */
405 if (count == 0) {
406 /* Output header */
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);
411
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]" : "");
418 else
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");
424 }
425
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,
433 - acptr->cli_name,
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));
438 - } else {
439 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ":%-4d [%+3hu] %s %s@%s [%s] (+%s) :%s",
440 + (count+1),
441 + IPcheck_nr(acptr),
442 + acptr->cli_name,
443 + cli_user(acptr)->realusername, cli_user(acptr)->realhost,
444 + ircd_ntoa(&(cli_ip(acptr))),
445 + umodes,
446 + (flags & CHECK_SHOWSERVER) ? cli_name(cli_user(acptr)->server) : cli_info(acptr));
447 + else
448 + send_reply(sptr, SND_EXPLICIT | RPL_DATASTR, ":%-4d %s %s@%s [%s] (+%s) :%s",
449 + (count+1),
450 + acptr->cli_name,
451 + cli_user(acptr)->realusername, cli_user(acptr)->realhost,
452 + ircd_ntoa(&(cli_ip(acptr))),
453 + umodes,
454 + (flags & CHECK_SHOWSERVER) ? cli_name(cli_user(acptr)->server) : cli_info(acptr));
455 + } else
456 /* default output */
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);
460 - }
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);
465
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);
475 *chntext = '\0';
476
477 - strcpy(chntext, " on channels: ");
478 + strcpy(chntext, ": on channels: ");
479 for (lp = cli_user(acptr)->channel; lp; lp = lp->next_channel) {
480 chptr = lp->channel;
481 if (len + strlen(chptr->chname) + mlen > BUFSIZE - 5) {
482 send_reply(sptr, RPL_DATASTR, chntext);
483 *chntext = '\0';
484 - strcpy(chntext, " on channels: ");
485 + strcpy(chntext, ": on channels: ");
486 len = strlen(chntext);
487 }
488 if (IsDeaf(acptr))
489 @@ -793,7 +762,7 @@
490 if (chntext[0] != '\0')
491 send_reply(sptr, RPL_DATASTR, chntext);
492
493 - send_reply(sptr, RPL_DATASTR, " ");
494 + send_reply(sptr, RPL_DATASTR, ": ");
495 }
496 }
497 count++;
498 @@ -801,11 +770,8 @@
499 }
500
501 if (count > 0) {
502 - send_reply(sptr, RPL_DATASTR, " ");
503 -
504 - ircd_snprintf(0, outbuf, sizeof(outbuf), "Matching records found:: %d", count);
505 - send_reply(sptr, RPL_DATASTR, outbuf);
506 -
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, " ");
510 }
511
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
515 @@ -612,7 +612,7 @@
516 /* 289 */
517 { 0 },
518 /* 290 */
519 - { RPL_DATASTR, ":%s", "290" },
520 + { RPL_DATASTR, "%s", "290" },
521 /* 291 */
522 { RPL_ENDOFCHECK, ":%s", "291" },
523 /* 292 */