about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAlexander Barton <alex@barton.de>2008-04-24 23:52:54 +0200
committerAlexander Barton <alex@barton.de>2008-04-24 23:52:54 +0200
commit523a6fad097cedd31a6931a29d91bab0d391df63 (patch)
tree8015fe95c8c0bbe5f6955beaeeee1d96b7e2577e
parent54b17fc20162941d03a17ddf78706c5fdc5cfff4 (diff)
downloadngircd-523a6fad097cedd31a6931a29d91bab0d391df63.tar.gz
ngircd-523a6fad097cedd31a6931a29d91bab0d391df63.zip
Report ERR_NOTONCHANNEL when trying to part a channel one is not member of.
When trying to part a channel ("PART #channel") the client is not member of
the daemon now correctly reports the numeric ERR_NOTONCHANNEL (442) insted
of ERR_NOSUCHCHANNEL (403).
-rw-r--r--src/ngircd/channel.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/ngircd/channel.c b/src/ngircd/channel.c
index a4eca1f1..32f911a2 100644
--- a/src/ngircd/channel.c
+++ b/src/ngircd/channel.c
@@ -218,11 +218,16 @@ Channel_Part(CLIENT * Client, CLIENT * Origin, const char *Name, const char *Rea
 	assert(Reason != NULL);
 
 	chan = Channel_Search(Name);
-	if ((!chan) || (!Get_Cl2Chan(chan, Client))) {
+	if (!chan) {
 		IRC_WriteStrClient(Client, ERR_NOSUCHCHANNEL_MSG,
 				   Client_ID(Client), Name);
 		return false;
 	}
+	if (!Get_Cl2Chan(chan, Client)) {
+		IRC_WriteStrClient(Client, ERR_NOTONCHANNEL_MSG,
+				   Client_ID(Client), Name);
+		return false;
+	}
 
 	if (!Remove_Client(REMOVE_PART, chan, Client, Origin, Reason, true))
 		return false;