removed getTextBot() function and added textbot parameter to the CMD_BIND header...
[NeonServV5.git] / src / modules / NeonServ.mod / cmd_neonserv_trim.c
index 1e382d67c8f5ee4cac2c7cdb4d87c260154271c5..fea0c0afdb0e9e6ffe5dc90a7a7af11a7e99024d 100644 (file)
@@ -38,14 +38,14 @@ CMD_BIND(neonserv_cmd_trim) {
         if(isGodMode(user)) {
             event->flags |= CMDFLAG_OPLOG;
         } else {
-            reply(getTextBot(), user, "NS_ACCESS_DENIED");
+            reply(textclient, user, "NS_ACCESS_DENIED");
             return;
         }
     }
     int min_access, max_access;
     int duration = strToTime(user, argv[1]);
     if(duration < 30) {
-        reply(getTextBot(), user, "NS_TRIM_DURATION_TOO_SHORT", 30);
+        reply(textclient, user, "NS_TRIM_DURATION_TOO_SHORT", 30);
         return;
     }
     if(!stricmp(argv[0], "users")) {
@@ -56,7 +56,7 @@ CMD_BIND(neonserv_cmd_trim) {
             if(isGodMode(user)) {
                 event->flags |= CMDFLAG_OPLOG;
             } else {
-                reply(getTextBot(), user, "NS_ACCESS_DENIED");
+                reply(textclient, user, "NS_ACCESS_DENIED");
                 return;
             }
         }
@@ -77,7 +77,7 @@ CMD_BIND(neonserv_cmd_trim) {
         }
         freeModeBuffer(modenode);
         char timeBuf[MAXLEN];
-        reply(getTextBot(), user, "NS_TRIM_BAN_DONE", bancount, chan->name, timeToStr(user, duration, 3, timeBuf));
+        reply(textclient, user, "NS_TRIM_BAN_DONE", bancount, chan->name, timeToStr(user, duration, 3, timeBuf));
         if(bancount)
             logEvent(event);
         return;
@@ -89,7 +89,7 @@ CMD_BIND(neonserv_cmd_trim) {
             min_access = atoi(argv[0]);
             max_access = atoi(seperator);
             if(max_access < min_access) {
-                reply(getTextBot(), user, "NS_INVALID_ACCESS_RANGE", min_access, max_access);
+                reply(textclient, user, "NS_INVALID_ACCESS_RANGE", min_access, max_access);
                 return;
             }
         } else {
@@ -100,7 +100,7 @@ CMD_BIND(neonserv_cmd_trim) {
             if(isGodMode(user)) {
                 event->flags |= CMDFLAG_OPLOG;
             } else {
-                reply(getTextBot(), user, "NS_NO_ACCESS");
+                reply(textclient, user, "NS_NO_ACCESS");
                 return;
             }
         }
@@ -111,7 +111,7 @@ CMD_BIND(neonserv_cmd_trim) {
         return;
     }
     cache->client = client;
-    cache->textclient = getTextBot();
+    cache->textclient = textclient;
     cache->user = user;
     cache->event = event;
     cache->min_access = min_access;
@@ -152,7 +152,7 @@ static void neonserv_cmd_trim_async1(struct ClientSocket *client, struct ClientS
         }
     }
     char timeBuf[MAXLEN];
-    reply(getTextBot(), user, "NS_TRIM_DONE", trim_count, min_access, max_access, chan->name, timeToStr(user, duration, 3, timeBuf));
+    reply(textclient, user, "NS_TRIM_DONE", trim_count, min_access, max_access, chan->name, timeToStr(user, duration, 3, timeBuf));
     if(trim_count)
         logEvent(event);
 }