*
* This file is part of x3.
*
- * srvx is free software; you can redistribute it and/or modify
+ * x3 is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
static struct module *global_module;
static struct service *global_service;
static struct globalMessage *messageList;
+extern struct string_list *autojoin_channels;
static long messageCount;
static time_t last_max_alert;
static struct log_type *G_LOG;
void
init_global(const char *nick)
{
+ struct chanNode *chan;
+ unsigned int i;
G_LOG = log_register_type("Global", "file:global.log");
reg_new_user_func(global_process_user);
reg_auth_func(global_process_auth);
global = AddService(nick, modes ? modes : NULL, "Global Services", NULL);
global_service = service_register(global);
}
+
+ if(autojoin_channels && global) {
+ for (i = 0; i < autojoin_channels->used; i++) {
+ chan = AddChannel(autojoin_channels->list[i], now, "+nt", NULL, NULL);
+ AddChannelUser(global, chan)->modes |= MODE_CHANOP;
+ }
+ }
+
saxdb_register("Global", global_saxdb_read, global_saxdb_write);
reg_exit_func(global_db_cleanup);
message_register_table(msgtab);