From b19a3af4db6fefdf3d94963163eb00e7133c8046 Mon Sep 17 00:00:00 2001 From: Adam Date: Mon, 1 Oct 2012 02:29:31 -0400 Subject: Add networkinfo:chanlen config directive --- src/config.cpp | 1 + src/protocol.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/config.cpp b/src/config.cpp index 6896be7c8..375a097ce 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -1164,6 +1164,7 @@ ConfigItems::ConfigItems(ServerConfig *conf) {"networkinfo", "nicklen", "31", new ValueContainerUInt(&conf->NickLen), DT_UINTEGER | DT_NORELOAD, ValidateNickLen}, {"networkinfo", "userlen", "10", new ValueContainerUInt(&conf->UserLen), DT_UINTEGER | DT_NORELOAD, NoValidation}, {"networkinfo", "hostlen", "64", new ValueContainerUInt(&conf->HostLen), DT_UINTEGER | DT_NORELOAD, NoValidation}, + {"networkinfo", "chanlen", "32", new ValueContainerUInt(&conf->ChanLen), DT_UINTEGER | DT_NORELOAD, NoValidation}, {"options", "casemap", "ascii", new ValueContainerString(&conf->CaseMap), DT_STRING, NoValidation}, {"options", "passlen", "32", new ValueContainerUInt(&conf->PassLen), DT_UINTEGER | DT_NORELOAD, NoValidation}, {"options", "seed", "0", new ValueContainerLUInt(&conf->Seed), DT_LUINTEGER, NoValidation}, diff --git a/src/protocol.cpp b/src/protocol.cpp index e9ab88c77..c6ace2a16 100644 --- a/src/protocol.cpp +++ b/src/protocol.cpp @@ -310,7 +310,7 @@ void IRCDProto::SendNumeric(int numeric, const Anope::string &dest, const char * bool IRCDProto::IsChannelValid(const Anope::string &chan) { - if (chan[0] != '#') + if (chan.empty() || chan[0] != '#' || chan.length() > Config->ChanLen) return false; return true; -- cgit