X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=src%2Fopserv.c;h=83eb31080107824144522160212037d488456ea6;hb=7707f9ac01524cce3abc387d9c16fa31d7eca31f;hp=a899e2c0a6b97ca6b6531fc0af76fc9ca672e0ed;hpb=0e705c6806e3fe659cc182310d229c8eb0da316e;p=srvx.git diff --git a/src/opserv.c b/src/opserv.c index a899e2c..83eb310 100644 --- a/src/opserv.c +++ b/src/opserv.c @@ -268,6 +268,8 @@ static const struct message_entry msgtab[] = { { "OSMSG_SVSNICKUSED", "$b%s$b is an already used nickname." }, { "OSMSG_SVSNICK", "You have renamed $b%s$b to $b%s$b." }, { "OSMSG_SVSJOIN", "$b%s$b joined $b%s$b." }, + { "OSMSG_SVSPART", "$b%s$b parted $b%s$b." }, + { "OSMSG_SVSKILL", "$b%s$b killed: $b%s$b." }, { "OSMSG_SVSMODE", "You have set mode $b%s$b for $b%s$b." }, { "OSMSG_SIMUL", "You have simuled $b%s$b: %s" }, { "OSMSG_DEVNULL_USER" , "[%s] %s %s" }, @@ -297,6 +299,7 @@ static const struct message_entry msgtab[] = { { "OSMSG_DEVNULL_SET_M", "OverrideNoAmsg: %s" }, { "OSMSG_DEVNULL_SET_N", "MaxSendQ: %s" }, { "OSMSG_DEVNULL_SET_N_i", "MaxSendQ: %i" }, + { "OSMSG_DEVNULL_SET_OPME", "OpMe: %s" }, { "OSMSG_DEVNULL_SET_DONE", "Done." }, { "OSMSG_DEVNULL_RENAMED", "Devnull class %s renamed to %s" }, { "OSMSG_DEVNULL_SET_INVALID", "Invalid Option for setting %s" }, @@ -1239,7 +1242,7 @@ static MODCMD_FUNC(cmd_part) static MODCMD_FUNC(cmd_mode) { - if (!modcmd_chanmode(argv+1, argc-1, MCP_ALLOW_OVB|MCP_KEY_FREE|MC_ANNOUNCE)) { + if (!modcmd_chanmode(argv+1, argc-1, MCP_ALLOW_OVB|MCP_KEY_FREE|MC_ANNOUNCE|MCP_OPERMODE)) { reply("MSG_INVALID_MODES", unsplit_string(argv+1, argc-1, NULL)); return 0; } @@ -1338,7 +1341,7 @@ static MODCMD_FUNC(cmd_whois) reply("OSMSG_WHOIS_ACCOUNT", (target->handle_info ? target->handle_info->handle : "Not authenticated")); intervalString(buffer, now - target->timestamp, user->handle_info); reply("OSMSG_WHOIS_NICK_AGE", buffer); - if (target->channels.used <= MAX_CHANNELS_WHOIS) + if (target->channels.used <= MAX_CHANNELS_WHOIS || HANDLE_FLAGGED(user->handle_info, BOT)) opserv_ison(user, target, "OSMSG_WHOIS_CHANNELS"); else reply("OSMSG_WHOIS_HIDECHANS"); @@ -4093,6 +4096,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)) @@ -4103,9 +4108,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 @@ -4271,7 +4276,7 @@ static MODCMD_FUNC(cmd_listdevnull) count++; } tbl.length = count+1; - tbl.width = 14; + tbl.width = 15; tbl.flags = 0; tbl.flags = TABLE_NO_FREE; tbl.contents = malloc(tbl.length * sizeof(tbl.contents[0])); @@ -4290,6 +4295,7 @@ static MODCMD_FUNC(cmd_listdevnull) tbl.contents[0][11] = "+S"; tbl.contents[0][12] = "+X"; tbl.contents[0][13] = "MaxQ"; + tbl.contents[0][14] = "OpMe"; if(!count) { table_send(cmd->parent->bot, user->nick, 0, NULL, tbl); @@ -4369,6 +4375,11 @@ static MODCMD_FUNC(cmd_listdevnull) } else { tbl.contents[ii][13] = off; } + if(DEVNULL_FLAGGED(th, MODE_OPME)) { + tbl.contents[ii][14] = on; + } else { + tbl.contents[ii][14] = off; + } } table_send(cmd->parent->bot, user->nick, 0, NULL, tbl); for(ii = 1; ii < tbl.length; ++ii) @@ -4405,6 +4416,7 @@ static MODCMD_FUNC(cmd_listdevnull) send_message_type(4, user, opserv,"+k = ChanServ Mode (mode +k)"); send_message_type(4, user, opserv,"+S = NetServ Mode (mode +S)"); send_message_type(4, user, opserv,"+X = XtraOp Mode (mode +X)"); + send_message_type(4, user, opserv,"OpMe = ChanServ opme command"); return 1; } @@ -4612,6 +4624,17 @@ static MODCMD_FUNC(cmd_setdevnull) th->maxsendq = strtoul(argv[offset+3], NULL, 0); reply("OSMSG_DEVNULL_SET_DONE"); } + } + else if(!strcmp("OPME",argv[offset+2])) { + if (!strcmp("OFF",argv[offset+3]) || !strcmp("0",argv[offset+3])) { + DEVNULL_CLEAR_FLAG(th, MODE_OPME); + reply("OSMSG_DEVNULL_SET_DONE"); + } else if (!strcmp("ON",argv[offset+3]) || !strcmp("1",argv[offset+3])) { + DEVNULL_SET_FLAG(th, MODE_OPME); + reply("OSMSG_DEVNULL_SET_DONE"); + } else { + reply("OSMSG_DEVNULL_SET_INVALID", argv[offset+3]); + } } else { reply("OSMSG_DEVNULL_SET_INVALID", argv[offset+2]); } @@ -4685,6 +4708,11 @@ static MODCMD_FUNC(cmd_setdevnull) } else { reply("OSMSG_DEVNULL_SET_N", "off"); } + if(DEVNULL_FLAGGED(th, MODE_OPME)) { + reply("OSMSG_DEVNULL_SET_OPME", "on"); + } else { + reply("OSMSG_DEVNULL_SET_OPME", "off"); + } } } else { reply("OSMSG_DEVNULL_NOTFOUND", argv[offset+1]); @@ -4746,6 +4774,34 @@ static MODCMD_FUNC(cmd_svsjoin) return 1; } +static MODCMD_FUNC(cmd_svspart) +{ + struct userNode *target; + if(!(target=GetUserH(argv[1]))) { + reply("OSMSG_SVSNONICK", argv[1]); + return 0; + } + if(!IsChannelName(argv[2])) + { + reply("MSG_NOT_CHANNEL_NAME"); + return 0; + } + irc_svspartchan(opserv,target,argv[2]); + reply("OSMSG_SVSPART",target->nick,argv[2]); + return 1; +} + +static MODCMD_FUNC(cmd_svskill) +{ + struct userNode *target; + if(!(target=GetUserH(argv[1]))) { + reply("OSMSG_SVSNONICK", argv[1]); + return 0; + } + DelUser(target, opserv, 1, argv[2]); + reply("OSMSG_SVSKILL",target->nick,argv[2]); + return 1; +} static MODCMD_FUNC(cmd_svsnick) { struct userNode *target; @@ -4781,14 +4837,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) @@ -5056,10 +5115,12 @@ init_opserv(const char *nick) opserv_define_func("DEVNULL SET", cmd_setdevnull, 200, 0, 2); opserv_define_func("DEVNULL LIST", cmd_listdevnull, 200, 0, 0); opserv_define_func("SVSJOIN", cmd_svsjoin, 800, 0, 3); + opserv_define_func("SVSPART", cmd_svspart, 800, 0, 3); + opserv_define_func("SVSKILL", cmd_svskill, 800, 0, 3); opserv_define_func("SVSMODE", cmd_svsmode, 800, 0, 3); opserv_define_func("SVSNICK", cmd_svsnick, 800, 0, 3); opserv_define_func("RELAY", cmd_relay, 800, 0, 0); - opserv_define_func("SIMUL", cmd_simul, 999, 0, 2); + opserv_define_func("SIMUL", cmd_simul, 999, 0, 3); opserv_define_func("TRACE", cmd_trace, 100, 0, 3); opserv_define_func("TRACE PRINT", NULL, 0, 0, 0); opserv_define_func("TRACE COUNT", NULL, 0, 0, 0);