fixed trigger callback
[NeonServV5.git] / src / bot_NeonServ.c
index 785de6fead5d1b7565f933a11aadb6d39e5f1e09..9685801205800aec1d37eb4720aa8474ecc861fc 100644 (file)
@@ -340,6 +340,10 @@ static const struct default_language_entry msgtab[] = {
     {"NS_BOTS_FLAGS", "Flags"},
     {"NS_BOTS_CHANNELS", "Channels"},
     {"NS_BOTS_TRIGGER", "Trigger"},
+    {"NS_NICKLIST_NICK", "Nick"},
+    {"NS_NICKLIST_STATE", "State"},
+    {"NS_NICKLIST_ACCESS", "Access"},
+    {"NS_NICKLIST_SYNC", "use `nicklist sync` to fix all red and orange entrys in the list above (add opped users with 200 and voiced with 100 access)"},
     {NULL, NULL}
 };
 
@@ -390,7 +394,7 @@ static void neonserv_bot_ready(struct ClientSocket *client) {
     }
 }
 
-static void neonserv_trigger_callback(struct ChanNode *chan, char *trigger) {
+static void neonserv_trigger_callback(int clientid, struct ChanNode *chan, char *trigger) {
     MYSQL_RES *res;
     MYSQL_ROW row;
     loadChannelSettings(chan);
@@ -401,7 +405,7 @@ static void neonserv_trigger_callback(struct ChanNode *chan, char *trigger) {
     printf_mysql_query("SELECT `trigger` FROM `bot_channels` LEFT JOIN `bots` ON `botid` = `bots`.`id` WHERE `chanid` = '%d' AND `botclass` = '%d'", chan->channel_id, BOTID);
     res = mysql_use();
     row = mysql_fetch_row(res);
-    strcpy(trigger, (strlen(row[0]) ? row[0] : "+"));
+    strcpy(trigger, ((row && strlen(row[0])) ? row[0] : "+"));
 }
 
 static void start_bots() {