]> arthur.barton.de Git - ngircd-alex.git/blob - src/ngircd/irc-channel.c
Code cleanup: mostly removing empty lines
[ngircd-alex.git] / src / ngircd / irc-channel.c
1 /*
2  * ngIRCd -- The Next Generation IRC Daemon
3  * Copyright (c)2001-2010 Alexander Barton (alex@barton.de)
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  * Please read the file COPYING, README and AUTHORS for more information.
10  */
11
12 #include "portab.h"
13
14 /**
15  * @file
16  * IRC channel commands
17  */
18
19 #include "imp.h"
20 #include <assert.h>
21 #include <stdlib.h>
22 #include <stdio.h>
23 #include <string.h>
24
25 #include "defines.h"
26 #include "conn.h"
27 #include "channel.h"
28 #include "conn-func.h"
29 #include "lists.h"
30 #include "log.h"
31 #include "match.h"
32 #include "messages.h"
33 #include "parse.h"
34 #include "irc-info.h"
35 #include "irc-write.h"
36 #include "conf.h"
37
38 #include "exp.h"
39 #include "irc-channel.h"
40
41
42 /*
43  * RFC 2812, (3.2.1 Join message Command):
44  *  Note that this message
45  *  accepts a special argument ("0"), which is a special request to leave all
46  *  channels the user is currently a member of. The server will process this
47  *  message as if the user had sent a PART command (See Section 3.2.2) for
48  *  each channel he is a member of.
49  */
50 static bool
51 part_from_all_channels(CLIENT* client, CLIENT *target)
52 {
53         CL2CHAN *cl2chan;
54         CHANNEL *chan;
55
56         while ((cl2chan = Channel_FirstChannelOf(target))) {
57                 chan = Channel_GetChannel(cl2chan);
58                 assert( chan != NULL );
59                 Channel_Part(target, client, Channel_Name(chan), Client_ID(target));
60         }
61         return CONNECTED;
62 }
63
64
65 /**
66  * Check weather a local client is allowed to join an already existing
67  * channel or not.
68  * @param Client Client that sent the JOIN command
69  * @param chan Channel to check
70  * @param channame Name of the channel
71  * @param key Provided channel key (or NULL if none has been provided)
72  * @return true if client is allowed to join channel, false otherwise
73  */
74 static bool
75 join_allowed(CLIENT *Client, CHANNEL *chan, const char *channame,
76              const char *key)
77 {
78         bool is_invited, is_banned;
79         const char *channel_modes;
80
81         /* Allow IRC operators to overwrite channel limits */
82         if (strchr(Client_Modes(Client), 'o'))
83                 return true;
84
85         is_banned = Lists_Check(Channel_GetListBans(chan), Client);
86         is_invited = Lists_Check(Channel_GetListInvites(chan), Client);
87
88         if (is_banned && !is_invited) {
89                 /* Client is banned from channel (and not on invite list) */
90                 IRC_WriteStrClient(Client, ERR_BANNEDFROMCHAN_MSG,
91                                    Client_ID(Client), channame);
92                 return false;
93         }
94
95         channel_modes = Channel_Modes(chan);
96         if (strchr(channel_modes, 'i') && !is_invited) {
97                 /* Channel is "invite-only" and client is not on invite list */
98                 IRC_WriteStrClient(Client, ERR_INVITEONLYCHAN_MSG,
99                                    Client_ID(Client), channame);
100                 return false;
101         }
102
103         if (!Channel_CheckKey(chan, Client, key ? key : "")) {
104                 /* Channel is protected by a channel key and the client
105                  * didn't specify the correct one */
106                 IRC_WriteStrClient(Client, ERR_BADCHANNELKEY_MSG,
107                                    Client_ID(Client), channame);
108                 return false;
109         }
110
111         if (strchr(channel_modes, 'l') &&
112             (Channel_MaxUsers(chan) <= Channel_MemberCount(chan))) {
113                 /* There are more clints joined to this channel than allowed */
114                 IRC_WriteStrClient(Client, ERR_CHANNELISFULL_MSG,
115                                    Client_ID(Client), channame);
116                 return false;
117         }
118
119         if (strchr(channel_modes, 'z') && !Conn_UsesSSL(Client_Conn(Client))) {
120                 /* Only "secure" clients are allowed, but clients doesn't
121                  * use SSL encryption */
122                 IRC_WriteStrClient(Client, ERR_SECURECHANNEL_MSG,
123                                    Client_ID(Client), channame);
124                 return false;
125         }
126
127         if (strchr(channel_modes, 'O') && !Client_OperByMe(Client)) {
128                 /* Only IRC operators are allowed! */
129                 IRC_WriteStrClient(Client, ERR_OPONLYCHANNEL_MSG,
130                                    Client_ID(Client), channame);
131                 return false;
132         }
133
134         return true;
135 }
136
137
138 static void
139 join_set_channelmodes(CHANNEL *chan, CLIENT *target, const char *flags)
140 {
141         if (flags) {
142                 while (*flags) {
143                         Channel_UserModeAdd(chan, target, *flags);
144                         flags++;
145                 }
146         }
147
148         /* If channel persistent and client is ircop: make client chanop */
149         if (strchr(Channel_Modes(chan), 'P') && strchr(Client_Modes(target), 'o'))
150                 Channel_UserModeAdd(chan, target, 'o');
151 }
152
153
154 static void
155 cb_join_forward(CLIENT *To, CLIENT *Prefix, void *Data)
156 {
157         CONN_ID conn;
158         char str[COMMAND_LEN], *ptr = NULL;
159
160         strlcpy(str, (char *)Data, sizeof(str));
161         conn = Client_Conn(To);
162
163         if (Conn_Options(conn) & CONN_RFC1459) {
164                 /* RFC 1459 compatibility mode, appended modes are NOT
165                  * supported, so strip them off! */
166                 ptr = strchr(str, 0x7);
167                 if (ptr)
168                         *ptr++ = '\0';
169         }
170
171         IRC_WriteStrClientPrefix(To, Prefix, "JOIN %s", str);
172         if (ptr && *ptr)
173                 IRC_WriteStrClientPrefix(To, Prefix, "MODE %s +%s %s", str, ptr,
174                                          Client_ID(Prefix));
175 } /* cb_join_forward */
176
177
178 static void
179 join_forward(CLIENT *Client, CLIENT *target, CHANNEL *chan,
180                                         const char *channame)
181 {
182         char modes[CHANNEL_MODE_LEN], str[COMMAND_LEN];
183
184         strlcpy(&modes[1], Channel_UserModes(chan, target), sizeof(modes) - 1);
185         if (modes[1])
186                 modes[0] = 0x7;
187         else
188                 modes[0] = '\0';
189
190         /* forward to other servers (if it is not a local channel) */
191         if (!Channel_IsLocal(chan)) {
192                 snprintf(str, sizeof(str), "%s%s", channame, modes);
193                 IRC_WriteStrServersPrefixFlag_CB(Client, target, '\0',
194                                                  cb_join_forward, str);
195         }
196
197         /* tell users in this channel about the new client */
198         IRC_WriteStrChannelPrefix(Client, chan, target, false,
199                                   "JOIN :%s",  channame);
200
201         /* syncronize channel modes */
202         if (modes[1]) {
203                 IRC_WriteStrChannelPrefix(Client, chan, target, false,
204                                           "MODE %s +%s %s", channame,
205                                           &modes[1], Client_ID(target));
206         }
207 } /* join_forward */
208
209
210 static bool
211 join_send_topic(CLIENT *Client, CLIENT *target, CHANNEL *chan,
212                                         const char *channame)
213 {
214         const char *topic;
215
216         if (Client_Type(Client) != CLIENT_USER)
217                 return true;
218         /* acknowledge join */
219         if (!IRC_WriteStrClientPrefix(Client, target, "JOIN :%s", channame))
220                 return false;
221
222         /* Send topic to client, if any */
223         topic = Channel_Topic(chan);
224         assert(topic != NULL);
225         if (*topic) {
226                 if (!IRC_WriteStrClient(Client, RPL_TOPIC_MSG,
227                         Client_ID(Client), channame, topic))
228                                 return false;
229 #ifndef STRICT_RFC
230                 if (!IRC_WriteStrClient(Client, RPL_TOPICSETBY_MSG,
231                         Client_ID(Client), channame,
232                         Channel_TopicWho(chan),
233                         Channel_TopicTime(chan)))
234                                 return false;
235 #endif
236         }
237         /* send list of channel members to client */
238         if (!IRC_Send_NAMES(Client, chan))
239                 return false;
240         return IRC_WriteStrClient(Client, RPL_ENDOFNAMES_MSG, Client_ID(Client), Channel_Name(chan));
241 }
242
243
244 GLOBAL bool
245 IRC_JOIN( CLIENT *Client, REQUEST *Req )
246 {
247         char *channame, *key = NULL, *flags, *lastkey = NULL, *lastchan = NULL;
248         CLIENT *target;
249         CHANNEL *chan;
250
251         assert( Client != NULL );
252         assert( Req != NULL );
253
254         /* Bad number of arguments? */
255         if (Req->argc < 1 || Req->argc > 2)
256                 return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG,
257                                           Client_ID(Client), Req->command);
258
259         /* Who is the sender? */
260         if (Client_Type(Client) == CLIENT_SERVER)
261                 target = Client_Search(Req->prefix);
262         else
263                 target = Client;
264
265         if (!target)
266                 return IRC_WriteStrClient(Client, ERR_NOSUCHNICK_MSG, Client_ID(Client), Req->prefix);
267
268         /* Is argument "0"? */
269         if (Req->argc == 1 && !strncmp("0", Req->argv[0], 2))
270                 return part_from_all_channels(Client, target);
271
272         /* Are channel keys given? */
273         if (Req->argc > 1)
274                 key = strtok_r(Req->argv[1], ",", &lastkey);
275
276         channame = Req->argv[0];
277         channame = strtok_r(channame, ",", &lastchan);
278
279         /* Make sure that "channame" is not the empty string ("JOIN :") */
280         if (! channame)
281                 return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG,
282                                           Client_ID(Client), Req->command);
283
284         while (channame) {
285                 flags = NULL;
286
287                 /* Did the server include channel-user-modes? */
288                 if (Client_Type(Client) == CLIENT_SERVER) {
289                         flags = strchr(channame, 0x7);
290                         if (flags) {
291                                 *flags = '\0';
292                                 flags++;
293                         }
294                 }
295
296                 chan = Channel_Search(channame);
297                 if (!chan && Conf_PredefChannelsOnly) {
298                          /* channel must be created, but server does not allow this */
299                         IRC_WriteStrClient(Client, ERR_BANNEDFROMCHAN_MSG, Client_ID(Client), channame);
300                         break;
301                 }
302
303                 /* Local client? */
304                 if (Client_Type(Client) == CLIENT_USER) {
305                         /* Test if the user has reached the channel limit */
306                         if ((Conf_MaxJoins > 0) &&
307                             (Channel_CountForUser(Client) >= Conf_MaxJoins))
308                                 return IRC_WriteStrClient(Client,
309                                                 ERR_TOOMANYCHANNELS_MSG,
310                                                 Client_ID(Client), channame);
311                         if (chan) {
312                                 /* Already existing channel: check if the
313                                  * client is allowed to join */
314                                 if (!join_allowed(Client, chan, channame, key))
315                                         break;
316                         } else {
317                                 /* New channel: first user will become channel
318                                  * operator unless this is a modeless channel */
319                                 if (*channame != '+')
320                                         flags = "o";
321                         }
322
323                         /* Local client: update idle time */
324                         Conn_UpdateIdle(Client_Conn(Client));
325                 } else {
326                         /* Remote server: we don't need to know whether the
327                          * client is invited or not, but we have to make sure
328                          * that the "one shot" entries (generated by INVITE
329                          * commands) in this list become deleted when a user
330                          * joins a channel this way. */
331                         if (chan)
332                                 (void)Lists_Check(Channel_GetListInvites(chan),
333                                                   target);
334                 }
335
336                 /* Join channel (and create channel if it doesn't exist) */
337                 if (!Channel_Join(target, channame))
338                         break;
339
340                 if (!chan) { /* channel is new; it has been created above */
341                         chan = Channel_Search(channame);
342                         assert(chan != NULL);
343                         if (Channel_IsModeless(chan)) {
344                                 Channel_ModeAdd(chan, 't'); /* /TOPIC not allowed */
345                                 Channel_ModeAdd(chan, 'n'); /* no external msgs */
346                         }
347                 }
348                 assert(chan != NULL);
349
350                 join_set_channelmodes(chan, target, flags);
351
352                 join_forward(Client, target, chan, channame);
353
354                 if (!join_send_topic(Client, target, chan, channame))
355                         break; /* write error */
356
357                 /* next channel? */
358                 channame = strtok_r(NULL, ",", &lastchan);
359                 if (channame && key)
360                         key = strtok_r(NULL, ",", &lastkey);
361         }
362         return CONNECTED;
363 } /* IRC_JOIN */
364
365
366 /**
367  * Handler for the IRC "PART" command.
368  */
369 GLOBAL bool
370 IRC_PART(CLIENT * Client, REQUEST * Req)
371 {
372         CLIENT *target;
373         char *chan;
374
375         assert(Client != NULL);
376         assert(Req != NULL);
377
378         if (Req->argc < 1 || Req->argc > 2)
379                 return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG,
380                                           Client_ID(Client), Req->command);
381
382         /* Get the sender */
383         if (Client_Type(Client) == CLIENT_SERVER)
384                 target = Client_Search(Req->prefix);
385         else
386                 target = Client;
387         if (!target)
388                 return IRC_WriteStrClient(Client, ERR_NOSUCHNICK_MSG,
389                                           Client_ID(Client), Req->prefix);
390
391         /* Loop over all the given channel names */
392         chan = strtok(Req->argv[0], ",");
393
394         /* Make sure that "chan" is not the empty string ("PART :") */
395         if (! chan)
396                 return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG,
397                                           Client_ID(Client), Req->command);
398
399         while (chan) {
400                 Channel_Part(target, Client, chan,
401                              Req->argc > 1 ? Req->argv[1] : Client_ID(target));
402                 chan = strtok(NULL, ",");
403         }
404
405         /* Update idle time, if local client */
406         if (Client_Conn(Client) > NONE)
407                 Conn_UpdateIdle(Client_Conn(Client));
408
409         return CONNECTED;
410 } /* IRC_PART */
411
412
413 GLOBAL bool
414 IRC_TOPIC( CLIENT *Client, REQUEST *Req )
415 {
416         CHANNEL *chan;
417         CLIENT *from;
418         char *topic;
419         bool onchannel, topicok, use_servermode, r;
420
421         assert( Client != NULL );
422         assert( Req != NULL );
423
424         if (Req->argc < 1 || Req->argc > 2)
425                 return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG,
426                                           Client_ID(Client), Req->command);
427
428         if (Client_Type(Client) == CLIENT_SERVER)
429                 from = Client_Search(Req->prefix);
430         else
431                 from = Client;
432
433         if (!from)
434                 return IRC_WriteStrClient(Client, ERR_NOSUCHNICK_MSG,
435                                           Client_ID(Client), Req->prefix);
436
437         chan = Channel_Search(Req->argv[0]);
438         if (!chan)
439                 return IRC_WriteStrClient(from, ERR_NOSUCHCHANNEL_MSG,
440                                           Client_ID(from), Req->argv[0]);
441
442         Channel_CheckAdminRights(chan, Client, from,
443                                  &onchannel, &topicok, &use_servermode);
444
445         if (!onchannel && !topicok)
446                 return IRC_WriteStrClient(from, ERR_NOTONCHANNEL_MSG,
447                                           Client_ID(from), Req->argv[0]);
448
449         if (Req->argc == 1) {
450                 /* Request actual topic */
451                 topic = Channel_Topic(chan);
452                 if (*topic) {
453                         r = IRC_WriteStrClient(from, RPL_TOPIC_MSG,
454                                                Client_ID(Client),
455                                                Channel_Name(chan), topic);
456 #ifndef STRICT_RFC
457                         r = IRC_WriteStrClient(from, RPL_TOPICSETBY_MSG,
458                                                Client_ID(Client),
459                                                Channel_Name(chan),
460                                                Channel_TopicWho(chan),
461                                                Channel_TopicTime(chan));
462 #endif
463                         return r;
464                 }
465                 else
466                         return IRC_WriteStrClient(from, RPL_NOTOPIC_MSG,
467                                                   Client_ID(from),
468                                                   Channel_Name(chan));
469         }
470
471         if (strchr(Channel_Modes(chan), 't')) {
472                 /* Topic Lock. Is the user a channel or IRC operator? */
473                 if (!topicok)
474                         return IRC_WriteStrClient(from, ERR_CHANOPRIVSNEEDED_MSG,
475                                                   Client_ID(from),
476                                                   Channel_Name(chan));
477         }
478
479         /* Set new topic */
480         Channel_SetTopic(chan, from, Req->argv[1]);
481         LogDebug("%s \"%s\" set topic on \"%s\": %s",
482                  Client_TypeText(from), Client_Mask(from), Channel_Name(chan),
483                  Req->argv[1][0] ? Req->argv[1] : "<none>");
484
485         if (use_servermode)
486                 from = Client_ThisServer();
487
488         /* Update channel and forward new topic to other servers */
489         if (!Channel_IsLocal(chan))
490                 IRC_WriteStrServersPrefix(Client, from, "TOPIC %s :%s",
491                                           Req->argv[0], Req->argv[1]);
492         IRC_WriteStrChannelPrefix(Client, chan, from, false, "TOPIC %s :%s",
493                                   Req->argv[0], Req->argv[1]);
494
495         if (Client_Type(Client) == CLIENT_USER)
496                 return IRC_WriteStrClientPrefix(Client, Client, "TOPIC %s :%s",
497                                                 Req->argv[0], Req->argv[1]);
498         else
499                 return CONNECTED;
500 } /* IRC_TOPIC */
501
502
503 /**
504  * Handler for the IRC "LIST" command.
505  * This implementation handles the local case as well as the forwarding of the
506  * LIST command to other servers in the IRC network.
507  */
508 GLOBAL bool
509 IRC_LIST( CLIENT *Client, REQUEST *Req )
510 {
511         char *pattern;
512         CHANNEL *chan;
513         CLIENT *from, *target;
514
515         assert( Client != NULL );
516         assert( Req != NULL );
517
518         /* Bad number of prameters? */
519         if( Req->argc > 2 )
520                 return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG,
521                         Client_ID( Client ), Req->command );
522
523         if( Req->argc > 0 )
524                 pattern = strtok( Req->argv[0], "," );
525         else
526                 pattern = "*";
527
528         /* Get sender from prefix, if any */
529         if( Client_Type( Client ) == CLIENT_SERVER )
530                 from = Client_Search( Req->prefix );
531         else
532                 from = Client;
533
534         if( ! from )
535                 return IRC_WriteStrClient( Client, ERR_NOSUCHSERVER_MSG,
536                                 Client_ID( Client ), Req->prefix );
537
538         if( Req->argc == 2 )
539         {
540                 /* Forward to other server? */
541                 target = Client_Search( Req->argv[1] );
542                 if(( ! target ) || ( Client_Type( target ) != CLIENT_SERVER ))
543                         return IRC_WriteStrClient( from, ERR_NOSUCHSERVER_MSG,
544                                         Client_ID( Client ), Req->argv[1] );
545
546                 if( target != Client_ThisServer( ))
547                 {
548                         /* Target is indeed an other server, forward it! */
549                         return IRC_WriteStrClientPrefix( target, from,
550                                         "LIST %s :%s", Client_ID( from ),
551                                         Req->argv[1] );
552                 }
553         }
554
555         while( pattern )
556         {
557                 /* Loop through all the channels */
558                 chan = Channel_First( );
559                 while( chan )
560                 {
561                         /* Check search pattern */
562                         if( Match( pattern, Channel_Name( chan )))
563                         {
564                                 /* Gotcha! */
565                                 if( ! strchr( Channel_Modes( chan ), 's' ) ||
566                                     Channel_IsMemberOf( chan, from ))
567                                 {
568                                         if( ! IRC_WriteStrClient( from,
569                                             RPL_LIST_MSG, Client_ID( from ),
570                                             Channel_Name( chan ),
571                                             Channel_MemberCount( chan ),
572                                             Channel_Topic( chan )))
573                                                 return DISCONNECTED;
574                                 }
575                         }
576                         chan = Channel_Next( chan );
577                 }
578
579                 /* Get next name ... */
580                 if( Req->argc > 0 )
581                         pattern = strtok( NULL, "," );
582                 else
583                         pattern = NULL;
584         }
585
586         return IRC_WriteStrClient( from, RPL_LISTEND_MSG, Client_ID( from ));
587 } /* IRC_LIST */
588
589
590 GLOBAL bool
591 IRC_CHANINFO( CLIENT *Client, REQUEST *Req )
592 {
593         char modes_add[COMMAND_LEN], l[16], *ptr;
594         CLIENT *from;
595         CHANNEL *chan;
596         int arg_topic;
597
598         assert( Client != NULL );
599         assert( Req != NULL );
600
601         /* Bad number of parameters? */
602         if(( Req->argc < 2 ) || ( Req->argc == 4 ) || ( Req->argc > 5 )) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
603
604         /* Compatibility kludge */
605         if( Req->argc == 5 ) arg_topic = 4;
606         else if( Req->argc == 3 ) arg_topic = 2;
607         else arg_topic = -1;
608
609         /* Search origin */
610         from = Client_Search( Req->prefix );
611         if( ! from ) return IRC_WriteStrClient( Client, ERR_NOSUCHNICK_MSG, Client_ID( Client ), Req->prefix );
612
613         /* Search or create channel */
614         chan = Channel_Search( Req->argv[0] );
615         if( ! chan ) chan = Channel_Create( Req->argv[0] );
616         if( ! chan ) return CONNECTED;
617
618         if( Req->argv[1][0] == '+' )
619         {
620                 ptr = Channel_Modes( chan );
621                 if( ! *ptr )
622                 {
623                         /* OK, this channel doesn't have modes jet, set the received ones: */
624                         Channel_SetModes( chan, &Req->argv[1][1] );
625
626                         if( Req->argc == 5 )
627                         {
628                                 if( strchr( Channel_Modes( chan ), 'k' )) Channel_SetKey( chan, Req->argv[2] );
629                                 if( strchr( Channel_Modes( chan ), 'l' )) Channel_SetMaxUsers( chan, atol( Req->argv[3] ));
630                         }
631                         else
632                         {
633                                 /* Delete modes which we never want to inherit */
634                                 Channel_ModeDel( chan, 'l' );
635                                 Channel_ModeDel( chan, 'k' );
636                         }
637
638                         strcpy( modes_add, "" );
639                         ptr = Channel_Modes( chan );
640                         while( *ptr )
641                         {
642                                 if( *ptr == 'l' )
643                                 {
644                                         snprintf( l, sizeof( l ), " %lu", Channel_MaxUsers( chan ));
645                                         strlcat( modes_add, l, sizeof( modes_add ));
646                                 }
647                                 if( *ptr == 'k' )
648                                 {
649                                         strlcat( modes_add, " ", sizeof( modes_add ));
650                                         strlcat( modes_add, Channel_Key( chan ), sizeof( modes_add ));
651                                 }
652                                 ptr++;
653                         }
654
655                         /* Inform members of this channel */
656                         IRC_WriteStrChannelPrefix( Client, chan, from, false, "MODE %s +%s%s", Req->argv[0], Channel_Modes( chan ), modes_add );
657                 }
658         }
659         else Log( LOG_WARNING, "CHANINFO: invalid MODE format ignored!" );
660
661         if( arg_topic > 0 )
662         {
663                 /* We got a topic */
664                 ptr = Channel_Topic( chan );
665                 if(( ! *ptr ) && ( Req->argv[arg_topic][0] ))
666                 {
667                         /* OK, there is no topic jet */
668                         Channel_SetTopic(chan, Client, Req->argv[arg_topic]);
669                         IRC_WriteStrChannelPrefix(Client, chan, from, false,
670                              "TOPIC %s :%s", Req->argv[0], Channel_Topic(chan));
671                 }
672         }
673
674         /* Forward CHANINFO to other serevrs */
675         if( Req->argc == 5 ) IRC_WriteStrServersPrefixFlag( Client, from, 'C', "CHANINFO %s %s %s %s :%s", Req->argv[0], Req->argv[1], Req->argv[2], Req->argv[3], Req->argv[4] );
676         else if( Req->argc == 3 ) IRC_WriteStrServersPrefixFlag( Client, from, 'C', "CHANINFO %s %s :%s", Req->argv[0], Req->argv[1], Req->argv[2] );
677         else IRC_WriteStrServersPrefixFlag( Client, from, 'C', "CHANINFO %s %s", Req->argv[0], Req->argv[1] );
678
679         return CONNECTED;
680 } /* IRC_CHANINFO */
681
682
683 /* -eof- */