#include "ngircd.h"
#include "conn.h"
#include "client.h"
+#include "channel.h"
#include "defines.h"
#include "log.h"
#include "match.h"
printf(" Modes = %s\n", predef_chan->modes);
printf(" Key = %s\n", predef_chan->key);
printf(" MaxUsers = %lu\n", predef_chan->maxusers);
- printf(" Topic = %s\n\n", predef_chan->topic);
+ printf(" Topic = %s\n", predef_chan->topic);
+ printf(" KeyFile = %s\n\n", predef_chan->keyfile);
}
return (config_valid ? 0 : 1);
GLOBAL bool
-Conf_EnableServer( char *Name, UINT16 Port )
+Conf_EnableServer( const char *Name, UINT16 Port )
{
/* Enable specified server and adjust port */
GLOBAL bool
-Conf_DisableServer( char *Name )
+Conf_DisableServer( const char *Name )
{
/* Enable specified server and adjust port */
GLOBAL bool
-Conf_AddServer( char *Name, UINT16 Port, char *Host, char *MyPwd, char *PeerPwd )
+Conf_AddServer( const char *Name, UINT16 Port, const char *Host, const char *MyPwd, const char *PeerPwd )
{
/* Add new server to configuration */
* Check if the given nick name is an service
*/
GLOBAL bool
-Conf_IsService(int ConfServer, char *Nick)
+Conf_IsService(int ConfServer, const char *Nick)
{
return MatchCaseInsensitive(Conf_Server[ConfServer].svs_mask, Nick);
} /* Conf_IsService */
size_t size = sizeof(new_chan->name);
char *dest = new_chan->name;
- /* Channels names must begin with "&" or "#", if it is
- * missing, add a '#'. This is only here for user convenience.
- */
- if (*name && *name != '#' && *name != '&') {
+ if (!Channel_IsValidName(name)) {
+ /*
+ * maybe user forgot to add a '#'.
+ * This is only here for user convenience.
+ */
*dest = '#';
--size;
++dest;
Config_Error_NaN(Line, Var);
return;
}
+ if (strcasecmp(Var, "KeyFile") == 0) {
+ /* channel keys */
+ len = strlcpy(chan->keyfile, Arg, sizeof(chan->keyfile));
+ if (len >= sizeof(chan->keyfile))
+ Config_Error_TooLong(Line, Var);
+ return;
+ }
Config_Error( LOG_ERR, "%s, line %d (section \"Channel\"): Unknown variable \"%s\"!",
NGIRCd_ConfFile, Line, Var );