- /* Is the client banned? */
- if( Lists_Check(&Chan->list_bans, From))
- {
- /* Client is banned, but is he channel operator or has voice? */
- if(( ! has_voice ) && ( ! is_op )) ok = false;
+ if (strchr(Channel_Modes(Chan), 'm'))
+ return false;
+
+ return !Lists_Check(&Chan->list_bans, From);
+}
+
+
+GLOBAL bool
+Channel_Write(CHANNEL *Chan, CLIENT *From, CLIENT *Client, const char *Command,
+ bool SendErrors, const char *Text)
+{
+ if (!Can_Send_To_Channel(Chan, From)) {
+ if (! SendErrors)
+ return CONNECTED; /* no error, see RFC 2812 */
+ return IRC_WriteStrClient(From, ERR_CANNOTSENDTOCHAN_MSG,
+ Client_ID(From), Channel_Name(Chan));