fixed bot user handling (bot should only have a user when connected)
[NeonServV5.git] / src / bot_NeonSpam.c
index 050bc107799b35b42bc795bb411ae15b3e1c0b07..33e9cbf1ecb9d3bd7a5f6e4feec4b40f3306c3b1 100644 (file)
@@ -118,7 +118,6 @@ static void neonspam_trigger_callback(struct ChanNode *chan, char *trigger) {
 }
 
 static void start_bots() {
-    struct UserNode *user;
     struct ClientSocket *client;
     MYSQL_RES *res, *res2;
     MYSQL_ROW row;
@@ -127,11 +126,7 @@ static void start_bots() {
     res = mysql_use();
     
     while ((row = mysql_fetch_row(res)) != NULL) {
-        user = addUser(row[0]);
-        strcpy(user->ident, row[1]);
-        strcpy(user->realname, row[2]);
-        user->flags |= USERFLAG_ISBOT;
-        client = create_socket(row[3], atoi(row[4]), row[5], user);
+        client = create_socket(row[3], atoi(row[4]), row[5], row[0], row[1], row[2]);
         client->flags |= (strcmp(row[6], "0") ? SOCKET_FLAG_PREFERRED : 0);
         client->flags |= (strcmp(row[8], "0") ? SOCKET_FLAG_USE_QUEUE : 0);
         client->botid = BOTID;