fixed possibility crash
[srvx.git] / src / opserv.c
index e81b7840c2d821945f44d762df0513b17d480a21..d358d57637b4c59f10a51e819e99ee32115d2e6c 100644 (file)
@@ -4094,6 +4094,8 @@ opserv_staff_alert(struct userNode *user, UNUSED_ARG(struct handle_info *old_han
         || user->uplink->burst
         || !user->handle_info)
         return;
+    else if (IsBot(user))
+        return;
     else if (user->handle_info->opserv_level)
         type = "OPER";
     else if (IsNetworkHelper(user))
@@ -4104,9 +4106,9 @@ opserv_staff_alert(struct userNode *user, UNUSED_ARG(struct handle_info *old_han
         return;
 
     if (irc_in_addr_is_valid(user->ip))
-        send_channel_notice(opserv_conf.staff_auth_channel, opserv, IDENT_FORMAT" authed to %s account %s", IDENT_DATA(user), type, user->handle_info->handle);
+        send_channel_message(opserv_conf.staff_auth_channel, opserv, IDENT_FORMAT" authed to %s account %s", IDENT_DATA(user), type, user->handle_info->handle);
     else
-        send_channel_notice(opserv_conf.staff_auth_channel, opserv, "%s [%s@%s] authed to %s account %s", user->nick, user->ident, user->hostname, type, user->handle_info->handle);
+        send_channel_message(opserv_conf.staff_auth_channel, opserv, "%s [%s@%s] authed to %s account %s", user->nick, user->ident, user->hostname, type, user->handle_info->handle);
 }
 
 static void
@@ -4805,14 +4807,17 @@ static MODCMD_FUNC(cmd_simul)
 {
     struct userNode *target;
     char *line;
-    if(!(target=GetUserH(argv[1]))) {
-        reply("OSMSG_SVSNONICK", argv[1]);
-        return 0;
+    if(argc > 2) {
+               if(!(target=GetUserH(argv[1]))) {
+                       reply("OSMSG_SVSNONICK", argv[1]);
+                       return 0;
+               }
+               line = unsplit_string(argv + 2, argc - 2, NULL);
+               irc_simul(target,line);
+               reply("OSMSG_SIMUL",target->nick,line);
+               return 1;
     }
-    line = unsplit_string(argv + 2, argc - 2, NULL);
-    irc_simul(target,line);
-    reply("OSMSG_SIMUL",target->nick,line);
-    return 1;
+    return 0;
 }
 
 static MODCMD_FUNC(cmd_relay)