X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=src%2Fchanserv.c;fp=src%2Fchanserv.c;h=37d6531e5485dddb19db96586324777941a140fb;hb=5bbd945af96418ab4ced2e04cd98b07d6e3c9e71;hp=19a5c5776587b121248a86ecef4aab8b5bfe9030;hpb=a6e170afa9f97346f5824a9b9fcfb153103b525d;p=srvx.git diff --git a/src/chanserv.c b/src/chanserv.c index 19a5c57..37d6531 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." }, @@ -1523,7 +1524,7 @@ unregister_channel(struct chanData *channel, const char *reason) if(channel->expiry) timeq_del(channel->expiry, chanserv_expire_channel, channel, 0); channel->channel->channel_info = NULL; - + sprintf(msgbuf, "%s %s", channel->channel->name, reason); dict_delete(channel->notes); if(!IsSuspended(channel)) DelChannelUser(chanserv, channel->channel, msgbuf, 0); @@ -2168,7 +2169,6 @@ static CHANSERV_FUNC(cmd_register) struct handle_info *handle; struct chanData *cData; struct modeNode *mn; - char reason[MAXLEN]; char *chan_name; unsigned int new_channel, force=0; struct do_not_register *dnr; @@ -3287,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"; @@ -7130,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) @@ -7988,7 +8001,7 @@ chanserv_conf_read(void) str = database_get_data(conf_node, "off_channel", RECDB_QSTRING); off_channel = str ? atoi(str) : 0; - str = database_get_data(conf_node, "oper_chan", RECDB_QSTRING); + str = database_get_data(conf_node, "oper_channel", RECDB_QSTRING); if(str) { chanserv_conf.oper_channel = AddChannel(str, now, "+tinms", NULL); @@ -8963,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);