added NeonBackup bot
[NeonServV5.git] / src / IRCParser.c
index 2ff95c8ba066b3e2b440d1b6250e4242060e1042..ca42770bd8370725feacc467294230b86dd662c1 100644 (file)
@@ -27,6 +27,7 @@
 #include "BanNode.h"
 #include "ModeNode.h"
 #include "tools.h"
+#include "bots.h"
 
 struct irc_cmd *irc_commands = NULL;
 static struct UserNode *registering_users = NULL;
@@ -798,6 +799,15 @@ static IRC_CMD(raw_005) {
     return 1;
 }
 
+static IRC_CMD(raw_nojoin) {
+    if(from == NULL || argc < 3) return 0;
+    struct ChanNode *chan = getChanByName(argv[1]);
+    if(chan == NULL) return 0;
+    if(client->flags & SOCKET_FLAG_REQUEST_INVITE)
+        requestInvite(client->user, chan);
+    return 1;
+}
+
 void init_parser() {
     //all the raws we receive...
     register_irc_function("437", raw_437);
@@ -808,6 +818,10 @@ void init_parser() {
     register_irc_function("324", raw_324);
     register_irc_function("332", raw_332);
     register_irc_function("367", raw_367);
+    register_irc_function("471", raw_nojoin);
+    register_irc_function("473", raw_nojoin);
+    register_irc_function("474", raw_nojoin);
+    register_irc_function("475", raw_nojoin);
     register_irc_function("INVITE", raw_invite);
     register_irc_function("NOTICE", raw_notice);
     register_irc_function("TOPIC", raw_topic);