X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=src%2Fcmd_neonspam_set.c;h=139e1efce812bda540f9d2f60c1951ec7290e4fd;hb=bb5692b9cbff069abbf9573c81e86c3cd2061ceb;hp=857e597d9fd71e1d60fcafceb271069555255b41;hpb=6897b648b416a11e40d1aa1db38bdaaa131e1fb5;p=NeonServV5.git diff --git a/src/cmd_neonspam_set.c b/src/cmd_neonspam_set.c index 857e597..139e1ef 100644 --- a/src/cmd_neonspam_set.c +++ b/src/cmd_neonspam_set.c @@ -1,5 +1,5 @@ -/* cmd_neonspam_set.c - NeonServ v5.1 - * Copyright (C) 2011 Philipp Kreil (pk910) +/* cmd_neonspam_set.c - NeonServ v5.3 + * Copyright (C) 2011-2012 Philipp Kreil (pk910) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -139,7 +139,7 @@ CMD_BIND(neonspam_cmd_set) { int i, j; if(argc && !strcmp(argv[0], "defaults")) { //reset channel settings - int uaccess = getChannelAccess(user, chan, 0); + int uaccess = getChannelAccess(user, chan); if(uaccess < 500) { if(isGodMode(user)) { event->flags |= CMDFLAG_OPLOG; @@ -292,12 +292,12 @@ static char* neonspam_cmd_set_trigger(struct ClientSocket *client, struct UserNo //get current trigger MYSQL_RES *res; MYSQL_ROW row; - printf_mysql_query("SELECT `trigger` FROM `bot_channels` WHERE `chanid` = '%d' AND `botid` = '%d'", chan->channel_id, client->clientid); + printf_mysql_query("SELECT `trigger`, `defaulttrigger` FROM `bot_channels` LEFT JOIN `bots` ON `botid` = `bots`.`id` WHERE `chanid` = '%d' AND `botid` = '%d'", chan->channel_id, client->clientid); res = mysql_use(); row = mysql_fetch_row(res); - trigger = row[0]; + trigger = (row[0] ? row[0] : row[1]); if(argument) { - int uaccess = getChannelAccess(user, chan, 0); + int uaccess = getChannelAccess(user, chan); if(uaccess < 500) { if(isGodMode(user)) { event->flags |= CMDFLAG_OPLOG; @@ -345,7 +345,7 @@ static char* neonspam_cmd_setexcept(struct ClientSocket *client, struct UserNode reply(getTextBot(), user, "NS_INVALID_ACCESS", caccess); return NULL; } - int uaccess = getChannelAccess(user, chan, 0); + int uaccess = getChannelAccess(user, chan); if(uaccess == 500) uaccess++; if(value > uaccess) { if(isGodMode(user)) { @@ -613,7 +613,7 @@ static char* neonspam_cmd_setscanexcept(struct ClientSocket *client, struct User reply(getTextBot(), user, "NS_INVALID_ACCESS", caccess); return NULL; } - int uaccess = getChannelAccess(user, chan, 0); + int uaccess = getChannelAccess(user, chan); if(uaccess == 500) uaccess++; if(identical && value > uaccess) { if(isGodMode(user)) {