]> jfr.im git - irc/evilnet/x3.git/blobdiff - src/opserv.c
ignore ALIST messages
[irc/evilnet/x3.git] / src / opserv.c
index f6b701491827a8e00a73be784d4216a89109be6c..1d007f3d8aab357b93da133f7f5e9358ca6d8f7a 100644 (file)
@@ -5,7 +5,7 @@
  *
  * x3 is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation; either version 3 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
@@ -45,7 +45,6 @@
 #include <arpa/inet.h>
 #endif
 
-
 #define OPSERV_CONF_NAME "services/opserv"
 
 #define KEY_ALERT_CHANNEL "alert_channel"
@@ -1400,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) {
@@ -2407,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;
@@ -3182,6 +3183,8 @@ activate_routing(struct svccmd *cmd, struct userNode *user, char *plan_name)
     /* Delete the existing active route */
     wipe_route_list(opserv_route);
 
+    if(!rp || !rp->servers)
+       return 1;
     for(it = dict_first(rp->servers); it; it = iter_next(it)) {
             const char* servername = iter_key(it);
             struct routingPlanServer *rps = iter_data(it), 
@@ -5741,8 +5744,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) {