commit e9e7fc33f15d7ead5f547ebdfcc7836b75f54f83 from: Florian Westphal date: Fri Mar 06 23:13:25 2009 UTC add and use Channel_IsModeless() avoid "name[0] == '+'" where possible, having Channel_IsModeless() makes things much more obvious. commit - c09742c5189802103900fc84ded42f4f84f27ae9 commit + e9e7fc33f15d7ead5f547ebdfcc7836b75f54f83 blob - 411c345807a0d7a755c303a7c5017eadae3a05ca blob + b41cced2a26355519f0770560143bc99c31788c6 --- src/ngircd/channel.h +++ src/ngircd/channel.h @@ -132,8 +132,8 @@ GLOBAL bool Channel_CheckKey PARAMS((CHANNEL *Chan, CL const char *Key)); #define Channel_IsLocal(c) (Channel_Name(c)[0] == '&') +#define Channel_IsModeless(c) (Channel_Name(c)[0] == '+') - #endif /* -eof- */ blob - 6c478c83927646f6b92d6cf385768dc02fe6620e blob + af0f06681568289512438c91d868507fda2840d5 --- src/ngircd/irc-channel.c +++ src/ngircd/irc-channel.c @@ -303,7 +303,7 @@ IRC_JOIN( CLIENT *Client, REQUEST *Req ) if (!chan) { /* channel is new; it has been created above */ chan = Channel_Search(channame); assert(chan != NULL); - if (*channame == '+') { /* modeless channel... */ + if (Channel_IsModeless(chan)) { Channel_ModeAdd(chan, 't'); /* /TOPIC not allowed */ Channel_ModeAdd(chan, 'n'); /* no external msgs */ } blob - 9ada4f13c7f1e437733b4e2ea42bd89273bc4ba4 blob + ba28f83e8e97a634b8470e9e8c06ad1eeae2c0af --- src/ngircd/irc-mode.c +++ src/ngircd/irc-mode.c @@ -290,8 +290,7 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Ori long l; size_t len; - /* Are modes allowed on channel? */ - if (Channel_Name(Channel)[0] == '+') + if (Channel_IsModeless(Channel)) return IRC_WriteStrClient(Client, ERR_NOCHANMODES_MSG, Client_ID(Client), Channel_Name(Channel));