summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorAlexander Barton <alex@barton.de>2012-08-26 16:51:34 +0200
committerAlexander Barton <alex@barton.de>2012-08-27 21:15:12 +0200
commitfee591b7597dfd9b438b6902d7971787dfd69d60 (patch)
treec7c39e1f44e535d94bf74c99830b6a92a8818cbe /src
parent1aaf54ac24e8e24d5a3ce5b7b00a775f5237d7a9 (diff)
downloadngircd-fee591b7597dfd9b438b6902d7971787dfd69d60.tar.gz
ngircd-fee591b7597dfd9b438b6902d7971787dfd69d60.zip
Remove Can_Send_To_Channel_Identified()
Move the functionality directly into Can_Send_To_Channel() function.
There should be no functional change ...
Diffstat (limited to 'src')
-rw-r--r--src/ngircd/channel.c27
1 files changed, 4 insertions, 23 deletions
diff --git a/src/ngircd/channel.c b/src/ngircd/channel.c
index 1d1645f2..0f21a459 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));