added new multi log system
[NeonServV5.git] / src / modules / NeonServ.mod / cmd_neonserv_unvisited.c
index 62f86c0bd2cfaaf4e93f8671865658240f715db4..5f1572e17ee823fc4075f1ce1f8359d064bf9768 100644 (file)
@@ -1,4 +1,4 @@
-/* cmd_neonserv_unvisited.c - NeonServ v5.4
+/* cmd_neonserv_unvisited.c - NeonServ v5.6
  * Copyright (C) 2011-2012  Philipp Kreil (pk910)
  * 
  * This program is free software: you can redistribute it and/or modify
@@ -34,11 +34,11 @@ static TIMEQ_CALLBACK(neonserv_check_unvisited_timer);
 
 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() {
@@ -69,7 +69,7 @@ static void neonserv_check_unvisited(struct ClientSocket *client, struct ClientS
     struct ChanNode *channel;
     struct neonserv_cmd_unvisited_cache *cache = malloc(sizeof(*cache));
     if (!cache) {
-        perror("malloc() failed");
+        printf_log("neonserv", LOG_ERROR, "%s:%d malloc() failed", __FILE__, __LINE__);
         return;
     }
     cache->client = client;
@@ -195,7 +195,7 @@ static void neonserv_cmd_unvisited_unreg(struct ClientSocket *client, char *chan
             putsock(bot, "PART %s :Channel unregistered.", channel);
         }
     }
-    if(client->botid == NEONSERV_BOTID) {
+    if(botid == NEONSERV_BOTID) {
         char setting[128];
         sprintf(setting, "modules.%s.auto_backup_unregister", get_module_name(module_id));
         if(get_int_field(setting))