added user registered event, tidied up helper functions and added automatic auth...
[NeonServV5.git] / src / event_neonserv_mode.c
index c6ec06abdea381ae08a32191f3cbef1b5395840e..5ef806024b9477f3076adca751aed240e562a096 100644 (file)
@@ -1,4 +1,4 @@
-/* event_neonserv_mode.c - NeonServ v5.0
+/* event_neonserv_mode.c - NeonServ v5.2
  * Copyright (C) 2011  Philipp Kreil (pk910)
  * 
  * This program is free software: you can redistribute it and/or modify
@@ -84,7 +84,7 @@ static void neonserv_event_mode_async1(struct ClientSocket *client, struct UserN
     modeBuf = initModeBuffer(client, chan);
     printf_mysql_query("SELECT `channel_canop`, `channel_canvoice`, `channel_canban`, `channel_enfmodes`, `channel_modes` FROM `channels` WHERE `channel_id` = '%d'", chan->channel_id);
     row = mysql_fetch_row(mysql_use());
-    if(row[0] == NULL || row[1] == NULL || row[2] == NULL || row[3] == NULL) {
+    if(row[0] == NULL || row[1] == NULL || row[2] == NULL || row[3] == NULL || row[4] == NULL) {
         printf_mysql_query("SELECT `channel_canop`, `channel_canvoice`, `channel_canban`, `channel_enfmodes`, `channel_modes` FROM `channels` WHERE `channel_name` = 'defaults'");
         defaults = mysql_fetch_row(mysql_use());
     }
@@ -96,7 +96,7 @@ static void neonserv_event_mode_async1(struct ClientSocket *client, struct UserN
         parseModeString(modelock, row[4]);
     else if(defaults[4])
         parseModeString(modelock, defaults[4]);
-    int uaccess = getChannelAccess(user, chan, 0);
+    int uaccess = getChannelAccess(user, chan);
     char *carg;
     int sent_modes_locked = 0;
     char tmp[MAXLEN];