2 * ngIRCd -- The Next Generation IRC Daemon
3 * Copyright (c)2001-2012 Alexander Barton (alex@barton.de) and Contributors.
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.
16 * IRC commands for mode changes (like MODE, AWAY, etc.)
28 #include "irc-write.h"
39 static bool Client_Mode PARAMS((CLIENT *Client, REQUEST *Req, CLIENT *Origin,
41 static bool Channel_Mode PARAMS((CLIENT *Client, REQUEST *Req, CLIENT *Origin,
44 static bool Add_To_List PARAMS((char what, CLIENT *Prefix, CLIENT *Client,
45 CHANNEL *Channel, const char *Pattern));
46 static bool Del_From_List PARAMS((char what, CLIENT *Prefix, CLIENT *Client,
47 CHANNEL *Channel, const char *Pattern));
49 static bool Send_ListChange PARAMS((const bool IsAdd, const char ModeChar,
50 CLIENT *Prefix, CLIENT *Client,
51 CHANNEL *Channel, const char *Mask));
55 * Handler for the IRC "MODE" command.
57 * See RFC 2812 section 3.1.5 ("user mode message") and section 3.2.3
58 * ("channel mode message"), and RFC 2811 section 4 ("channel modes").
60 * @param Client The client from which this command has been received.
61 * @param Req Request structure with prefix and all parameters.
62 * @returns CONNECTED or DISCONNECTED.
65 IRC_MODE( CLIENT *Client, REQUEST *Req )
70 assert(Client != NULL);
75 return IRC_WriteStrClient(Client, ERR_NEEDMOREPARAMS_MSG,
76 Client_ID(Client), Req->command);
78 /* Origin for answers */
79 if (Client_Type(Client) == CLIENT_SERVER) {
80 origin = Client_Search(Req->prefix);
82 return IRC_WriteStrClient(Client, ERR_NOSUCHNICK_MSG,
88 /* Channel or user mode? */
89 cl = NULL; chan = NULL;
90 if (Client_IsValidNick(Req->argv[0]))
91 cl = Client_Search(Req->argv[0]);
92 if (Channel_IsValidName(Req->argv[0]))
93 chan = Channel_Search(Req->argv[0]);
96 return Client_Mode(Client, Req, origin, cl);
98 return Channel_Mode(Client, Req, origin, chan);
100 /* No target found! */
101 return IRC_WriteStrClient(Client, ERR_NOSUCHNICK_MSG,
102 Client_ID(Client), Req->argv[0]);
107 * Check if the "mode limit" for a client has been reached.
109 * This limit doesn't apply for servers or services!
111 * @param Client The client to check.
112 * @param Count The number of modes already handled.
113 * @return true if the limit has been reached.
116 Mode_Limit_Reached(CLIENT *Client, int Count)
118 if (Client_Type(Client) == CLIENT_SERVER
119 || Client_Type(Client) == CLIENT_SERVICE)
121 if (Count < MAX_HNDL_MODES_ARG)
128 * Handle client mode requests
130 * @param Client The client from which this command has been received.
131 * @param Req Request structure with prefix and all parameters.
132 * @param Origin The originator of the MODE command (prefix).
133 * @param Target The target (client) of this MODE command.
134 * @returns CONNECTED or DISCONNECTED.
137 Client_Mode( CLIENT *Client, REQUEST *Req, CLIENT *Origin, CLIENT *Target )
139 char the_modes[COMMAND_LEN], x[2], *mode_ptr;
144 /* Is the client allowed to request or change the modes? */
145 if (Client_Type(Client) == CLIENT_USER) {
146 /* Users are only allowed to manipulate their own modes! */
147 if (Target != Client)
148 return IRC_WriteStrClient(Client,
149 ERR_USERSDONTMATCH_MSG,
153 /* Mode request: let's answer it :-) */
155 return IRC_WriteStrClient(Origin, RPL_UMODEIS_MSG,
157 Client_Modes(Target));
160 mode_ptr = Req->argv[mode_arg];
162 /* Initial state: set or unset modes? */
163 if (*mode_ptr == '+') {
165 strcpy(the_modes, "+");
166 } else if (*mode_ptr == '-') {
168 strcpy(the_modes, "-");
170 return IRC_WriteStrClient(Origin, ERR_UMODEUNKNOWNFLAG_MSG,
178 /* Try next argument if there's any */
180 if (mode_arg < Req->argc)
181 mode_ptr = Req->argv[mode_arg];
189 if ((*mode_ptr == '+' && !set)
190 || (*mode_ptr == '-' && set)) {
191 /* Action modifier ("+"/"-") must be changed */
192 len = strlen(the_modes) - 1;
193 if (the_modes[len] == '+'
194 || the_modes[len] == '-') {
195 /* Last character in the "result
196 * string" was an "action", so just
197 * overwrite it with the new action */
198 the_modes[len] = *mode_ptr;
200 /* Append new modifier character to
201 * the resulting mode string */
203 strlcat(the_modes, x,
206 if (*mode_ptr == '+')
217 case 'C': /* Only messages from clients sharing a channel */
218 case 'i': /* Invisible */
219 case 's': /* Server messages */
220 case 'w': /* Wallops messages */
224 if (Client_Type(Client) == CLIENT_SERVER) {
226 Client_SetAway(Origin, DEFAULT_AWAY_MSG);
228 ok = IRC_WriteStrClient(Origin,
229 ERR_NOPRIVILEGES_MSG,
232 case 'c': /* Receive connect notices
233 * (only settable by IRC operators!) */
234 if (!set || Client_Type(Client) == CLIENT_SERVER
235 || Client_OperByMe(Origin))
238 ok = IRC_WriteStrClient(Origin,
239 ERR_NOPRIVILEGES_MSG,
242 case 'o': /* IRC operator (only unsettable!) */
243 if (!set || Client_Type(Client) == CLIENT_SERVER) {
244 Client_SetOperByMe(Target, false);
247 ok = IRC_WriteStrClient(Origin,
248 ERR_NOPRIVILEGES_MSG,
251 case 'r': /* Restricted (only settable) */
252 if (set || Client_Type(Client) == CLIENT_SERVER)
255 ok = IRC_WriteStrClient(Origin,
259 case 'x': /* Cloak hostname */
260 if (Client_HasMode(Client, 'r'))
261 ok = IRC_WriteStrClient(Origin,
268 if (Client_Type(Client) != CLIENT_SERVER) {
270 "Unknown mode \"%c%c\" from \"%s\"!?",
271 set ? '+' : '-', *mode_ptr,
273 ok = IRC_WriteStrClient(Origin,
274 ERR_UMODEUNKNOWNFLAG2_MSG,
281 "Handling unknown mode \"%c%c\" from \"%s\" for \"%s\" ...",
282 set ? '+' : '-', *mode_ptr,
283 Client_ID(Origin), Client_ID(Target));
291 /* Is there a valid mode change? */
296 if (Client_ModeAdd(Target, x[0]))
297 strlcat(the_modes, x, sizeof(the_modes));
299 if (Client_ModeDel(Target, x[0]))
300 strlcat(the_modes, x, sizeof(the_modes));
304 /* Are there changed modes? */
306 /* Remove needless action modifier characters */
307 len = strlen(the_modes) - 1;
308 if (the_modes[len] == '+' || the_modes[len] == '-')
309 the_modes[len] = '\0';
311 if (Client_Type(Client) == CLIENT_SERVER) {
312 /* Forward modes to other servers */
313 if (Client_Conn(Target) != NONE) {
314 /* Remote server (service?) changed modes
315 * for one of our clients. Inform it! */
316 IRC_WriteStrClientPrefix(Target, Origin,
321 IRC_WriteStrServersPrefix(Client, Origin,
326 /* Send reply to client and inform other servers */
327 ok = IRC_WriteStrClientPrefix(Client, Origin,
331 IRC_WriteStrServersPrefix(Client, Origin,
336 LogDebug("%s \"%s\": Mode change, now \"%s\".",
337 Client_TypeText(Target), Client_Mask(Target),
338 Client_Modes(Target));
341 IRC_SetPenalty(Client, 1);
347 Channel_Mode_Answer_Request(CLIENT *Origin, CHANNEL *Channel)
349 char the_modes[COMMAND_LEN], the_args[COMMAND_LEN], argadd[CLIENT_PASS_LEN];
350 const char *mode_ptr;
352 /* Member or not? -- That's the question! */
353 if (!Channel_IsMemberOf(Channel, Origin))
354 return IRC_WriteStrClient(Origin, RPL_CHANNELMODEIS_MSG,
355 Client_ID(Origin), Channel_Name(Channel), Channel_Modes(Channel));
357 /* The sender is a member: generate extended reply */
358 strlcpy(the_modes, Channel_Modes(Channel), sizeof(the_modes));
359 mode_ptr = the_modes;
365 snprintf(argadd, sizeof(argadd), " %lu", Channel_MaxUsers(Channel));
366 strlcat(the_args, argadd, sizeof(the_args));
369 strlcat(the_args, " ", sizeof(the_args));
370 strlcat(the_args, Channel_Key(Channel), sizeof(the_args));
376 strlcat(the_modes, the_args, sizeof(the_modes));
378 if (!IRC_WriteStrClient(Origin, RPL_CHANNELMODEIS_MSG,
379 Client_ID(Origin), Channel_Name(Channel),
383 if (!IRC_WriteStrClient(Origin, RPL_CREATIONTIME_MSG,
384 Client_ID(Origin), Channel_Name(Channel),
385 Channel_CreationTime(Channel)))
393 * Handle channel mode and channel-user mode changes
396 Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel)
398 char the_modes[COMMAND_LEN], the_args[COMMAND_LEN], x[2],
399 argadd[CLIENT_PASS_LEN], *mode_ptr;
400 bool connected, set, skiponce, retval, onchannel, modeok, use_servermode;
401 int mode_arg, arg_arg, mode_arg_count = 0;
406 if (Channel_IsModeless(Channel))
407 return IRC_WriteStrClient(Client, ERR_NOCHANMODES_MSG,
408 Client_ID(Client), Channel_Name(Channel));
410 /* Mode request: let's answer it :-) */
412 return Channel_Mode_Answer_Request(Origin, Channel);
414 Channel_CheckAdminRights(Channel, Client, Origin,
415 &onchannel, &modeok, &use_servermode);
417 if (!onchannel && !modeok)
418 return IRC_WriteStrClient(Origin, ERR_NOTONCHANNEL_MSG,
420 Channel_Name(Channel));
423 mode_ptr = Req->argv[mode_arg];
424 if (Req->argc > mode_arg + 1)
425 arg_arg = mode_arg + 1;
429 /* Initial state: set or unset modes? */
443 /* Prepare reply string */
444 strcpy(the_modes, set ? "+" : "-");
448 connected = CONNECTED;
453 /* Try next argument if there's any */
456 if (arg_arg > mode_arg)
461 if (mode_arg >= Req->argc)
463 mode_ptr = Req->argv[mode_arg];
465 if (Req->argc > mode_arg + 1)
466 arg_arg = mode_arg + 1;
475 if (((*mode_ptr == '+') && !set)
476 || ((*mode_ptr == '-') && set)) {
477 /* Action modifier ("+"/"-") must be changed ... */
478 len = strlen(the_modes) - 1;
479 if (the_modes[len] == '+' || the_modes[len] == '-') {
480 /* Adjust last action modifier in result */
481 the_modes[len] = *mode_ptr;
483 /* Append modifier character to result string */
485 strlcat(the_modes, x, sizeof(the_modes));
487 set = *mode_ptr == '+';
492 /* Are there arguments left? */
493 if (arg_arg >= Req->argc)
501 /* --- Channel modes --- */
502 case 'i': /* Invite only */
503 case 'm': /* Moderated */
504 case 'n': /* Only members can write */
505 case 'R': /* Registered users only */
506 case 's': /* Secret channel */
507 case 't': /* Topic locked */
508 case 'z': /* Secure connections only */
512 connected = IRC_WriteStrClient(Origin,
513 ERR_CHANOPRIVSNEEDED_MSG,
514 Client_ID(Origin), Channel_Name(Channel));
516 case 'k': /* Channel key */
517 if (Mode_Limit_Reached(Client, mode_arg_count++))
523 connected = IRC_WriteStrClient(Origin,
524 ERR_CHANOPRIVSNEEDED_MSG,
526 Channel_Name(Channel));
529 if (arg_arg > mode_arg) {
531 Channel_ModeDel(Channel, 'k');
532 Channel_SetKey(Channel,
534 strlcpy(argadd, Channel_Key(Channel),
538 connected = IRC_WriteStrClient(Origin,
539 ERR_CHANOPRIVSNEEDED_MSG,
541 Channel_Name(Channel));
543 Req->argv[arg_arg][0] = '\0';
546 connected = IRC_WriteStrClient(Origin,
547 ERR_NEEDMOREPARAMS_MSG,
548 Client_ID(Origin), Req->command);
552 case 'l': /* Member limit */
553 if (Mode_Limit_Reached(Client, mode_arg_count++))
559 connected = IRC_WriteStrClient(Origin,
560 ERR_CHANOPRIVSNEEDED_MSG,
562 Channel_Name(Channel));
565 if (arg_arg > mode_arg) {
567 l = atol(Req->argv[arg_arg]);
568 if (l > 0 && l < 0xFFFF) {
569 Channel_ModeDel(Channel, 'l');
570 Channel_SetMaxUsers(Channel, l);
571 snprintf(argadd, sizeof(argadd),
576 connected = IRC_WriteStrClient(Origin,
577 ERR_CHANOPRIVSNEEDED_MSG,
579 Channel_Name(Channel));
581 Req->argv[arg_arg][0] = '\0';
584 connected = IRC_WriteStrClient(Origin,
585 ERR_NEEDMOREPARAMS_MSG,
586 Client_ID(Origin), Req->command);
590 case 'O': /* IRC operators only */
592 /* Only IRC operators are allowed to
593 * set the 'O' channel mode! */
594 if (set && !(Client_OperByMe(Client)
595 || Client_Type(Client) == CLIENT_SERVER))
596 connected = IRC_WriteStrClient(Origin,
597 ERR_NOPRIVILEGES_MSG,
602 connected = IRC_WriteStrClient(Origin,
603 ERR_CHANOPRIVSNEEDED_MSG,
605 Channel_Name(Channel));
607 case 'P': /* Persistent channel */
609 /* Only IRC operators are allowed to
610 * set the 'P' channel mode! */
611 if (set && !(Client_OperByMe(Client)
612 || Client_Type(Client) == CLIENT_SERVER))
613 connected = IRC_WriteStrClient(Origin,
614 ERR_NOPRIVILEGES_MSG,
619 connected = IRC_WriteStrClient(Origin,
620 ERR_CHANOPRIVSNEEDED_MSG,
622 Channel_Name(Channel));
624 /* --- Channel user modes --- */
628 if (Client_Type(Client) != CLIENT_SERVER) {
629 connected = IRC_WriteStrClient(Origin,
630 ERR_CHANOPRIVSNEEDED_MSG,
632 Channel_Name(Channel));
635 case 'o': /* Channel operator */
636 case 'v': /* Voice */
637 if (arg_arg > mode_arg) {
639 client = Client_Search(Req->argv[arg_arg]);
643 connected = IRC_WriteStrClient(Client,
648 connected = IRC_WriteStrClient(Origin,
649 ERR_CHANOPRIVSNEEDED_MSG,
651 Channel_Name(Channel));
653 Req->argv[arg_arg][0] = '\0';
656 connected = IRC_WriteStrClient(Origin,
657 ERR_NEEDMOREPARAMS_MSG,
658 Client_ID(Origin), Req->command);
662 /* --- Channel lists --- */
663 case 'I': /* Invite lists */
664 case 'b': /* Ban lists */
665 case 'e': /* Channel exception lists */
666 if (Mode_Limit_Reached(Client, mode_arg_count++))
668 if (arg_arg > mode_arg) {
672 ? Add_To_List(*mode_ptr, Origin,
675 : Del_From_List(*mode_ptr, Origin,
679 connected = IRC_WriteStrClient(Origin,
680 ERR_CHANOPRIVSNEEDED_MSG,
682 Channel_Name(Channel));
684 Req->argv[arg_arg][0] = '\0';
689 Channel_ShowInvites(Origin, Channel);
692 Channel_ShowBans(Origin, Channel);
695 Channel_ShowExcepts(Origin, Channel);
701 if (Client_Type(Client) != CLIENT_SERVER) {
703 "Unknown mode \"%c%c\" from \"%s\" on %s!?",
704 set ? '+' : '-', *mode_ptr,
705 Client_ID(Origin), Channel_Name(Channel));
706 connected = IRC_WriteStrClient(Origin,
708 Client_ID(Origin), *mode_ptr,
709 Channel_Name(Channel));
713 "Handling unknown mode \"%c%c\" from \"%s\" on %s ...",
714 set ? '+' : '-', *mode_ptr,
715 Client_ID(Origin), Channel_Name(Channel));
723 /* Is there a valid mode change? */
727 /* Validate target client */
728 if (client && (!Channel_IsMemberOf(Channel, client))) {
729 if (!IRC_WriteStrClient
730 (Origin, ERR_USERNOTINCHANNEL_MSG,
731 Client_ID(Origin), Client_ID(client),
732 Channel_Name(Channel)))
739 /* Channel-User-Mode */
741 ? Channel_UserModeAdd(Channel, client, x[0])
742 : Channel_UserModeDel(Channel, client, x[0]);
744 strlcat(the_args, " ", sizeof(the_args));
745 strlcat(the_args, Client_ID(client),
747 strlcat(the_modes, x, sizeof(the_modes));
749 ("User \"%s\": Mode change on %s, now \"%s\"",
750 Client_Mask(client), Channel_Name(Channel),
751 Channel_UserModes(Channel, client));
756 ? Channel_ModeAdd(Channel, x[0])
757 : Channel_ModeDel(Channel, x[0]);
759 strlcat(the_modes, x, sizeof(the_modes));
760 LogDebug("Channel %s: Mode change, now \"%s\".",
761 Channel_Name(Channel),
762 Channel_Modes(Channel));
766 /* Are there additional arguments to add? */
768 strlcat(the_args, " ", sizeof(the_args));
769 strlcat(the_args, argadd, sizeof(the_args));
774 /* Are there changed modes? */
776 /* Clean up mode string */
777 len = strlen(the_modes) - 1;
778 if ((the_modes[len] == '+') || (the_modes[len] == '-'))
779 the_modes[len] = '\0';
781 if (Client_Type(Client) == CLIENT_SERVER) {
782 /* MODE requests for local channels from other servers
783 * are definitely invalid! */
784 if (Channel_IsLocal(Channel)) {
785 Log(LOG_ALERT, "Got remote MODE command for local channel!? Ignored.");
789 /* Forward mode changes to channel users and all the
790 * other remote servers: */
791 IRC_WriteStrServersPrefix(Client, Origin,
792 "MODE %s %s%s", Channel_Name(Channel),
793 the_modes, the_args);
794 IRC_WriteStrChannelPrefix(Client, Channel, Origin,
795 false, "MODE %s %s%s", Channel_Name(Channel),
796 the_modes, the_args);
799 Origin = Client_ThisServer();
800 /* Send reply to client and inform other servers and channel users */
801 connected = IRC_WriteStrClientPrefix(Client, Origin,
802 "MODE %s %s%s", Channel_Name(Channel),
803 the_modes, the_args);
804 /* Only forward requests for non-local channels */
805 if (!Channel_IsLocal(Channel))
806 IRC_WriteStrServersPrefix(Client, Origin,
807 "MODE %s %s%s", Channel_Name(Channel),
808 the_modes, the_args);
809 IRC_WriteStrChannelPrefix(Client, Channel, Origin,
810 false, "MODE %s %s%s", Channel_Name(Channel),
811 the_modes, the_args);
815 IRC_SetPenalty(Client, 1);
821 IRC_AWAY( CLIENT *Client, REQUEST *Req )
823 assert( Client != NULL );
824 assert( Req != NULL );
826 if( Req->argc > 1 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
828 if(( Req->argc == 1 ) && (Req->argv[0][0] ))
830 Client_SetAway( Client, Req->argv[0] );
831 Client_ModeAdd( Client, 'a' );
832 IRC_WriteStrServersPrefix( Client, Client, "MODE %s :+a", Client_ID( Client ));
833 return IRC_WriteStrClient( Client, RPL_NOWAWAY_MSG, Client_ID( Client ));
837 Client_ModeDel( Client, 'a' );
838 IRC_WriteStrServersPrefix( Client, Client, "MODE %s :-a", Client_ID( Client ));
839 return IRC_WriteStrClient( Client, RPL_UNAWAY_MSG, Client_ID( Client ));
845 * Add entries to channel invite, ban and exception lists.
847 * @param what Can be 'I' for invite, 'b' for ban, and 'e' for exception list.
848 * @param Prefix The originator of the command.
849 * @param Client The sender of the command.
850 * @param Channel The channel of which the list should be modified.
851 * @param Pattern The pattern to add to the list.
852 * @return CONNECTED or DISCONNECTED.
855 Add_To_List(char what, CLIENT *Prefix, CLIENT *Client, CHANNEL *Channel,
859 struct list_head *list = NULL;
860 long int current_count;
862 assert(Client != NULL);
863 assert(Channel != NULL);
864 assert(Pattern != NULL);
865 assert(what == 'I' || what == 'b' || what == 'e');
867 mask = Lists_MakeMask(Pattern);
868 current_count = Lists_Count(Channel_GetListInvites(Channel))
869 + Lists_Count(Channel_GetListExcepts(Channel))
870 + Lists_Count(Channel_GetListBans(Channel));
874 list = Channel_GetListInvites(Channel);
877 list = Channel_GetListBans(Channel);
880 list = Channel_GetListExcepts(Channel);
884 if (Lists_CheckDupeMask(list, mask))
886 if (Client_Type(Client) == CLIENT_USER &&
887 current_count >= MAX_HNDL_CHANNEL_LISTS)
888 return IRC_WriteStrClient(Client, ERR_LISTFULL_MSG,
890 Channel_Name(Channel), mask,
891 MAX_HNDL_CHANNEL_LISTS);
895 if (!Channel_AddInvite(Channel, mask, false))
899 if (!Channel_AddBan(Channel, mask))
903 if (!Channel_AddExcept(Channel, mask))
907 return Send_ListChange(true, what, Prefix, Client, Channel, mask);
912 * Delete entries from channel invite, ban and exeption lists.
914 * @param what Can be 'I' for invite, 'b' for ban, and 'e' for exception list.
915 * @param Prefix The originator of the command.
916 * @param Client The sender of the command.
917 * @param Channel The channel of which the list should be modified.
918 * @param Pattern The pattern to add to the list.
919 * @return CONNECTED or DISCONNECTED.
922 Del_From_List(char what, CLIENT *Prefix, CLIENT *Client, CHANNEL *Channel,
926 struct list_head *list = NULL;
928 assert(Client != NULL);
929 assert(Channel != NULL);
930 assert(Pattern != NULL);
931 assert(what == 'I' || what == 'b' || what == 'e');
933 mask = Lists_MakeMask(Pattern);
937 list = Channel_GetListInvites(Channel);
940 list = Channel_GetListBans(Channel);
943 list = Channel_GetListExcepts(Channel);
947 if (!Lists_CheckDupeMask(list, mask))
949 Lists_Del(list, mask);
951 return Send_ListChange(false, what, Prefix, Client, Channel, mask);
956 * Send information about changed channel invite/ban/exception lists to clients.
958 * @param IsAdd true if the list item has been added, false otherwise.
959 * @param ModeChar The mode to use (e. g. 'b' or 'I')
960 * @param Prefix The originator of the mode list change.
961 * @param Client The sender of the command.
962 * @param Channel The channel of which the list has been modified.
963 * @param Mask The mask which has been added or removed.
964 * @return CONNECTED or DISCONNECTED.
967 Send_ListChange(const bool IsAdd, const char ModeChar, CLIENT *Prefix,
968 CLIENT *Client, CHANNEL *Channel, const char *Mask)
972 /* Send confirmation to the client */
973 if (Client_Type(Client) == CLIENT_USER)
974 ok = IRC_WriteStrClientPrefix(Client, Prefix, "MODE %s %c%c %s",
975 Channel_Name(Channel),
979 /* to other servers */
980 IRC_WriteStrServersPrefix(Client, Prefix, "MODE %s %c%c %s",
981 Channel_Name(Channel), IsAdd ? '+' : '-',
984 /* and local users in channel */
985 IRC_WriteStrChannelPrefix(Client, Channel, Prefix, false,
986 "MODE %s %c%c %s", Channel_Name(Channel),
987 IsAdd ? '+' : '-', ModeChar, Mask );
990 } /* Send_ListChange */