(thanks to the people reading git and excessively exploiting this bug... It was undet...
[NeonServV5.git] / src / bots.c
index 2c84a69f5567ee7581b14eeb778906fcb6ee69d4..7da678c97ffb3b4a185f9b0dea6b74f3c69431ae 100644 (file)
@@ -26,6 +26,8 @@
 #include "modcmd.h"
 #include "DBHelper.h"
 #include "IRCEvents.h"
+#include "tools.h"
+#include "log.h"
 
 struct cmd_bot_alias {
     int botid;
@@ -190,7 +192,7 @@ void requestOp(struct UserNode *user, struct ChanNode *chan) {
 }
 
 void requestInvite(struct UserNode *user, struct ChanNode *chan) {
-    struct ClientSocket *bot, *userbot = NULL;
+    struct ClientSocket *bot;
     struct ChanUser *chanuser = getChanUser(user, chan);
     char invited = 0;
     if(chanuser) return;
@@ -199,9 +201,6 @@ void requestInvite(struct UserNode *user, struct ChanNode *chan) {
             invited = 1;
             putsock(bot, "INVITE %s %s", user->nick, chan->name);
         }
-        if(bot->user == user) {
-            userbot = bot;
-        }
     }
 }
 
@@ -277,7 +276,7 @@ void set_bot_alias(int botid, char *alias) {
     }
     botalias = malloc(sizeof(*botalias));
     if (!botalias) {
-        perror("malloc() failed");
+        printf_log("main", LOG_ERROR, "%s:%d malloc() failed", __FILE__, __LINE__);
         return;
     }
     botalias->botid = botid;