added recover function to NeonBackup (used to recover Bot privileges when NeonBackup...
[NeonServV5.git] / src / modules / NeonServ.mod / bot_NeonServ.c
index 83f329b3506544a7be71dfdc9525e4def2d510b2..89f298bdcf8d60fab2465236e314c4d66970e270 100644 (file)
@@ -418,6 +418,8 @@ struct ClientSocket *getBotForChannel(struct ChanNode *chan) {
 }
 
 static void neonserv_bot_ready(struct ClientSocket *client) {
+    if(client->botid != BOTID)
+        return;
     MYSQL_RES *res;
     MYSQL_ROW row;
     
@@ -471,6 +473,7 @@ static void start_bots(int type) {
             client->flags |= (strcmp(row[6], "0") ? SOCKET_FLAG_PREFERRED : 0);
             client->flags |= (strcmp(row[8], "0") ? SOCKET_FLAG_USE_QUEUE : 0);
             client->flags |= (strcmp(row[9], "0") ? SOCKET_FLAG_SSL : 0);
+            client->flags |= SOCKET_FLAG_REQUEST_INVITE | SOCKET_FLAG_REQUEST_OP;
             client->botid = BOTID;
             client->clientid = atoi(row[7]);
             connect_socket(client);