Commit Diff


commit - 1aaf54ac24e8e24d5a3ce5b7b00a775f5237d7a9
commit + fee591b7597dfd9b438b6902d7971787dfd69d60
blob - 1d1645f2e342e4ee9f01de8ea478ab2fc5eaea93
blob + 0f21a459c3a6644c0f14b2c581f8a45aca154bdc
--- src/ngircd/channel.c
+++ src/ngircd/channel.c
@@ -831,27 +831,15 @@ Can_Send_To_Channel(CHANNEL *Chan, CLIENT *From)
 	 */
 	if (strchr(Channel_Modes(Chan), 'n') && !is_member)
 		return false;
-
-	if (is_op || has_voice)
-		return true;
 
-	if (strchr(Channel_Modes(Chan), 'm'))
+	if (strchr(Channel_Modes(Chan), 'M') && !Client_HasMode(From, 'R')
+	    && !Client_HasMode(From, 'o'))
 		return false;
 
-	if (Lists_Check(&Chan->list_excepts, From))
-		return true;
-
-	return !Lists_Check(&Chan->list_bans, From);
-}
-
-
-static bool
-Can_Send_To_Channel_Identified(CHANNEL *Chan, CLIENT *From)
-{
-	if ((Client_ThisServer() == From) || Client_HasMode(From, 'o'))
+	if (is_op || has_voice)
 		return true;
 
-	if (strchr(Channel_Modes(Chan), 'M') && !Client_HasMode(From, 'R'))
+	if (strchr(Channel_Modes(Chan), 'm'))
 		return false;
 
 	if (Lists_Check(&Chan->list_excepts, From))
@@ -872,13 +860,6 @@ Channel_Write(CHANNEL *Chan, CLIENT *From, CLIENT *Cli
 					  Client_ID(From), Channel_Name(Chan));
 	}
 
-	if (!Can_Send_To_Channel_Identified(Chan, From)) {
-		if (! SendErrors)
-			return CONNECTED;
-		return IRC_WriteStrClient(From, ERR_CANNOTSENDTOCHAN_MSG,
-					  Client_ID(From), Channel_Name(Chan));
-	}
-
 	if (Client_Conn(From) > NONE)
 		Conn_UpdateIdle(Client_Conn(From));