added NeonBackup bot
[NeonServV5.git] / src / modules / NeonServ.mod / cmd_neonserv_csuspend.c
index 9ff2fea6367441e3ed88bf58246c8bd8c5838735..1dad37dd21fc5424399f238ea3a1260a11a90a66 100644 (file)
@@ -1,4 +1,4 @@
-/* cmd_neonserv_csuspend.c - NeonServ v5.3
+/* cmd_neonserv_csuspend.c - NeonServ v5.4
  * Copyright (C) 2011-2012  Philipp Kreil (pk910)
  * 
  * This program is free software: you can redistribute it and/or modify
@@ -56,6 +56,12 @@ CMD_BIND(neonserv_cmd_csuspend) {
     if(bot) {
         putsock(bot, "PART %s :Channel suspended.", channel);
     }
+    if(client->botid == NEONSERV_BOTID) {
+        char setting[128];
+        sprintf(setting, "modules.%s.auto_backup_unregister", get_module_name(module_id));
+        if(get_int_field(setting))
+            module_global_cmd_unregister_neonbackup(channel);
+    }
     printf_mysql_query("UPDATE `bot_channels` SET `suspended` = '1' WHERE `id` = '%s'", row[1]);
     reply(getTextBot(), user, "NS_CSUSPEND_DONE", channel);
     logEvent(event);