added new multi log system
[NeonServV5.git] / src / modules / NeonServ.mod / cmd_neonserv_ban.c
index 84a497a3ef165c8418841f6f3c46ac3c2cc9e167..2a419eb6c94860305df271f62cbf1436393042cb 100644 (file)
@@ -1,4 +1,4 @@
-/* cmd_neonserv_ban.c - NeonServ v5.3
+/* cmd_neonserv_ban.c - NeonServ v5.6
  * Copyright (C) 2011-2012  Philipp Kreil (pk910)
  * 
  * This program is free software: you can redistribute it and/or modify
@@ -33,15 +33,15 @@ struct neonserv_cmd_ban_cache {
 CMD_BIND(neonserv_cmd_ban) {
     struct neonserv_cmd_ban_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;
-    cache->textclient = getTextBot();
+    cache->textclient = textclient;
     cache->user = user;
     cache->event = event;
     cache->masks = strdup(merge_argv_char(argv, 0, argc, ','));
-    get_userlist_with_invisible(chan, neonserv_cmd_ban_userlist_lookup, cache);
+    get_userlist_with_invisible(chan, module_id, neonserv_cmd_ban_userlist_lookup, cache);
 }
 
 static USERLIST_CALLBACK(neonserv_cmd_ban_userlist_lookup) {
@@ -114,9 +114,9 @@ static void neonserv_cmd_ban_async1(struct ClientSocket *client, struct ClientSo
     }
     freeModeBuffer(modeBuf);
     if(done_masks == provided_masks)
-        reply(getTextBot(), user, "NS_BAN_DONE", done_masks, chan->name, total_match);
+        reply(textclient, user, "NS_BAN_DONE", done_masks, chan->name, total_match);
     else
-        reply(getTextBot(), user, "NS_BAN_FAIL", client->user->nick);
+        reply(textclient, user, "NS_BAN_FAIL", client->user->nick);
     if(done_masks)
         logEvent(event);
 }