repo: ngircd
action: commit
revision: 
path_from: 
revision_from: 20ddffca0d5ae5393adc57b67ba90e15d33e2ee3:
path_to: 
revision_to: 
git.thebackupbox.net
ngircd
git clone git://git.thebackupbox.net/ngircd
commit 20ddffca0d5ae5393adc57b67ba90e15d33e2ee3
Author: Alexander Barton 
Date:   Mon Dec 31 18:13:18 2012 +0100

    Mode setting: only check channel user modes when on channel

    Only check the channel user modes of the initiator if he is joined to
    this channel and not an IRC operator enforcing modes (which requires
    the configuration option "OperCanUseMode" to be enabled), because trying
    to check channel user modes of a non-member results in this assertion:

     Assertion failed: (cl2chan != NULL), function Channel_UserModes,
      file channel.c, line 742.

    This closes bug #147, thanks to James Kirwill 
    for tracking this down!

diff --git a/src/ngircd/irc-mode.c b/src/ngircd/irc-mode.c
index 32219975f5ea23a389fcc368551104e331226155..
index ..a63a0f411bc95a4320fa2bc9a47ff84d176bcc49 100644
--- a/src/ngircd/irc-mode.c
+++ b/src/ngircd/irc-mode.c
@@ -550,7 +550,7 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel)
 		if (arg_arg >= Req->argc)
 			arg_arg = -1;

-		if(!is_machine) {
+		if(!is_machine && !is_oper) {
 			o_mode_ptr = Channel_UserModes(Channel, Client);
 			while( *o_mode_ptr ) {
 				if ( *o_mode_ptr == 'q')

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