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 'R': /* Registered (not [un]settable by clients) */
260 if (Client_Type(Client) == CLIENT_SERVER)
263 ok = IRC_WriteStrClient(Origin,
264 ERR_NICKREGISTER_MSG,
267 case 'x': /* Cloak hostname */
268 if (Client_HasMode(Client, 'r'))
269 ok = IRC_WriteStrClient(Origin,
276 if (Client_Type(Client) != CLIENT_SERVER) {
278 "Unknown mode \"%c%c\" from \"%s\"!?",
279 set ? '+' : '-', *mode_ptr,
281 ok = IRC_WriteStrClient(Origin,
282 ERR_UMODEUNKNOWNFLAG2_MSG,
289 "Handling unknown mode \"%c%c\" from \"%s\" for \"%s\" ...",
290 set ? '+' : '-', *mode_ptr,
291 Client_ID(Origin), Client_ID(Target));
299 /* Is there a valid mode change? */
304 if (Client_ModeAdd(Target, x[0]))
305 strlcat(the_modes, x, sizeof(the_modes));
307 if (Client_ModeDel(Target, x[0]))
308 strlcat(the_modes, x, sizeof(the_modes));
312 /* Are there changed modes? */
314 /* Remove needless action modifier characters */
315 len = strlen(the_modes) - 1;
316 if (the_modes[len] == '+' || the_modes[len] == '-')
317 the_modes[len] = '\0';
319 if (Client_Type(Client) == CLIENT_SERVER) {
320 /* Forward modes to other servers */
321 if (Client_Conn(Target) != NONE) {
322 /* Remote server (service?) changed modes
323 * for one of our clients. Inform it! */
324 IRC_WriteStrClientPrefix(Target, Origin,
329 IRC_WriteStrServersPrefix(Client, Origin,
334 /* Send reply to client and inform other servers */
335 ok = IRC_WriteStrClientPrefix(Client, Origin,
339 IRC_WriteStrServersPrefix(Client, Origin,
344 LogDebug("%s \"%s\": Mode change, now \"%s\".",
345 Client_TypeText(Target), Client_Mask(Target),
346 Client_Modes(Target));
349 IRC_SetPenalty(Client, 1);
355 Channel_Mode_Answer_Request(CLIENT *Origin, CHANNEL *Channel)
357 char the_modes[COMMAND_LEN], the_args[COMMAND_LEN], argadd[CLIENT_PASS_LEN];
358 const char *mode_ptr;
360 /* Member or not? -- That's the question! */
361 if (!Channel_IsMemberOf(Channel, Origin))
362 return IRC_WriteStrClient(Origin, RPL_CHANNELMODEIS_MSG,
363 Client_ID(Origin), Channel_Name(Channel), Channel_Modes(Channel));
365 /* The sender is a member: generate extended reply */
366 strlcpy(the_modes, Channel_Modes(Channel), sizeof(the_modes));
367 mode_ptr = the_modes;
373 snprintf(argadd, sizeof(argadd), " %lu", Channel_MaxUsers(Channel));
374 strlcat(the_args, argadd, sizeof(the_args));
377 strlcat(the_args, " ", sizeof(the_args));
378 strlcat(the_args, Channel_Key(Channel), sizeof(the_args));
384 strlcat(the_modes, the_args, sizeof(the_modes));
386 if (!IRC_WriteStrClient(Origin, RPL_CHANNELMODEIS_MSG,
387 Client_ID(Origin), Channel_Name(Channel),
391 if (!IRC_WriteStrClient(Origin, RPL_CREATIONTIME_MSG,
392 Client_ID(Origin), Channel_Name(Channel),
393 Channel_CreationTime(Channel)))
401 * Handle channel mode and channel-user mode changes
404 Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel)
406 char the_modes[COMMAND_LEN], the_args[COMMAND_LEN], x[2],
407 argadd[CLIENT_PASS_LEN], *mode_ptr;
408 bool connected, set, skiponce, retval, onchannel, modeok, use_servermode;
409 int mode_arg, arg_arg, mode_arg_count = 0;
414 if (Channel_IsModeless(Channel))
415 return IRC_WriteStrClient(Client, ERR_NOCHANMODES_MSG,
416 Client_ID(Client), Channel_Name(Channel));
418 /* Mode request: let's answer it :-) */
420 return Channel_Mode_Answer_Request(Origin, Channel);
422 Channel_CheckAdminRights(Channel, Client, Origin,
423 &onchannel, &modeok, &use_servermode);
425 if (!onchannel && !modeok)
426 return IRC_WriteStrClient(Origin, ERR_NOTONCHANNEL_MSG,
428 Channel_Name(Channel));
431 mode_ptr = Req->argv[mode_arg];
432 if (Req->argc > mode_arg + 1)
433 arg_arg = mode_arg + 1;
437 /* Initial state: set or unset modes? */
451 /* Prepare reply string */
452 strcpy(the_modes, set ? "+" : "-");
456 connected = CONNECTED;
461 /* Try next argument if there's any */
464 if (arg_arg > mode_arg)
469 if (mode_arg >= Req->argc)
471 mode_ptr = Req->argv[mode_arg];
473 if (Req->argc > mode_arg + 1)
474 arg_arg = mode_arg + 1;
483 if (((*mode_ptr == '+') && !set)
484 || ((*mode_ptr == '-') && set)) {
485 /* Action modifier ("+"/"-") must be changed ... */
486 len = strlen(the_modes) - 1;
487 if (the_modes[len] == '+' || the_modes[len] == '-') {
488 /* Adjust last action modifier in result */
489 the_modes[len] = *mode_ptr;
491 /* Append modifier character to result string */
493 strlcat(the_modes, x, sizeof(the_modes));
495 set = *mode_ptr == '+';
500 /* Are there arguments left? */
501 if (arg_arg >= Req->argc)
509 /* --- Channel modes --- */
510 case 'i': /* Invite only */
511 case 'M': /* Only identified nicks can write */
512 case 'm': /* Moderated */
513 case 'n': /* Only members can write */
514 case 'R': /* Registered users only */
515 case 's': /* Secret channel */
516 case 't': /* Topic locked */
517 case 'z': /* Secure connections only */
521 connected = IRC_WriteStrClient(Origin,
522 ERR_CHANOPRIVSNEEDED_MSG,
523 Client_ID(Origin), Channel_Name(Channel));
525 case 'k': /* Channel key */
526 if (Mode_Limit_Reached(Client, mode_arg_count++))
532 connected = IRC_WriteStrClient(Origin,
533 ERR_CHANOPRIVSNEEDED_MSG,
535 Channel_Name(Channel));
538 if (arg_arg > mode_arg) {
540 Channel_ModeDel(Channel, 'k');
541 Channel_SetKey(Channel,
543 strlcpy(argadd, Channel_Key(Channel),
547 connected = IRC_WriteStrClient(Origin,
548 ERR_CHANOPRIVSNEEDED_MSG,
550 Channel_Name(Channel));
552 Req->argv[arg_arg][0] = '\0';
555 connected = IRC_WriteStrClient(Origin,
556 ERR_NEEDMOREPARAMS_MSG,
557 Client_ID(Origin), Req->command);
561 case 'l': /* Member limit */
562 if (Mode_Limit_Reached(Client, mode_arg_count++))
568 connected = IRC_WriteStrClient(Origin,
569 ERR_CHANOPRIVSNEEDED_MSG,
571 Channel_Name(Channel));
574 if (arg_arg > mode_arg) {
576 l = atol(Req->argv[arg_arg]);
577 if (l > 0 && l < 0xFFFF) {
578 Channel_ModeDel(Channel, 'l');
579 Channel_SetMaxUsers(Channel, l);
580 snprintf(argadd, sizeof(argadd),
585 connected = IRC_WriteStrClient(Origin,
586 ERR_CHANOPRIVSNEEDED_MSG,
588 Channel_Name(Channel));
590 Req->argv[arg_arg][0] = '\0';
593 connected = IRC_WriteStrClient(Origin,
594 ERR_NEEDMOREPARAMS_MSG,
595 Client_ID(Origin), Req->command);
599 case 'O': /* IRC operators only */
601 /* Only IRC operators are allowed to
602 * set the 'O' channel mode! */
603 if (set && !(Client_OperByMe(Client)
604 || Client_Type(Client) == CLIENT_SERVER))
605 connected = IRC_WriteStrClient(Origin,
606 ERR_NOPRIVILEGES_MSG,
611 connected = IRC_WriteStrClient(Origin,
612 ERR_CHANOPRIVSNEEDED_MSG,
614 Channel_Name(Channel));
616 case 'P': /* Persistent channel */
618 /* Only IRC operators are allowed to
619 * set the 'P' channel mode! */
620 if (set && !(Client_OperByMe(Client)
621 || Client_Type(Client) == CLIENT_SERVER))
622 connected = IRC_WriteStrClient(Origin,
623 ERR_NOPRIVILEGES_MSG,
628 connected = IRC_WriteStrClient(Origin,
629 ERR_CHANOPRIVSNEEDED_MSG,
631 Channel_Name(Channel));
633 /* --- Channel user modes --- */
637 if (Client_Type(Client) != CLIENT_SERVER) {
638 connected = IRC_WriteStrClient(Origin,
639 ERR_CHANOPRIVSNEEDED_MSG,
641 Channel_Name(Channel));
644 case 'o': /* Channel operator */
645 case 'v': /* Voice */
646 if (arg_arg > mode_arg) {
648 client = Client_Search(Req->argv[arg_arg]);
652 connected = IRC_WriteStrClient(Client,
657 connected = IRC_WriteStrClient(Origin,
658 ERR_CHANOPRIVSNEEDED_MSG,
660 Channel_Name(Channel));
662 Req->argv[arg_arg][0] = '\0';
665 connected = IRC_WriteStrClient(Origin,
666 ERR_NEEDMOREPARAMS_MSG,
667 Client_ID(Origin), Req->command);
671 /* --- Channel lists --- */
672 case 'I': /* Invite lists */
673 case 'b': /* Ban lists */
674 case 'e': /* Channel exception lists */
675 if (Mode_Limit_Reached(Client, mode_arg_count++))
677 if (arg_arg > mode_arg) {
681 ? Add_To_List(*mode_ptr, Origin,
684 : Del_From_List(*mode_ptr, Origin,
688 connected = IRC_WriteStrClient(Origin,
689 ERR_CHANOPRIVSNEEDED_MSG,
691 Channel_Name(Channel));
693 Req->argv[arg_arg][0] = '\0';
698 Channel_ShowInvites(Origin, Channel);
701 Channel_ShowBans(Origin, Channel);
704 Channel_ShowExcepts(Origin, Channel);
710 if (Client_Type(Client) != CLIENT_SERVER) {
712 "Unknown mode \"%c%c\" from \"%s\" on %s!?",
713 set ? '+' : '-', *mode_ptr,
714 Client_ID(Origin), Channel_Name(Channel));
715 connected = IRC_WriteStrClient(Origin,
717 Client_ID(Origin), *mode_ptr,
718 Channel_Name(Channel));
722 "Handling unknown mode \"%c%c\" from \"%s\" on %s ...",
723 set ? '+' : '-', *mode_ptr,
724 Client_ID(Origin), Channel_Name(Channel));
732 /* Is there a valid mode change? */
736 /* Validate target client */
737 if (client && (!Channel_IsMemberOf(Channel, client))) {
738 if (!IRC_WriteStrClient
739 (Origin, ERR_USERNOTINCHANNEL_MSG,
740 Client_ID(Origin), Client_ID(client),
741 Channel_Name(Channel)))
748 /* Channel-User-Mode */
750 ? Channel_UserModeAdd(Channel, client, x[0])
751 : Channel_UserModeDel(Channel, client, x[0]);
753 strlcat(the_args, " ", sizeof(the_args));
754 strlcat(the_args, Client_ID(client),
756 strlcat(the_modes, x, sizeof(the_modes));
758 ("User \"%s\": Mode change on %s, now \"%s\"",
759 Client_Mask(client), Channel_Name(Channel),
760 Channel_UserModes(Channel, client));
765 ? Channel_ModeAdd(Channel, x[0])
766 : Channel_ModeDel(Channel, x[0]);
768 strlcat(the_modes, x, sizeof(the_modes));
769 LogDebug("Channel %s: Mode change, now \"%s\".",
770 Channel_Name(Channel),
771 Channel_Modes(Channel));
775 /* Are there additional arguments to add? */
777 strlcat(the_args, " ", sizeof(the_args));
778 strlcat(the_args, argadd, sizeof(the_args));
783 /* Are there changed modes? */
785 /* Clean up mode string */
786 len = strlen(the_modes) - 1;
787 if ((the_modes[len] == '+') || (the_modes[len] == '-'))
788 the_modes[len] = '\0';
790 if (Client_Type(Client) == CLIENT_SERVER) {
791 /* MODE requests for local channels from other servers
792 * are definitely invalid! */
793 if (Channel_IsLocal(Channel)) {
794 Log(LOG_ALERT, "Got remote MODE command for local channel!? Ignored.");
798 /* Forward mode changes to channel users and all the
799 * other remote servers: */
800 IRC_WriteStrServersPrefix(Client, Origin,
801 "MODE %s %s%s", Channel_Name(Channel),
802 the_modes, the_args);
803 IRC_WriteStrChannelPrefix(Client, Channel, Origin,
804 false, "MODE %s %s%s", Channel_Name(Channel),
805 the_modes, the_args);
808 Origin = Client_ThisServer();
809 /* Send reply to client and inform other servers and channel users */
810 connected = IRC_WriteStrClientPrefix(Client, Origin,
811 "MODE %s %s%s", Channel_Name(Channel),
812 the_modes, the_args);
813 /* Only forward requests for non-local channels */
814 if (!Channel_IsLocal(Channel))
815 IRC_WriteStrServersPrefix(Client, Origin,
816 "MODE %s %s%s", Channel_Name(Channel),
817 the_modes, the_args);
818 IRC_WriteStrChannelPrefix(Client, Channel, Origin,
819 false, "MODE %s %s%s", Channel_Name(Channel),
820 the_modes, the_args);
824 IRC_SetPenalty(Client, 1);
830 IRC_AWAY( CLIENT *Client, REQUEST *Req )
832 assert( Client != NULL );
833 assert( Req != NULL );
835 if( Req->argc > 1 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
837 if(( Req->argc == 1 ) && (Req->argv[0][0] ))
839 Client_SetAway( Client, Req->argv[0] );
840 Client_ModeAdd( Client, 'a' );
841 IRC_WriteStrServersPrefix( Client, Client, "MODE %s :+a", Client_ID( Client ));
842 return IRC_WriteStrClient( Client, RPL_NOWAWAY_MSG, Client_ID( Client ));
846 Client_ModeDel( Client, 'a' );
847 IRC_WriteStrServersPrefix( Client, Client, "MODE %s :-a", Client_ID( Client ));
848 return IRC_WriteStrClient( Client, RPL_UNAWAY_MSG, Client_ID( Client ));
854 * Add entries to channel invite, ban and exception lists.
856 * @param what Can be 'I' for invite, 'b' for ban, and 'e' for exception list.
857 * @param Prefix The originator of the command.
858 * @param Client The sender of the command.
859 * @param Channel The channel of which the list should be modified.
860 * @param Pattern The pattern to add to the list.
861 * @return CONNECTED or DISCONNECTED.
864 Add_To_List(char what, CLIENT *Prefix, CLIENT *Client, CHANNEL *Channel,
868 struct list_head *list = NULL;
869 long int current_count;
871 assert(Client != NULL);
872 assert(Channel != NULL);
873 assert(Pattern != NULL);
874 assert(what == 'I' || what == 'b' || what == 'e');
876 mask = Lists_MakeMask(Pattern);
877 current_count = Lists_Count(Channel_GetListInvites(Channel))
878 + Lists_Count(Channel_GetListExcepts(Channel))
879 + Lists_Count(Channel_GetListBans(Channel));
883 list = Channel_GetListInvites(Channel);
886 list = Channel_GetListBans(Channel);
889 list = Channel_GetListExcepts(Channel);
893 if (Lists_CheckDupeMask(list, mask))
895 if (Client_Type(Client) == CLIENT_USER &&
896 current_count >= MAX_HNDL_CHANNEL_LISTS)
897 return IRC_WriteStrClient(Client, ERR_LISTFULL_MSG,
899 Channel_Name(Channel), mask,
900 MAX_HNDL_CHANNEL_LISTS);
904 if (!Channel_AddInvite(Channel, mask, false))
908 if (!Channel_AddBan(Channel, mask))
912 if (!Channel_AddExcept(Channel, mask))
916 return Send_ListChange(true, what, Prefix, Client, Channel, mask);
921 * Delete entries from channel invite, ban and exeption lists.
923 * @param what Can be 'I' for invite, 'b' for ban, and 'e' for exception list.
924 * @param Prefix The originator of the command.
925 * @param Client The sender of the command.
926 * @param Channel The channel of which the list should be modified.
927 * @param Pattern The pattern to add to the list.
928 * @return CONNECTED or DISCONNECTED.
931 Del_From_List(char what, CLIENT *Prefix, CLIENT *Client, CHANNEL *Channel,
935 struct list_head *list = NULL;
937 assert(Client != NULL);
938 assert(Channel != NULL);
939 assert(Pattern != NULL);
940 assert(what == 'I' || what == 'b' || what == 'e');
942 mask = Lists_MakeMask(Pattern);
946 list = Channel_GetListInvites(Channel);
949 list = Channel_GetListBans(Channel);
952 list = Channel_GetListExcepts(Channel);
956 if (!Lists_CheckDupeMask(list, mask))
958 Lists_Del(list, mask);
960 return Send_ListChange(false, what, Prefix, Client, Channel, mask);
965 * Send information about changed channel invite/ban/exception lists to clients.
967 * @param IsAdd true if the list item has been added, false otherwise.
968 * @param ModeChar The mode to use (e. g. 'b' or 'I')
969 * @param Prefix The originator of the mode list change.
970 * @param Client The sender of the command.
971 * @param Channel The channel of which the list has been modified.
972 * @param Mask The mask which has been added or removed.
973 * @return CONNECTED or DISCONNECTED.
976 Send_ListChange(const bool IsAdd, const char ModeChar, CLIENT *Prefix,
977 CLIENT *Client, CHANNEL *Channel, const char *Mask)
981 /* Send confirmation to the client */
982 if (Client_Type(Client) == CLIENT_USER)
983 ok = IRC_WriteStrClientPrefix(Client, Prefix, "MODE %s %c%c %s",
984 Channel_Name(Channel),
988 /* to other servers */
989 IRC_WriteStrServersPrefix(Client, Prefix, "MODE %s %c%c %s",
990 Channel_Name(Channel), IsAdd ? '+' : '-',
993 /* and local users in channel */
994 IRC_WriteStrChannelPrefix(Client, Channel, Prefix, false,
995 "MODE %s %c%c %s", Channel_Name(Channel),
996 IsAdd ? '+' : '-', ModeChar, Mask );
999 } /* Send_ListChange */