repo: ngircd
action: commit
revision: 
path_from: 
revision_from: fee591b7597dfd9b438b6902d7971787dfd69d60:
path_to: 
revision_to: 
git.thebackupbox.net
ngircd
git clone git://git.thebackupbox.net/ngircd
commit fee591b7597dfd9b438b6902d7971787dfd69d60
Author: Alexander Barton 
Date:   Sun Aug 26 16:51:34 2012 +0200

    Remove Can_Send_To_Channel_Identified()

    Move the functionality directly into Can_Send_To_Channel() function.
    There should be no functional change ...

diff --git a/src/ngircd/channel.c b/src/ngircd/channel.c
index 1d1645f2e342e4ee9f01de8ea478ab2fc5eaea93..
index ..0f21a459c3a6644c0f14b2c581f8a45aca154bdc 100644
--- a/src/ngircd/channel.c
+++ b/src/ngircd/channel.c
@@ -832,26 +832,14 @@ 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 *Client, const char *Command,
 					  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));

-----END OF PAGE-----