fixed #989cb8324ec8fe9caba511d89051552638dbc776
[NeonServV5.git] / src / bot_NeonHelp.c
index 1ff01ccf2a30b7f267a1cba58e839d134747c06b..506a797446c49ac18244a0ea4cc9fd30316c867c 100644 (file)
@@ -18,6 +18,7 @@
 #include "bot_NeonHelp.h"
 #include "modcmd.h"
 #include "cmd_neonhelp.h"
+#include "lang.h"
 #include "mysqlConn.h"
 #include "ClientSocket.h"
 #include "UserNode.h"
@@ -27,6 +28,7 @@
 #include "IRCParser.h"
 #include "bots.h"
 #include "DBHelper.h"
+#include "WHOHandler.h"
 
 #define BOTID 4
 #define BOTALIAS "NeonHelp"
@@ -38,8 +40,8 @@ static const struct default_language_entry msgtab[] = {
     {"NH_REQUEST_OTHERS_0", "There are no other unhandled requests."},
     {"NH_REQUEST_OTHERS_1", "There is 1 other unhandled request."},
     {"NH_REQUEST_OTHERS_2", "There are %d other unhandled requests."}, /* {ARGS: 1337} */
-    {"NH_REQUEST_FOOTER_1", "Everything you tell me until you are helped (or you leave %s) will be recorded. If you part %s, your request will be lost."}, /* {ARGS: "#test"} */
-    {"NH_REQUEST_FOOTER_2", "Everything you tell me until you are helped (or you leave %s or %s) will be recorded. If you part %s or %s, your request will be lost."}, /* {ARGS: "#test", "#test-support"} */
+    {"NH_REQUEST_FOOTER_1", "Everything you tell me until you are helped (or you leave %1$s) will be recorded. If you part %1$s, your request will be lost."}, /* {ARGS: "#test"} */
+    {"NH_REQUEST_FOOTER_2", "Everything you tell me until you are helped (or you leave %1$s or %2$s) will be recorded. If you part %1$s or %2$s, your request will be lost."}, /* {ARGS: "#test", "#test-support"} */
     {"NH_NEW_REQUEST", "New request #%d by %s: %s"}, /* {ARGS: 5, "pk910", "Help, I've fallen and I can't get up!"} */
     {"NH_NEXT_NONE", "No more requests."},
     {"NH_NEXT_NOT_FOUND", "No request found."},
@@ -267,9 +269,9 @@ static void neonhelp_event_privmsg_async(struct ClientSocket *client, struct Use
     }
 }
 
-static void destroy_support_request(struct ClientSocket *client, struct NeonHelpNode *helpnode, int reply) {
+static void destroy_support_request(struct ClientSocket *client, struct NeonHelpNode *helpnode, int do_reply) {
     printf_mysql_query("UPDATE `helpserv_requests` SET `status` = '2' WHERE `id` = %d", helpnode->suppid);
-    if(reply) {
+    if(do_reply) {
         reply(client, helpnode->user, "NH_DELETED", helpnode->suppid);
     }
     free(helpnode);
@@ -351,9 +353,6 @@ static void neonhelp_event_part(struct ChanUser *target, char *reason) {
 
 static void neonhelp_event_quit(struct UserNode *target, char *reason) {
     struct ClientSocket *client;
-    MYSQL_RES *res;
-    MYSQL_ROW row;
-    struct ChanNode *support, *public;
     int userHasRequest;
     for(client = getBots(SOCKET_FLAG_READY, NULL); client; client = getBots(SOCKET_FLAG_READY, client)) {
         if(client->botid == BOTID) {