X-Git-Url: https://jfr.im/git/irc/evilnet/x3.git/blobdiff_plain/2c00fbc2522a44891208fbc52f683968263415c8..8ce9df050cb90b5124cdea7c53ab801599795a33:/src/opserv.c diff --git a/src/opserv.c b/src/opserv.c index b74fc17..b699874 100644 --- a/src/opserv.c +++ b/src/opserv.c @@ -18,6 +18,7 @@ * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ +#include "config.h" #include "chanserv.h" #include "conf.h" #include "common.h" @@ -44,7 +45,6 @@ #include #endif - #define OPSERV_CONF_NAME "services/opserv" #define KEY_ALERT_CHANNEL "alert_channel" @@ -1399,8 +1399,10 @@ opserv_svsjoin(struct userNode *target, UNUSED_ARG(char *src_handle), UNUSED_ARG return; /* channel is invite only */ } - if (channel->members.used >= channel->limit) { - return; /* channel is invite on */ + if (channel->limit > 0) { + if (channel->members.used >= channel->limit) { + return; /* channel is invite on */ + } } if (*channel->key) { @@ -2406,7 +2408,7 @@ static MODCMD_FUNC(cmd_stats_alerts) { reply("OSMSG_ALERTS_BAR"); for (it = dict_first(opserv_user_alerts); it; it = iter_next(it)) { alert = iter_data(it); - if(m && (!match_ircglob(alert->text_discrim, m) && strcasecmp(alert->owner, m)) ) + if(m && (!match_ircglob(alert->text_discrim, m) && strcasecmp(alert->owner, m) && strcasecmp(iter_key(it), m))) continue; /* not a match to requested filter */ switch (alert->reaction) { case REACT_NOTICE: reaction = "notice"; break; @@ -2808,7 +2810,7 @@ opserv_notice_handler(struct userNode *user, struct userNode *bot, char *text, U if(text[0] == '\001') { text++; cmd = mysep(&text, " "); - if(!irccasecmp(cmd, "VERSION")) { + if(cmd && !irccasecmp(cmd, "VERSION")) { char *version = mysep(&text, "\n"); if(!version) version = ""; @@ -5740,8 +5742,10 @@ trace_svsjoin_func(struct userNode *match, void *extra) return 1; /* channel is invite only */ } - if (channel->members.used >= channel->limit) { - return 1; /* channel is invite on */ + if (channel->limit > 0) { + if (channel->members.used >= channel->limit) { + return 1; /* channel is invite on */ + } } if (*channel->key) {