Module: ngircd.git
Branch: master
Commit: 989c9fa531d83c9b1a302b222a4bcfeef767c2b6
URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=989c9fa5…
Author: Alexander Barton <alex(a)barton.de>
Date: Mon Aug 1 23:30:55 2011 +0200
Handle channel user modes 'a', 'h', and 'q' from remote servers
These channel user modes aren't used for anything at the moment, but
ngIRCd knows that these three modes are "channel user modes" and not
"channel modes", that is that these modes take an "nick name" argument.
Like unknown user and channel modes, these modes are saved and forwarded,
but ignored otherwise.
---
src/ngircd/irc-mode.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/src/ngircd/irc-mode.c b/src/ngircd/irc-mode.c
index 326c104..3cceaeb 100644
--- a/src/ngircd/irc-mode.c
+++ b/src/ngircd/irc-mode.c
@@ -594,6 +594,16 @@ Channel_Mode(CLIENT *Client, REQUEST *Req, CLIENT *Origin, CHANNEL *Channel)
Channel_Name(Channel));
break;
/* --- Channel user modes --- */
+ case 'a':
+ case 'h':
+ case 'q':
+ if (Client_Type(Client) != CLIENT_SERVER) {
+ connected = IRC_WriteStrClient(Origin,
+ ERR_CHANOPRIVSNEEDED_MSG,
+ Client_ID(Origin),
+ Channel_Name(Channel));
+ goto chan_exit;
+ }
case 'o': /* Channel operator */
case 'v': /* Voice */
if (arg_arg > mode_arg) {
Module: ngircd.git
Branch: master
Commit: ea725b99b7cc308de6a035e016e4d89e268cbf1f
URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=ea725b99…
Author: Alexander Barton <alex(a)barton.de>
Date: Mon Aug 1 21:21:01 2011 +0200
Enlarge client user mode buffer, reduce client flags buffer
We have to enlage our user mode buffer, so we can handle even unknown
user modes in the future; and reduce the client flags buffer, because
I can't imagine why we ever would need ~100 flags!?
Now we support up to 15 user modes (was: 8) and up to 15 flags (was: 99).
So in the end, we even save 99-15+8-15=77 bytes for each client structure!
---
src/ngircd/defines.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/ngircd/defines.h b/src/ngircd/defines.h
index 688f2d3..8f62279 100644
--- a/src/ngircd/defines.h
+++ b/src/ngircd/defines.h
@@ -44,10 +44,10 @@
see RFC 2812, section 1.2.1 */
#define CLIENT_NAME_LEN 32 /* Max. length of "real names" */
#define CLIENT_HOST_LEN 64 /* Max. host name length */
-#define CLIENT_MODE_LEN 9 /* Max. lenth of all client modes */
+#define CLIENT_MODE_LEN 16 /* Max. lenth of all client modes */
#define CLIENT_INFO_LEN 64 /* Max. length of server info texts */
#define CLIENT_AWAY_LEN 128 /* Max. length of away messages */
-#define CLIENT_FLAGS_LEN 100 /* Max. length of client flags */
+#define CLIENT_FLAGS_LEN 16 /* Max. length of client flags */
#define CHANNEL_NAME_LEN 51 /* Max. length of a channel name, see
RFC 2812 section 1.3 */