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 'R': /* Registered (not [un]settable by clients) */
268 if (Client_Type(Client) == CLIENT_SERVER)
271 ok = IRC_WriteStrClient(Origin,
272 ERR_NICKREGISTER_MSG,
275 case 'x': /* Cloak hostname */
276 if (Client_HasMode(Client, 'r'))
277 ok = IRC_WriteStrClient(Origin,
284 if (Client_Type(Client) != CLIENT_SERVER) {
286 "Unknown mode \"%c%c\" from \"%s\"!?",
287 set ? '+' : '-', *mode_ptr,
289 ok = IRC_WriteStrClient(Origin,
290 ERR_UMODEUNKNOWNFLAG2_MSG,
297 "Handling unknown mode \"%c%c\" from \"%s\" for \"%s\" ...",
298 set ? '+' : '-', *mode_ptr,
299 Client_ID(Origin), Client_ID(Target));
307 /* Is there a valid mode change? */
312 if (Client_ModeAdd(Target, x[0]))
313 strlcat(the_modes, x, sizeof(the_modes));
315 if (Client_ModeDel(Target, x[0]))
316 strlcat(the_modes, x, sizeof(the_modes));
320 /* Are there changed modes? */
322 /* Remove needless action modifier characters */
323 len = strlen(the_modes) - 1;
324 if (the_modes[len] == '+' || the_modes[len] == '-')
325 the_modes[len] = '\0';
327 if (Client_Type(Client) == CLIENT_SERVER) {
328 /* Forward modes to other servers */
329 if (Client_Conn(Target) != NONE) {
330 /* Remote server (service?) changed modes
331 * for one of our clients. Inform it! */
332 IRC_WriteStrClientPrefix(Target, Origin,
337 IRC_WriteStrServersPrefix(Client, Origin,
342 /* Send reply to client and inform other servers */
343 ok = IRC_WriteStrClientPrefix(Client, Origin,
347 IRC_WriteStrServersPrefix(Client, Origin,
352 LogDebug("%s \"%s\": Mode change, now \"%s\".",
353 Client_TypeText(Target), Client_Mask(Target),
354 Client_Modes(Target));
357 IRC_SetPenalty(Client, 1);
363 Channel_Mode_Answer_Request(CLIENT *Origin, CHANNEL *Channel)
365 char the_modes[COMMAND_LEN], the_args[COMMAND_LEN], argadd[CLIENT_PASS_LEN];
366 const char *mode_ptr;
368 /* Member or not? -- That's the question! */
369 if (!Channel_IsMemberOf(Channel, Origin))
370 return IRC_WriteStrClient(Origin, RPL_CHANNELMODEIS_MSG,
371 Client_ID(Origin), Channel_Name(Channel), Channel_Modes(Channel));
373 /* The sender is a member: generate extended reply */
374 strlcpy(the_modes, Channel_Modes(Channel), sizeof(the_modes));
375 mode_ptr = the_modes;
381 snprintf(argadd, sizeof(argadd), " %lu", Channel_MaxUsers(Channel));
382 strlcat(the_args, argadd, sizeof(the_args));
385 strlcat(the_args, " ", sizeof(the_args));
386 strlcat(the_args, Channel_Key(Channel), sizeof(the_args));
392 strlcat(the_modes, the_args, sizeof(the_modes));
394 if (!IRC_WriteStrClient(Origin, RPL_CHANNELMODEIS_MSG,
395 Client_ID(Origin), Channel_Name(Channel),
399 if (!IRC_WriteStrClient(Origin, RPL_CREATIONTIME_MSG,
400 Client_ID(Origin), Channel_Name(Channel),
401 Channel_CreationTime(Channel)))
409 * Handle channel mode and channel-user mode changes
412 Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel)
414 char the_modes[COMMAND_LEN], the_args[COMMAND_LEN], x[2],
415 argadd[CLIENT_PASS_LEN], *mode_ptr;
416 bool connected, set, skiponce, retval, onchannel, modeok, use_servermode;
417 int mode_arg, arg_arg, mode_arg_count = 0;
422 if (Channel_IsModeless(Channel))
423 return IRC_WriteStrClient(Client, ERR_NOCHANMODES_MSG,
424 Client_ID(Client), Channel_Name(Channel));
426 /* Mode request: let's answer it :-) */
428 return Channel_Mode_Answer_Request(Origin, Channel);
430 Channel_CheckAdminRights(Channel, Client, Origin,
431 &onchannel, &modeok, &use_servermode);
433 if (!onchannel && !modeok)
434 return IRC_WriteStrClient(Origin, ERR_NOTONCHANNEL_MSG,
436 Channel_Name(Channel));
439 mode_ptr = Req->argv[mode_arg];
440 if (Req->argc > mode_arg + 1)
441 arg_arg = mode_arg + 1;
445 /* Initial state: set or unset modes? */
459 /* Prepare reply string */
460 strcpy(the_modes, set ? "+" : "-");
464 connected = CONNECTED;
469 /* Try next argument if there's any */
472 if (arg_arg > mode_arg)
477 if (mode_arg >= Req->argc)
479 mode_ptr = Req->argv[mode_arg];
481 if (Req->argc > mode_arg + 1)
482 arg_arg = mode_arg + 1;
491 if (((*mode_ptr == '+') && !set)
492 || ((*mode_ptr == '-') && set)) {
493 /* Action modifier ("+"/"-") must be changed ... */
494 len = strlen(the_modes) - 1;
495 if (the_modes[len] == '+' || the_modes[len] == '-') {
496 /* Adjust last action modifier in result */
497 the_modes[len] = *mode_ptr;
499 /* Append modifier character to result string */
501 strlcat(the_modes, x, sizeof(the_modes));
503 set = *mode_ptr == '+';
508 /* Are there arguments left? */
509 if (arg_arg >= Req->argc)
517 /* --- Channel modes --- */
518 case 'i': /* Invite only */
519 case 'M': /* Only identified nicks can write */
520 case 'm': /* Moderated */
521 case 'n': /* Only members can write */
522 case 'R': /* Registered users only */
523 case 's': /* Secret channel */
524 case 't': /* Topic locked */
525 case 'z': /* Secure connections only */
529 connected = IRC_WriteStrClient(Origin,
530 ERR_CHANOPRIVSNEEDED_MSG,
531 Client_ID(Origin), Channel_Name(Channel));
533 case 'k': /* Channel key */
534 if (Mode_Limit_Reached(Client, mode_arg_count++))
540 connected = IRC_WriteStrClient(Origin,
541 ERR_CHANOPRIVSNEEDED_MSG,
543 Channel_Name(Channel));
546 if (arg_arg > mode_arg) {
548 Channel_ModeDel(Channel, 'k');
549 Channel_SetKey(Channel,
551 strlcpy(argadd, Channel_Key(Channel),
555 connected = IRC_WriteStrClient(Origin,
556 ERR_CHANOPRIVSNEEDED_MSG,
558 Channel_Name(Channel));
560 Req->argv[arg_arg][0] = '\0';
563 connected = IRC_WriteStrClient(Origin,
564 ERR_NEEDMOREPARAMS_MSG,
565 Client_ID(Origin), Req->command);
569 case 'l': /* Member limit */
570 if (Mode_Limit_Reached(Client, mode_arg_count++))
576 connected = IRC_WriteStrClient(Origin,
577 ERR_CHANOPRIVSNEEDED_MSG,
579 Channel_Name(Channel));
582 if (arg_arg > mode_arg) {
584 l = atol(Req->argv[arg_arg]);
585 if (l > 0 && l < 0xFFFF) {
586 Channel_ModeDel(Channel, 'l');
587 Channel_SetMaxUsers(Channel, l);
588 snprintf(argadd, sizeof(argadd),
593 connected = IRC_WriteStrClient(Origin,
594 ERR_CHANOPRIVSNEEDED_MSG,
596 Channel_Name(Channel));
598 Req->argv[arg_arg][0] = '\0';
601 connected = IRC_WriteStrClient(Origin,
602 ERR_NEEDMOREPARAMS_MSG,
603 Client_ID(Origin), Req->command);
607 case 'O': /* IRC operators only */
609 /* Only IRC operators are allowed to
610 * set the 'O' 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 case 'P': /* Persistent channel */
626 /* Only IRC operators are allowed to
627 * set the 'P' channel mode! */
628 if (set && !(Client_OperByMe(Client)
629 || Client_Type(Client) == CLIENT_SERVER))
630 connected = IRC_WriteStrClient(Origin,
631 ERR_NOPRIVILEGES_MSG,
636 connected = IRC_WriteStrClient(Origin,
637 ERR_CHANOPRIVSNEEDED_MSG,
639 Channel_Name(Channel));
641 /* --- Channel user modes --- */
645 if (Client_Type(Client) != CLIENT_SERVER) {
646 connected = IRC_WriteStrClient(Origin,
647 ERR_CHANOPRIVSNEEDED_MSG,
649 Channel_Name(Channel));
652 case 'o': /* Channel operator */
653 case 'v': /* Voice */
654 if (arg_arg > mode_arg) {
656 client = Client_Search(Req->argv[arg_arg]);
660 connected = IRC_WriteStrClient(Client,
665 connected = IRC_WriteStrClient(Origin,
666 ERR_CHANOPRIVSNEEDED_MSG,
668 Channel_Name(Channel));
670 Req->argv[arg_arg][0] = '\0';
673 connected = IRC_WriteStrClient(Origin,
674 ERR_NEEDMOREPARAMS_MSG,
675 Client_ID(Origin), Req->command);
679 /* --- Channel lists --- */
680 case 'I': /* Invite lists */
681 case 'b': /* Ban lists */
682 case 'e': /* Channel exception lists */
683 if (Mode_Limit_Reached(Client, mode_arg_count++))
685 if (arg_arg > mode_arg) {
689 ? Add_To_List(*mode_ptr, Origin,
692 : Del_From_List(*mode_ptr, Origin,
696 connected = IRC_WriteStrClient(Origin,
697 ERR_CHANOPRIVSNEEDED_MSG,
699 Channel_Name(Channel));
701 Req->argv[arg_arg][0] = '\0';
706 Channel_ShowInvites(Origin, Channel);
709 Channel_ShowBans(Origin, Channel);
712 Channel_ShowExcepts(Origin, Channel);
718 if (Client_Type(Client) != CLIENT_SERVER) {
720 "Unknown mode \"%c%c\" from \"%s\" on %s!?",
721 set ? '+' : '-', *mode_ptr,
722 Client_ID(Origin), Channel_Name(Channel));
723 connected = IRC_WriteStrClient(Origin,
725 Client_ID(Origin), *mode_ptr,
726 Channel_Name(Channel));
730 "Handling unknown mode \"%c%c\" from \"%s\" on %s ...",
731 set ? '+' : '-', *mode_ptr,
732 Client_ID(Origin), Channel_Name(Channel));
740 /* Is there a valid mode change? */
744 /* Validate target client */
745 if (client && (!Channel_IsMemberOf(Channel, client))) {
746 if (!IRC_WriteStrClient
747 (Origin, ERR_USERNOTINCHANNEL_MSG,
748 Client_ID(Origin), Client_ID(client),
749 Channel_Name(Channel)))
756 /* Channel-User-Mode */
758 ? Channel_UserModeAdd(Channel, client, x[0])
759 : Channel_UserModeDel(Channel, client, x[0]);
761 strlcat(the_args, " ", sizeof(the_args));
762 strlcat(the_args, Client_ID(client),
764 strlcat(the_modes, x, sizeof(the_modes));
766 ("User \"%s\": Mode change on %s, now \"%s\"",
767 Client_Mask(client), Channel_Name(Channel),
768 Channel_UserModes(Channel, client));
773 ? Channel_ModeAdd(Channel, x[0])
774 : Channel_ModeDel(Channel, x[0]);
776 strlcat(the_modes, x, sizeof(the_modes));
777 LogDebug("Channel %s: Mode change, now \"%s\".",
778 Channel_Name(Channel),
779 Channel_Modes(Channel));
783 /* Are there additional arguments to add? */
785 strlcat(the_args, " ", sizeof(the_args));
786 strlcat(the_args, argadd, sizeof(the_args));
791 /* Are there changed modes? */
793 /* Clean up mode string */
794 len = strlen(the_modes) - 1;
795 if ((the_modes[len] == '+') || (the_modes[len] == '-'))
796 the_modes[len] = '\0';
798 if (Client_Type(Client) == CLIENT_SERVER) {
799 /* MODE requests for local channels from other servers
800 * are definitely invalid! */
801 if (Channel_IsLocal(Channel)) {
802 Log(LOG_ALERT, "Got remote MODE command for local channel!? Ignored.");
806 /* Forward mode changes to channel users and all the
807 * other remote servers: */
808 IRC_WriteStrServersPrefix(Client, Origin,
809 "MODE %s %s%s", Channel_Name(Channel),
810 the_modes, the_args);
811 IRC_WriteStrChannelPrefix(Client, Channel, Origin,
812 false, "MODE %s %s%s", Channel_Name(Channel),
813 the_modes, the_args);
816 Origin = Client_ThisServer();
817 /* Send reply to client and inform other servers and channel users */
818 connected = IRC_WriteStrClientPrefix(Client, Origin,
819 "MODE %s %s%s", Channel_Name(Channel),
820 the_modes, the_args);
821 /* Only forward requests for non-local channels */
822 if (!Channel_IsLocal(Channel))
823 IRC_WriteStrServersPrefix(Client, Origin,
824 "MODE %s %s%s", Channel_Name(Channel),
825 the_modes, the_args);
826 IRC_WriteStrChannelPrefix(Client, Channel, Origin,
827 false, "MODE %s %s%s", Channel_Name(Channel),
828 the_modes, the_args);
832 IRC_SetPenalty(Client, 1);
838 IRC_AWAY( CLIENT *Client, REQUEST *Req )
840 assert( Client != NULL );
841 assert( Req != NULL );
843 if( Req->argc > 1 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
845 if(( Req->argc == 1 ) && (Req->argv[0][0] ))
847 Client_SetAway( Client, Req->argv[0] );
848 Client_ModeAdd( Client, 'a' );
849 IRC_WriteStrServersPrefix( Client, Client, "MODE %s :+a", Client_ID( Client ));
850 return IRC_WriteStrClient( Client, RPL_NOWAWAY_MSG, Client_ID( Client ));
854 Client_ModeDel( Client, 'a' );
855 IRC_WriteStrServersPrefix( Client, Client, "MODE %s :-a", Client_ID( Client ));
856 return IRC_WriteStrClient( Client, RPL_UNAWAY_MSG, Client_ID( Client ));
862 * Add entries to channel invite, ban and exception lists.
864 * @param what Can be 'I' for invite, 'b' for ban, and 'e' for exception list.
865 * @param Prefix The originator of the command.
866 * @param Client The sender of the command.
867 * @param Channel The channel of which the list should be modified.
868 * @param Pattern The pattern to add to the list.
869 * @return CONNECTED or DISCONNECTED.
872 Add_To_List(char what, CLIENT *Prefix, CLIENT *Client, CHANNEL *Channel,
876 struct list_head *list = NULL;
877 long int current_count;
879 assert(Client != NULL);
880 assert(Channel != NULL);
881 assert(Pattern != NULL);
882 assert(what == 'I' || what == 'b' || what == 'e');
884 mask = Lists_MakeMask(Pattern);
885 current_count = Lists_Count(Channel_GetListInvites(Channel))
886 + Lists_Count(Channel_GetListExcepts(Channel))
887 + Lists_Count(Channel_GetListBans(Channel));
891 list = Channel_GetListInvites(Channel);
894 list = Channel_GetListBans(Channel);
897 list = Channel_GetListExcepts(Channel);
901 if (Lists_CheckDupeMask(list, mask))
903 if (Client_Type(Client) == CLIENT_USER &&
904 current_count >= MAX_HNDL_CHANNEL_LISTS)
905 return IRC_WriteStrClient(Client, ERR_LISTFULL_MSG,
907 Channel_Name(Channel), mask,
908 MAX_HNDL_CHANNEL_LISTS);
912 if (!Channel_AddInvite(Channel, mask, false))
916 if (!Channel_AddBan(Channel, mask))
920 if (!Channel_AddExcept(Channel, mask))
924 return Send_ListChange(true, what, Prefix, Client, Channel, mask);
929 * Delete entries from channel invite, ban and exeption lists.
931 * @param what Can be 'I' for invite, 'b' for ban, and 'e' for exception list.
932 * @param Prefix The originator of the command.
933 * @param Client The sender of the command.
934 * @param Channel The channel of which the list should be modified.
935 * @param Pattern The pattern to add to the list.
936 * @return CONNECTED or DISCONNECTED.
939 Del_From_List(char what, CLIENT *Prefix, CLIENT *Client, CHANNEL *Channel,
943 struct list_head *list = NULL;
945 assert(Client != NULL);
946 assert(Channel != NULL);
947 assert(Pattern != NULL);
948 assert(what == 'I' || what == 'b' || what == 'e');
950 mask = Lists_MakeMask(Pattern);
954 list = Channel_GetListInvites(Channel);
957 list = Channel_GetListBans(Channel);
960 list = Channel_GetListExcepts(Channel);
964 if (!Lists_CheckDupeMask(list, mask))
966 Lists_Del(list, mask);
968 return Send_ListChange(false, what, Prefix, Client, Channel, mask);
973 * Send information about changed channel invite/ban/exception lists to clients.
975 * @param IsAdd true if the list item has been added, false otherwise.
976 * @param ModeChar The mode to use (e. g. 'b' or 'I')
977 * @param Prefix The originator of the mode list change.
978 * @param Client The sender of the command.
979 * @param Channel The channel of which the list has been modified.
980 * @param Mask The mask which has been added or removed.
981 * @return CONNECTED or DISCONNECTED.
984 Send_ListChange(const bool IsAdd, const char ModeChar, CLIENT *Prefix,
985 CLIENT *Client, CHANNEL *Channel, const char *Mask)
989 /* Send confirmation to the client */
990 if (Client_Type(Client) == CLIENT_USER)
991 ok = IRC_WriteStrClientPrefix(Client, Prefix, "MODE %s %c%c %s",
992 Channel_Name(Channel),
996 /* to other servers */
997 IRC_WriteStrServersPrefix(Client, Prefix, "MODE %s %c%c %s",
998 Channel_Name(Channel), IsAdd ? '+' : '-',
1001 /* and local users in channel */
1002 IRC_WriteStrChannelPrefix(Client, Channel, Prefix, false,
1003 "MODE %s %c%c %s", Channel_Name(Channel),
1004 IsAdd ? '+' : '-', ModeChar, Mask );
1007 } /* Send_ListChange */