X-Git-Url: https://jfr.im/git/irc/evilnet/x3.git/blobdiff_plain/1478fd137d16ee2612731601b78b40bd9b7534fd..acb6d53d17786553d48c54b74cf2b7df3e362227:/src/global.c diff --git a/src/global.c b/src/global.c index 6c7d693..dd275c2 100644 --- a/src/global.c +++ b/src/global.c @@ -3,7 +3,7 @@ * * 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. @@ -88,6 +88,7 @@ struct userNode *global; 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; @@ -692,6 +693,8 @@ global_db_cleanup(void) 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); @@ -712,6 +715,14 @@ init_global(const char *nick) 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);