X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=src%2Fchanserv.c;h=9358d160a305c46ec36fa7d87a9f6124cf2373c9;hb=HEAD;hp=a2f6175f5ef619b936f9064435ffcda8f9daba31;hpb=95ca19dd93fa5ef8d8756d0ef0ec1c39fe398650;p=srvx.git diff --git a/src/chanserv.c b/src/chanserv.c index a2f6175..9358d16 100644 --- a/src/chanserv.c +++ b/src/chanserv.c @@ -399,7 +399,7 @@ static const struct message_entry msgtab[] = { { "CSMSG_LC_H_TITLE", "support helper" }, { "CSMSG_LAME_SMURF_TARGET", "%s is an IRC operator." }, { "CSMSG_MYACCESS_COUNT", "%s has access in $b%d$b channels and is owner of $b%d$b channel(s)." }, - { "CSMSG_MYACCESS_COUNT_1", "%s has access in $b%d$b channel and is owner of $b%d$b channel(s)." }, + { "CSMSG_MYACCESS_COUNT_1", "%s has access in $b%d$b channel and is owner of $b%d$b channel(s)." }, /* Seen information */ @@ -483,6 +483,7 @@ static const struct message_entry msgtab[] = { /* Toys */ { "CSMSG_UNF_RESPONSE", "I don't want to be part of your sick fantasies!" }, { "CSMSG_PING_RESPONSE", "Pong!" }, + { "CSMSG_PONG_RESPONSE", "Ping!" }, { "CSMSG_WUT_RESPONSE", "wut" }, { "CSMSG_BAD_NUMBER", "$b%s$b is an invalid number. Please use a number greater than 1 with this command." }, { "CSMSG_BAD_DIE_FORMAT", "I do not understand $b%s$b. Please use either a single number or standard 4d6+3 format." }, @@ -2390,7 +2391,7 @@ static CHANSERV_FUNC(cmd_move) REQUIRE_PARAMS(2); - if(IsProtected(channel->channel_info)) + if(IsProtected(channel->channel_info) && !IsOper(user)) { reply("CSMSG_MOVE_NODELETE", channel->name); return 0; @@ -2698,7 +2699,7 @@ static CHANSERV_FUNC(cmd_merge) return 0; } - if(IsProtected(channel->channel_info)) + if(IsProtected(channel->channel_info) && !IsOper(user)) { reply("CSMSG_MERGE_NODELETE"); return 0; @@ -3286,8 +3287,7 @@ static CHANSERV_FUNC(cmd_opme) return 0; } - struct devnull_class *devnull; - if(user->handle_info->devnull && (devnull = devnull_get(user->handle_info->devnull)) && (devnull->modes & DEVNULL_MODE_OPME)) + if(devnull_user_has_priv(user->handle_info, DEVNULL_PRIV_OPME)) { change.args[0].mode = MODE_CHANOP; errmsg = "CSMSG_ALREADY_OPPED"; @@ -5425,7 +5425,7 @@ static CHANSERV_FUNC(cmd_csuspend) REQUIRE_PARAMS(3); - if(IsProtected(channel->channel_info)) + if(IsProtected(channel->channel_info) && !IsOper(user)) { reply("CSMSG_SUSPEND_NODELETE", channel->name); return 0; @@ -7129,6 +7129,20 @@ static CHANSERV_FUNC(cmd_ping) return 1; } +static CHANSERV_FUNC(cmd_pong) +{ + if(channel) + { + char response[MAXLEN]; + const char *fmt = user_find_message(user, "CSMSG_PONG_RESPONSE"); + sprintf(response, "%s: %s", user->nick, fmt); + irc_privmsg(cmd->parent->bot, channel->name, response); + } + else + reply("CSMSG_PONG_RESPONSE"); + return 1; +} + static CHANSERV_FUNC(cmd_wut) { if(channel) @@ -8962,6 +8976,7 @@ init_chanserv(const char *nick) DEFINE_COMMAND(unf, 1, 0, "flags", "+nolog,+toy,+acceptchan", NULL); DEFINE_COMMAND(ping, 1, 0, "flags", "+nolog,+toy,+acceptchan", NULL); + DEFINE_COMMAND(pong, 1, 0, "flags", "+nolog,+toy,+acceptchan", NULL); DEFINE_COMMAND(wut, 1, 0, "flags", "+nolog,+toy,+acceptchan", NULL); DEFINE_COMMAND(8ball, 2, 0, "flags", "+nolog,+toy,+acceptchan", NULL); DEFINE_COMMAND(d, 2, 0, "flags", "+nolog,+toy,+acceptchan", NULL);