;Modes = +tnk mykey +l 5
;Modes = +b nick!~user@bad.host.example.com
+ # Should ngIRCd automatically join ("autojoin") all users to this
+ # channel on connect? Note: The users must have permissions to access
+ # the channel, otherwise joining them will fail!
+ ;Autojoin = yes
+
# Key file, syntax for each line: "<user>:<nick>:<key>".
# Default: none.
;KeyFile = :ETCDIR:/#chan.key
-
- # Autojoin - set to yes to force all users to join this channel on connect
- ;Autojoin = yes
[Channel]
# More [Channel] sections, if you like ...
.RE
.TP
\fBAutojoin\fR (boolean)
-Forces users to join this channel on connect. Users must have access to the channel to make it work.
+Should ngIRCd automatically join ("autojoin") all users to this channel on
+connect? Note: The users must have permissions to access the channel, otherwise
+joining them will fail!
.TP
\fBKeyFile\fR (string)
Path and file name of a "key file" containing individual channel keys for
Config_Error_TooLong(File, Line, Var);
return;
}
- if( strcasecmp( Var, "Autojoin" ) == 0 )
+ if( strcasecmp( Var, "Autojoin" ) == 0 ) {
/* Check autojoin */
chan->autojoin = Check_ArgIsTrue(Arg);
+ return;
+ }
if( strcasecmp( Var, "Key" ) == 0 ) {
/* Initial Channel Key (mode k) */
len = strlcpy(chan->key, Arg, sizeof(chan->key));
#include "log.h"
#include "messages.h"
#include "ngircd.h"
+#include "irc-channel.h"
#include "irc-info.h"
#include "irc-mode.h"
#include "irc-write.h"
} else
IRC_SetPenalty(Client, 1);
- /* Autojoin clients to the channels */
- Login_Autojoin(Client);
+ /* Autojoin clients to the channels */
+ Login_Autojoin(Client);
return CONNECTED;
}
/**
* Autojoin clients to the channels set by administrator
- * If autojoin is not set in Config or the channel is not available for search - do nothing
*
+ * Do nothing if autojoin is not set in the configuration or the channel is not
+ * available (any more).
**/
GLOBAL void
Login_Autojoin(CLIENT *Client)
{
- /** make an autojoin to each channel that is good for it **/
REQUEST Req;
const struct Conf_Channel *conf_chan;
- size_t i, n, channel_count = array_length(&Conf_Channels, sizeof(*conf_chan));
+ size_t i, channel_count = array_length(&Conf_Channels, sizeof(*conf_chan));
+
conf_chan = array_start(&Conf_Channels);
assert(channel_count == 0 || conf_chan != NULL);
Req.prefix = Client_ID(Client_ThisServer());
Req.command = "JOIN";
Req.argc = 1;
- Req.argv[0] = conf_chan->name;
+ Req.argv[0] = (char *)conf_chan->name;
IRC_JOIN(Client, &Req);
}
}