added rename (debug) message (alertchan)
authorpk910 <philipp@zoelle1.de>
Tue, 24 Jul 2012 09:03:07 +0000 (11:03 +0200)
committerpk910 <philipp@zoelle1.de>
Tue, 24 Jul 2012 09:06:38 +0000 (11:06 +0200)
src/DBHelper.c

index cfcdd20eab128d79fde135e7f3ec133e1ba182cf..787b336845451821833f9303eba792ae1b87ac18 100644 (file)
@@ -25,6 +25,8 @@
 #include "IRCEvents.h"
 #include "HandleInfoHandler.h"
 #include "ClientSocket.h"
+#include "bots.h"
+#include "ConfigParser.h"
 
 void _loadUserSettings(struct UserNode *user) {
     SYNCHRONIZE(cache_sync);
@@ -244,6 +246,14 @@ int renameAccount(char *oldauth, char *newauth) {
             //simply rename the account
             printf_mysql_query("UPDATE `users` SET `user_user` = '%s' WHERE `user_id` = '%d'", escape_string(newauth), userid);
         }
+        char *alertchan = get_string_field("General.CheckAuths.alertchan");
+        if(alertchan) {
+            struct ChanNode *alertchan_chan = getChanByName(alertchan);
+            struct ClientSocket *alertclient;
+            if(alertchan_chan && (alertclient = getChannelBot(alertchan_chan, 0)) != NULL) {
+                putsock(alertclient, "PRIVMSG %s :Renamed User %s to %s", alertchan_chan->name, oldauth, newauth);
+            }
+        }
         return 1;
     }
     return 0;