From: NurPech Date: Mon, 20 May 2013 20:18:20 +0000 (+0200) Subject: added oper messages X-Git-Url: http://git.pk910.de/?p=srvx.git;a=commitdiff_plain;h=c7c06b7fb90b2596050dbb60d3c8d567bbf49239 added oper messages --- diff --git a/src/chanserv.c b/src/chanserv.c index 23e8e63..19a5c57 100644 --- a/src/chanserv.c +++ b/src/chanserv.c @@ -141,7 +141,7 @@ #define KEY_EXPIRES "expires" #define KEY_TRIGGERED "triggered" -#define CHANNEL_DEFAULT_FLAGS (CHANNEL_OFFCHANNEL | CHANNEL_UNREVIEWED) +#define CHANNEL_DEFAULT_FLAGS (CHANNEL_UNREVIEWED) #define CHANNEL_PRESERVED_FLAGS (CHANNEL_UNREVIEWED) #define CHANNEL_DEFAULT_OPTIONS "lmoooanpcnat" @@ -156,7 +156,6 @@ static const struct message_entry msgtab[] = { { "CSMSG_MUST_BE_OPPED", "You must be a channel operator in $b%s$b to register it." }, { "CSMSG_PROXY_FORBIDDEN", "You may not register a channel for someone else." }, { "CSMSG_OWN_TOO_MANY", "%s already owns enough channels (at least %d); use FORCE to override." }, - { "CMSG_ALERT_REGISTERED", "%s registered to %s by %s." }, /* Do-not-register channels */ { "CSMSG_NOT_DNR", "$b%s$b is not a valid channel name or *account." }, @@ -179,7 +178,6 @@ static const struct message_entry msgtab[] = { { "CSMSG_UNREG_NODELETE", "$b%s$b is protected from unregistration." }, { "CSMSG_CHAN_SUSPENDED", "$b$C$b access to $b%s$b has been temporarily suspended (%s)." }, { "CSMSG_CONFIRM_UNREG", "To confirm this unregistration, you must use 'unregister %s'." }, - { "CMSG_ALERT_UNREGISTERED", "%s %s" }, /* Channel moving */ { "CSMSG_MOVE_SUCCESS", "Channel registration has been moved to $b%s$b." }, @@ -525,6 +523,9 @@ static const struct message_entry msgtab[] = { { NULL, NULL } }; +#define CSMSG_ALERT_REGISTERED "%s registered to %s by %s." +#define CSMSG_ALERT_UNREGISTERED "%s %s" + /* eject_user and unban_user flags */ #define ACTION_KICK 0x0001 #define ACTION_BAN 0x0002 @@ -1526,7 +1527,8 @@ unregister_channel(struct chanData *channel, const char *reason) dict_delete(channel->notes); if(!IsSuspended(channel)) DelChannelUser(chanserv, channel->channel, msgbuf, 0); - chanserv_oper_message("CSMSG_ALERT_UNREGISTERED"", channel->channel->name, reason); + + chanserv_oper_message(CSMSG_ALERT_UNREGISTERED, channel->channel->name, reason); UnlockChannel(channel->channel); free(channel); registered_channels--; @@ -2277,7 +2279,7 @@ static CHANSERV_FUNC(cmd_register) else reply("CSMSG_REG_SUCCESS", channel->name); - chanserv_oper_message("CSMSG_ALERT_REGISTERED", channel->name, handle->handle, user->handle_info->handle); + chanserv_oper_message(CSMSG_ALERT_REGISTERED, channel->name, handle->handle, user->handle_info->handle); return 1; } diff --git a/src/mod-watchdog.c b/src/mod-watchdog.c index 0866b00..e6bb84c 100644 --- a/src/mod-watchdog.c +++ b/src/mod-watchdog.c @@ -84,7 +84,9 @@ struct watchdog_channel { #define BADACTION_KILL 2 #define BADACTION_GLINE 3 -#define WDMSG_BADWORD_ALERT "%s used badword '%s' in channel: %s" +#define WDMSG_BADWORD_ALERT "%s used badword '%s' in channel: %s." +#define WDMSG_REGISTER_SUCCESS "$b%s$b is now registered with %s by %s." +#define WDMSG_UNREG_SUCCESS "$b%s$b is now unregistered by %s." static struct { const char *nick; @@ -356,7 +358,7 @@ static MODCMD_FUNC(cmd_register) add_channel(channel->name); reply("WDMSG_REGISTER_SUCCESS", channel->name, watchdog->nick); - watchdog_oper_message("WDMSG_REGISTER_SUCCESS", channel->name, watchdog->nick); + watchdog_oper_message(WDMSG_REGISTER_SUCCESS, channel->name, watchdog->nick, user->handle_info->handle); return 1; } @@ -378,7 +380,7 @@ static MODCMD_FUNC(cmd_unregister) DelChannelUser(watchdog, channel, reason, 0); dict_remove(chanlist, channel->name); reply("CSMSG_UNREG_SUCCESS", channel->name); - watchdog_oper_message("CSMSG_UNREG_SUCCESS", channel->name); + watchdog_oper_message(WDMSG_UNREG_SUCCESS, channel->name, user->handle_info->handle); return 1; } else { reply("WDMSG_NOT_REGISTERED", channel->name, watchdog->nick); diff --git a/src/spamserv.c b/src/spamserv.c index f0ccca5..7d6d9b3 100644 --- a/src/spamserv.c +++ b/src/spamserv.c @@ -123,8 +123,6 @@ static const struct message_entry msgtab[] = { { "SSMSG_STATUS_MEMORY", "$bMemory Information:$b" }, { "SSMSG_STATUS_CHANNEL_LIST", "$bRegistered Channels:$b" }, { "SSMSG_STATUS_NO_CHANNEL", "No channels registered." }, - { "SSMSG_CHANNEL_REGISTERED", "%s (channel %s) registered by %s." }, - { "SSMSG_CHANNEL_UNREGISTERED", "%s (channel %s) unregistered by %s." }, { NULL, NULL } }; @@ -141,6 +139,8 @@ static const struct message_entry msgtab[] = { #define SSMSG_WARNING_2 "You are violating the network rules" #define SSMSG_WARNING_RULES "%s is against the network rules. Read the network rules at %s" #define SSMSG_WARNING_RULES_2 "You are violating the network rules. Read the network rules at %s" +#define SSMSG_CHANNEL_REGISTERED "%s (channel %s) registered by %s." +#define SSMSG_CHANNEL_UNREGISTERED "%s (channel %s) unregistered by %s." static struct { @@ -1093,7 +1093,7 @@ SPAMSERV_FUNC(cmd_register) spamserv_join_channel(cInfo->channel); - spamserv_oper_message("SSMSG_CHANNEL_REGISTERED", spamserv->nick, channel->name, user->handle_info->handle); + spamserv_oper_message(SSMSG_CHANNEL_REGISTERED, spamserv->nick, channel->name, user->handle_info->handle); ss_reply("SSMSG_REG_SUCCESS", channel->name); return 1; @@ -1142,7 +1142,7 @@ SPAMSERV_FUNC(cmd_unregister) spamserv_unregister_channel(cInfo); - spamserv_oper_message("SSMSG_CHANNEL_UNREGISTERED", spamserv->nick, channel->name, user->handle_info->handle); + spamserv_oper_message(SSMSG_CHANNEL_UNREGISTERED, channel->name, user->handle_info->handle); ss_reply("SSMSG_UNREG_SUCCESS", channel->name); return 1;