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,
233 if (Client_HasMode(Client, 'r'))
234 ok = IRC_WriteStrClient(Origin,
240 case 'c': /* Receive connect notices
241 * (only settable by IRC operators!) */
242 if (!set || Client_Type(Client) == CLIENT_SERVER
243 || Client_OperByMe(Origin))
246 ok = IRC_WriteStrClient(Origin,
247 ERR_NOPRIVILEGES_MSG,
250 case 'o': /* IRC operator (only unsettable!) */
251 if (!set || Client_Type(Client) == CLIENT_SERVER) {
252 Client_SetOperByMe(Target, false);
255 ok = IRC_WriteStrClient(Origin,
256 ERR_NOPRIVILEGES_MSG,
259 case 'r': /* Restricted (only settable) */
260 if (set || Client_Type(Client) == CLIENT_SERVER)
263 ok = IRC_WriteStrClient(Origin,
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': /* Moderated */
512 case 'n': /* Only members can write */
513 case 'R': /* Registered users only */
514 case 's': /* Secret channel */
515 case 't': /* Topic locked */
516 case 'z': /* Secure connections only */
520 connected = IRC_WriteStrClient(Origin,
521 ERR_CHANOPRIVSNEEDED_MSG,
522 Client_ID(Origin), Channel_Name(Channel));
524 case 'k': /* Channel key */
525 if (Mode_Limit_Reached(Client, mode_arg_count++))
531 connected = IRC_WriteStrClient(Origin,
532 ERR_CHANOPRIVSNEEDED_MSG,
534 Channel_Name(Channel));
537 if (arg_arg > mode_arg) {
539 Channel_ModeDel(Channel, 'k');
540 Channel_SetKey(Channel,
542 strlcpy(argadd, Channel_Key(Channel),
546 connected = IRC_WriteStrClient(Origin,
547 ERR_CHANOPRIVSNEEDED_MSG,
549 Channel_Name(Channel));
551 Req->argv[arg_arg][0] = '\0';
554 connected = IRC_WriteStrClient(Origin,
555 ERR_NEEDMOREPARAMS_MSG,
556 Client_ID(Origin), Req->command);
560 case 'l': /* Member limit */
561 if (Mode_Limit_Reached(Client, mode_arg_count++))
567 connected = IRC_WriteStrClient(Origin,
568 ERR_CHANOPRIVSNEEDED_MSG,
570 Channel_Name(Channel));
573 if (arg_arg > mode_arg) {
575 l = atol(Req->argv[arg_arg]);
576 if (l > 0 && l < 0xFFFF) {
577 Channel_ModeDel(Channel, 'l');
578 Channel_SetMaxUsers(Channel, l);
579 snprintf(argadd, sizeof(argadd),
584 connected = IRC_WriteStrClient(Origin,
585 ERR_CHANOPRIVSNEEDED_MSG,
587 Channel_Name(Channel));
589 Req->argv[arg_arg][0] = '\0';
592 connected = IRC_WriteStrClient(Origin,
593 ERR_NEEDMOREPARAMS_MSG,
594 Client_ID(Origin), Req->command);
598 case 'O': /* IRC operators only */
600 /* Only IRC operators are allowed to
601 * set the 'O' channel mode! */
602 if (set && !(Client_OperByMe(Client)
603 || Client_Type(Client) == CLIENT_SERVER))
604 connected = IRC_WriteStrClient(Origin,
605 ERR_NOPRIVILEGES_MSG,
610 connected = IRC_WriteStrClient(Origin,
611 ERR_CHANOPRIVSNEEDED_MSG,
613 Channel_Name(Channel));
615 case 'P': /* Persistent channel */
617 /* Only IRC operators are allowed to
618 * set the 'P' channel mode! */
619 if (set && !(Client_OperByMe(Client)
620 || Client_Type(Client) == CLIENT_SERVER))
621 connected = IRC_WriteStrClient(Origin,
622 ERR_NOPRIVILEGES_MSG,
627 connected = IRC_WriteStrClient(Origin,
628 ERR_CHANOPRIVSNEEDED_MSG,
630 Channel_Name(Channel));
632 /* --- Channel user modes --- */
636 if (Client_Type(Client) != CLIENT_SERVER) {
637 connected = IRC_WriteStrClient(Origin,
638 ERR_CHANOPRIVSNEEDED_MSG,
640 Channel_Name(Channel));
643 case 'o': /* Channel operator */
644 case 'v': /* Voice */
645 if (arg_arg > mode_arg) {
647 client = Client_Search(Req->argv[arg_arg]);
651 connected = IRC_WriteStrClient(Client,
656 connected = IRC_WriteStrClient(Origin,
657 ERR_CHANOPRIVSNEEDED_MSG,
659 Channel_Name(Channel));
661 Req->argv[arg_arg][0] = '\0';
664 connected = IRC_WriteStrClient(Origin,
665 ERR_NEEDMOREPARAMS_MSG,
666 Client_ID(Origin), Req->command);
670 /* --- Channel lists --- */
671 case 'I': /* Invite lists */
672 case 'b': /* Ban lists */
673 case 'e': /* Channel exception lists */
674 if (Mode_Limit_Reached(Client, mode_arg_count++))
676 if (arg_arg > mode_arg) {
680 ? Add_To_List(*mode_ptr, Origin,
683 : Del_From_List(*mode_ptr, Origin,
687 connected = IRC_WriteStrClient(Origin,
688 ERR_CHANOPRIVSNEEDED_MSG,
690 Channel_Name(Channel));
692 Req->argv[arg_arg][0] = '\0';
697 Channel_ShowInvites(Origin, Channel);
700 Channel_ShowBans(Origin, Channel);
703 Channel_ShowExcepts(Origin, Channel);
709 if (Client_Type(Client) != CLIENT_SERVER) {
711 "Unknown mode \"%c%c\" from \"%s\" on %s!?",
712 set ? '+' : '-', *mode_ptr,
713 Client_ID(Origin), Channel_Name(Channel));
714 connected = IRC_WriteStrClient(Origin,
716 Client_ID(Origin), *mode_ptr,
717 Channel_Name(Channel));
721 "Handling unknown mode \"%c%c\" from \"%s\" on %s ...",
722 set ? '+' : '-', *mode_ptr,
723 Client_ID(Origin), Channel_Name(Channel));
731 /* Is there a valid mode change? */
735 /* Validate target client */
736 if (client && (!Channel_IsMemberOf(Channel, client))) {
737 if (!IRC_WriteStrClient
738 (Origin, ERR_USERNOTINCHANNEL_MSG,
739 Client_ID(Origin), Client_ID(client),
740 Channel_Name(Channel)))
747 /* Channel-User-Mode */
749 ? Channel_UserModeAdd(Channel, client, x[0])
750 : Channel_UserModeDel(Channel, client, x[0]);
752 strlcat(the_args, " ", sizeof(the_args));
753 strlcat(the_args, Client_ID(client),
755 strlcat(the_modes, x, sizeof(the_modes));
757 ("User \"%s\": Mode change on %s, now \"%s\"",
758 Client_Mask(client), Channel_Name(Channel),
759 Channel_UserModes(Channel, client));
764 ? Channel_ModeAdd(Channel, x[0])
765 : Channel_ModeDel(Channel, x[0]);
767 strlcat(the_modes, x, sizeof(the_modes));
768 LogDebug("Channel %s: Mode change, now \"%s\".",
769 Channel_Name(Channel),
770 Channel_Modes(Channel));
774 /* Are there additional arguments to add? */
776 strlcat(the_args, " ", sizeof(the_args));
777 strlcat(the_args, argadd, sizeof(the_args));
782 /* Are there changed modes? */
784 /* Clean up mode string */
785 len = strlen(the_modes) - 1;
786 if ((the_modes[len] == '+') || (the_modes[len] == '-'))
787 the_modes[len] = '\0';
789 if (Client_Type(Client) == CLIENT_SERVER) {
790 /* MODE requests for local channels from other servers
791 * are definitely invalid! */
792 if (Channel_IsLocal(Channel)) {
793 Log(LOG_ALERT, "Got remote MODE command for local channel!? Ignored.");
797 /* Forward mode changes to channel users and all the
798 * other remote servers: */
799 IRC_WriteStrServersPrefix(Client, Origin,
800 "MODE %s %s%s", Channel_Name(Channel),
801 the_modes, the_args);
802 IRC_WriteStrChannelPrefix(Client, Channel, Origin,
803 false, "MODE %s %s%s", Channel_Name(Channel),
804 the_modes, the_args);
807 Origin = Client_ThisServer();
808 /* Send reply to client and inform other servers and channel users */
809 connected = IRC_WriteStrClientPrefix(Client, Origin,
810 "MODE %s %s%s", Channel_Name(Channel),
811 the_modes, the_args);
812 /* Only forward requests for non-local channels */
813 if (!Channel_IsLocal(Channel))
814 IRC_WriteStrServersPrefix(Client, Origin,
815 "MODE %s %s%s", Channel_Name(Channel),
816 the_modes, the_args);
817 IRC_WriteStrChannelPrefix(Client, Channel, Origin,
818 false, "MODE %s %s%s", Channel_Name(Channel),
819 the_modes, the_args);
823 IRC_SetPenalty(Client, 1);
829 IRC_AWAY( CLIENT *Client, REQUEST *Req )
831 assert( Client != NULL );
832 assert( Req != NULL );
834 if( Req->argc > 1 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
836 if(( Req->argc == 1 ) && (Req->argv[0][0] ))
838 Client_SetAway( Client, Req->argv[0] );
839 Client_ModeAdd( Client, 'a' );
840 IRC_WriteStrServersPrefix( Client, Client, "MODE %s :+a", Client_ID( Client ));
841 return IRC_WriteStrClient( Client, RPL_NOWAWAY_MSG, Client_ID( Client ));
845 Client_ModeDel( Client, 'a' );
846 IRC_WriteStrServersPrefix( Client, Client, "MODE %s :-a", Client_ID( Client ));
847 return IRC_WriteStrClient( Client, RPL_UNAWAY_MSG, Client_ID( Client ));
853 * Add entries to channel invite, ban and exception lists.
855 * @param what Can be 'I' for invite, 'b' for ban, and 'e' for exception list.
856 * @param Prefix The originator of the command.
857 * @param Client The sender of the command.
858 * @param Channel The channel of which the list should be modified.
859 * @param Pattern The pattern to add to the list.
860 * @return CONNECTED or DISCONNECTED.
863 Add_To_List(char what, CLIENT *Prefix, CLIENT *Client, CHANNEL *Channel,
867 struct list_head *list = NULL;
868 long int current_count;
870 assert(Client != NULL);
871 assert(Channel != NULL);
872 assert(Pattern != NULL);
873 assert(what == 'I' || what == 'b' || what == 'e');
875 mask = Lists_MakeMask(Pattern);
876 current_count = Lists_Count(Channel_GetListInvites(Channel))
877 + Lists_Count(Channel_GetListExcepts(Channel))
878 + Lists_Count(Channel_GetListBans(Channel));
882 list = Channel_GetListInvites(Channel);
885 list = Channel_GetListBans(Channel);
888 list = Channel_GetListExcepts(Channel);
892 if (Lists_CheckDupeMask(list, mask))
894 if (Client_Type(Client) == CLIENT_USER &&
895 current_count >= MAX_HNDL_CHANNEL_LISTS)
896 return IRC_WriteStrClient(Client, ERR_LISTFULL_MSG,
898 Channel_Name(Channel), mask,
899 MAX_HNDL_CHANNEL_LISTS);
903 if (!Channel_AddInvite(Channel, mask, false))
907 if (!Channel_AddBan(Channel, mask))
911 if (!Channel_AddExcept(Channel, mask))
915 return Send_ListChange(true, what, Prefix, Client, Channel, mask);
920 * Delete entries from channel invite, ban and exeption lists.
922 * @param what Can be 'I' for invite, 'b' for ban, and 'e' for exception list.
923 * @param Prefix The originator of the command.
924 * @param Client The sender of the command.
925 * @param Channel The channel of which the list should be modified.
926 * @param Pattern The pattern to add to the list.
927 * @return CONNECTED or DISCONNECTED.
930 Del_From_List(char what, CLIENT *Prefix, CLIENT *Client, CHANNEL *Channel,
934 struct list_head *list = NULL;
936 assert(Client != NULL);
937 assert(Channel != NULL);
938 assert(Pattern != NULL);
939 assert(what == 'I' || what == 'b' || what == 'e');
941 mask = Lists_MakeMask(Pattern);
945 list = Channel_GetListInvites(Channel);
948 list = Channel_GetListBans(Channel);
951 list = Channel_GetListExcepts(Channel);
955 if (!Lists_CheckDupeMask(list, mask))
957 Lists_Del(list, mask);
959 return Send_ListChange(false, what, Prefix, Client, Channel, mask);
964 * Send information about changed channel invite/ban/exception lists to clients.
966 * @param IsAdd true if the list item has been added, false otherwise.
967 * @param ModeChar The mode to use (e. g. 'b' or 'I')
968 * @param Prefix The originator of the mode list change.
969 * @param Client The sender of the command.
970 * @param Channel The channel of which the list has been modified.
971 * @param Mask The mask which has been added or removed.
972 * @return CONNECTED or DISCONNECTED.
975 Send_ListChange(const bool IsAdd, const char ModeChar, CLIENT *Prefix,
976 CLIENT *Client, CHANNEL *Channel, const char *Mask)
980 /* Send confirmation to the client */
981 if (Client_Type(Client) == CLIENT_USER)
982 ok = IRC_WriteStrClientPrefix(Client, Prefix, "MODE %s %c%c %s",
983 Channel_Name(Channel),
987 /* to other servers */
988 IRC_WriteStrServersPrefix(Client, Prefix, "MODE %s %c%c %s",
989 Channel_Name(Channel), IsAdd ? '+' : '-',
992 /* and local users in channel */
993 IRC_WriteStrChannelPrefix(Client, Channel, Prefix, false,
994 "MODE %s %c%c %s", Channel_Name(Channel),
995 IsAdd ? '+' : '-', ModeChar, Mask );
998 } /* Send_ListChange */