-/* cmd_neonserv_unvisited.c - NeonServ v5.4
+/* cmd_neonserv_unvisited.c - NeonServ v5.5
* Copyright (C) 2011-2012 Philipp Kreil (pk910)
*
* This program is free software: you can redistribute it and/or modify
CMD_BIND(neonserv_cmd_unvisited) {
int duration = (argc ? strToTime(user, argv[0]) : 60*60*24*7*3);
- reply(getTextBot(), user, "NS_SEARCH_HEADER");
+ reply(textclient, user, "NS_SEARCH_HEADER");
int unreg = 0;
if(argc > 1 && !stricmp(argv[1], "unregister"))
unreg = 1;
- neonserv_check_unvisited(client, getTextBot(), user, duration, unreg);
+ neonserv_check_unvisited(client, textclient, user, duration, unreg);
}
void neonserv_cmd_unvisited_init() {
static TIMEQ_CALLBACK(neonserv_check_unvisited_timer) {
char tmp[200];
char *modname = get_module_name(module_id);
- sprintf(tmp, "modules/%s/chan_expire_freq", modname);
+ sprintf(tmp, "modules.%s.chan_expire_freq", modname);
char *check_freq_str = get_string_field(tmp);
int check_freq;
if(!check_freq_str || (check_freq = strToTime(NULL, check_freq_str)) < (60*60)) {
timeq_add_name("neonserv_unvisited", 1800, module_id, neonserv_check_unvisited_timer, NULL);
return;
}
- sprintf(tmp, "modules/%s/chan_expire_delay", modname);
+ sprintf(tmp, "modules.%s.chan_expire_delay", modname);
char *check_expire_str = get_string_field(tmp);
int duration;
if(!check_expire_str || (duration = strToTime(NULL, check_expire_str)) < 60*60*24*7) return;
static void neonserv_cmd_unvisited_unreg(struct ClientSocket *client, char *channel) {
MYSQL_RES *res;
MYSQL_ROW row;
- int sync_neonspam_unreg = get_int_field("General/sync_neonspam_unreg");
+ int sync_neonspam_unreg = get_int_field("General.sync_neonspam_unreg");
int botid;
if(client)
botid = client->botid;
putsock(bot, "PART %s :Channel unregistered.", channel);
}
}
+ if(client->botid == NEONSERV_BOTID) {
+ char setting[128];
+ sprintf(setting, "modules.%s.auto_backup_unregister", get_module_name(module_id));
+ if(get_int_field(setting))
+ module_global_cmd_unregister_neonbackup(channel);
+ }
char *alertchan = get_string_field("General.alertchan");
if(alertchan) {
struct ChanNode *alertchan_chan = getChanByName(alertchan);