/***********************************************************************
X3 ChangeLog
+2006-08-01 Neil Spierling <sirvulcan@gmail.com>
+
+ * src/global.c: Added language strings for mod-helpserv.c, opserv.c,
+ spamserv.c, nickserv.c.
+
+ * src/mod-helpserv.c: Changed global_message uses to global_message_arg's.
+
+ * src/nickserv.c: Changed global_message uses to global_message_arg's.
+
+ * src/opserv.c: Changed global_message uses to global_message_arg's.
+
+ * src/spamserv.c: Changed global_message uses to global_message_arg's.
+
2006-08-01 Neil Spierling <sirvulcan@gmail.com>
* src/chanserv.c: Changed global_message uses to global_message_arg's.
{ "CSMSG_UNSUSPENDED_BY", "%s unsuspended by %s." },
{ "CSMSG_OWNERSHIP_TRANSFERRED", "%s ownership transferred to %s by %s." },
+ /* mod-helpserv.c */
+ { "HSMSG_BOT_RENAMED", "HelpServ bot %s (in %s) renamed to %s by %s." },
+ { "HSMSG_BOT_MOVED", "HelpServ %s (%s) moved to %s by %s." },
+ { "HSMSG_BOT_REGISTERED", "HelpServ %s (%s) registered to %s by %s." },
+ { "HSMSG_BOT_EXPIRED", "HelpServ %s (%s) expired at request of %s." },
+ { "HSMSG_BOT_UNREGISTERED", "HelpServ %s (%s) unregistered by %s." },
+
+ /* nickserv.c */
+ { "NSMSG_ACCOUNT_RENAMED", "%s renamed account %s to %s." },
+ { "NSMSG_ACCOUNT_MERGED", "%s (%s) merged account %s into %s." },
+
/* opserv.c */
{ "DEFCON_NETWORK_CHANGED", "Network DefCon level has changed to level %d" },
{ "DEFCON_OPER_LEVEL_CHANGE", "%s is changing the DefCon level to %d" },
{ "DEFCON_TIMEOUT_LEVEL_CHANGE", "The DefCon has changed back to level %d (timeout)" },
+ { "OSMSG_CHANNEL_ACTIVITY_WARN", "Channel activity warning for channel %s: %s" },
+
+ /* spamserv.c */
+ { "SSMSG_CHANNEL_MERGED", "$X (channel %s) merged into %s by %s." },
+ { "SSMSG_CHANNEL_MOVED", "$X (channel %s) moved into %s by %s." },
+ { "SSMSG_UNREG_MANUAL", "$X (channel %s) %s by %s." },
+ { "SSMSG_REG_EXPIRED", "$X (channel %s) registration expired." },
+ { "SSMSG_LOST_ALL_USERS", "$X (channel %s) lost all users." },
+ { "SSMSG_REGISTERED_BY", "$X (channel %s) registered by %s." },
+ { "SSMSG_UNREGISTERED_BY", "$X (channel %s) unregistered by %s." },
{ NULL, NULL }
};
REQUIRE_PARMS(2);
if (is_valid_nick(argv[1])) {
- char *newnick = argv[1], oldnick[NICKLEN], reason[MAXLEN];
+ char *newnick = argv[1], oldnick[NICKLEN];
strcpy(oldnick, hs->helpserv->nick);
helpserv_notice(user, "HSMSG_RENAMED", oldnick, newnick);
- snprintf(reason, MAXLEN, "HelpServ bot %s (in %s) renamed to %s by %s.", oldnick, hs->helpchan->name, newnick, user->nick);
- global_message(MESSAGE_RECIPIENT_OPERS, reason);
+ global_message_args(MESSAGE_RECIPIENT_OPERS, "HSMSG_BOT_RENAMED", oldnick,
+ hs->helpchan->name, newnick, user->nick);
return 1;
} else if (IsChannelName(argv[1])) {
}
helpserv_botlist_append(botlist, hs);
- snprintf(reason, MAXLEN, "HelpServ %s (%s) moved to %s by %s.", hs->helpserv->nick, oldchan, newchan, user->nick);
- global_message(MESSAGE_RECIPIENT_OPERS, reason);
+ global_message_args(MESSAGE_RECIPIENT_OPERS, "HSMSG_BOT_MOVED", hs->helpserv->nick,
+ oldchan, newchan, user->nick);
return 1;
} else {
}
static HELPSERV_FUNC(cmd_register) {
- char *nick, *helpchan, reason[MAXLEN];
+ char *nick, *helpchan;
struct handle_info *handle;
REQUIRE_PARMS(4);
helpserv_notice(user, "HSMSG_REG_SUCCESS", handle->handle, nick);
- snprintf(reason, MAXLEN, "HelpServ %s (%s) registered to %s by %s.", nick, hs->helpchan->name, handle->handle, user->nick);
/* Not sent to helpers, since they can't register HelpServ */
- global_message(MESSAGE_RECIPIENT_OPERS, reason);
+ global_message_args(MESSAGE_RECIPIENT_OPERS, "HSMSG_BOT_REGISTERED", nick,
+ hs->helpchan->name, handle->handle, user->nick);
return 1;
}
snprintf(reason, sizeof(reason), quit_fmt, actor);
DelUser(bot->helpserv, NULL, 1, reason);
dict_remove(helpserv_bots_dict, botname);
- snprintf(reason, sizeof(reason), global_fmt, botname, channame, actor);
- global_message(MESSAGE_RECIPIENT_OPERS, reason);
+ global_message_args(MESSAGE_RECIPIENT_OPERS, global_fmt, botname, channame, actor);
}
static HELPSERV_FUNC(cmd_unregister) {
log_audit(HS_LOG, LOG_COMMAND, user, hs->helpserv, hs->helpchan->name, 0, "unregister CONFIRM");
}
- helpserv_unregister(hs, "Unregistered by %s", "HelpServ %s (%s) unregistered by %s.", user->nick);
+ helpserv_unregister(hs, "Unregistered by %s", "HSMSG_BOT_UNREGISTERED", user->nick);
return from_opserv;
}
next = iter_next(it);
if ((unsigned int)(now - bot->last_active) < helpserv_conf.expire_age)
continue;
- helpserv_unregister(bot, "Registration expired due to inactivity", "HelpServ %s (%s) expired at request of %s.", user->nick);
+ helpserv_unregister(bot, "Registration expired due to inactivity", "HSMSG_BOT_EXPIRED", user->nick);
count++;
}
helpserv_notice(user, "HSMSG_EXPIRATION_DONE", count);
{
struct handle_info *hi;
struct userNode *uNode;
- char msgbuf[MAXLEN], *old_handle;
+ char *old_handle;
unsigned int nn;
NICKSERV_MIN_PARMS(3);
dict_insert(nickserv_handle_dict, hi->handle, hi);
for (nn=0; nn<rf_list_used; nn++)
rf_list[nn](hi, old_handle);
- snprintf(msgbuf, sizeof(msgbuf), "%s renamed account %s to %s.", user->handle_info->handle, old_handle, hi->handle);
-
if (nickserv_conf.sync_log) {
for (uNode = hi->users; uNode; uNode = uNode->next_authed)
}
reply("NSMSG_HANDLE_CHANGED", old_handle, hi->handle);
- global_message(MESSAGE_RECIPIENT_STAFF, msgbuf);
+ global_message_args(MESSAGE_RECIPIENT_OPERS, "NSMSG_ACCOUNT_RENAMED",
+ user->handle_info->handle, old_handle, hi->handle);
+
free(old_handle);
return 1;
}
struct userNode *last_user;
struct userData *cList, *cListNext;
unsigned int ii, jj, n;
- char buffer[MAXLEN];
NICKSERV_MIN_PARMS(3);
hi_to->fakehost = strdup(hi_from->fakehost);
/* Notify of success. */
- sprintf(buffer, "%s (%s) merged account %s into %s.", user->nick, user->handle_info->handle, hi_from->handle, hi_to->handle);
reply("NSMSG_HANDLES_MERGED", hi_from->handle, hi_to->handle);
- global_message(MESSAGE_RECIPIENT_STAFF, buffer);
+ global_message_args(MESSAGE_RECIPIENT_OPERS, "NSMSG_ACCOUNT_MERGED", user->nick,
+ user->handle_info->handle, hi_from->handle, hi_to->handle);
/* Unregister the "from" handle. */
nickserv_unregister_handle(hi_from, NULL, cmd->parent->bot);
dict_insert(opserv_chan_warn, strdup(argv[1]), reason);
reply("OSMSG_WARN_ADDED", argv[1], reason);
if (dict_find(channels, argv[1], NULL)) {
- message = alloca(strlen(reason) + strlen(argv[1]) + 55);
- sprintf(message, "Channel activity warning for channel %s: %s", argv[1], reason);
- global_message(MESSAGE_RECIPIENT_OPERS, message);
+ global_message_args(MESSAGE_RECIPIENT_OPERS, "OSMSG_CHANNEL_ACTIVITY_WARN" argv[1], reason);
}
return 1;
}
}
/*
if ((warning = dict_find(opserv_chan_warn, newchan->name, NULL))) {
- char message[MAXLEN];
- snprintf(message, sizeof(message), "Channel activity warning for channel %s: %s", newchan->name, warning);
- global_message(MESSAGE_RECIPIENT_OPERS, message);
+ global_message_args(MESSAGE_RECIPIENT_OPERS, "OSMSG_CHANNEL_ACTIVITY_WARN", newchan->name, warning);
}
*/
spamserv_part_channel(channel, reason);
if(move)
- snprintf(reason, sizeof(reason), "$X (channel %s) moved to %s by %s.", channel->name, target->name, user->handle_info->handle);
+ global_message_args(MESSAGE_RECIPIENT_OPERS | MESSAGE_RECIPIENT_HELPERS,
+ "SSMSG_CHANNEL_MOVED", channel->name, target->name,
+ user->handle_info->handle);
else
- snprintf(reason, sizeof(reason), "$X (channel %s) merged into %s by %s.", channel->name, target->name, user->handle_info->handle);
+ global_message_args(MESSAGE_RECIPIENT_OPERS | MESSAGE_RECIPIENT_HELPERS,
+ "SSMSG_CHANNEL_MERGED", channel->name, target->name,
+ user->handle_info->handle);
- global_message(MESSAGE_RECIPIENT_OPERS | MESSAGE_RECIPIENT_HELPERS, reason);
return 1;
}
if(cInfo)
{
- char global[MAXLEN], partmsg[MAXLEN];
+ char partmsg[MAXLEN];
switch (type)
{
case manually:
- snprintf(global, sizeof(global), "$X (channel %s) %s by %s.", channel->name, reason, user->handle_info->handle);
+ global_message_args(MESSAGE_RECIPIENT_OPERS | MESSAGE_RECIPIENT_HELPERS, "SSMSG_UNREG_MANUAL",
+ channel->name, reason, user->handle_info->handle);
snprintf(partmsg, sizeof(partmsg), "%s %s by %s.", channel->name, reason, user->handle_info->handle);
break;
case expire:
- snprintf(global, sizeof(global), "$X (channel %s) registration expired.", channel->name);
+ global_message_args(MESSAGE_RECIPIENT_OPERS | MESSAGE_RECIPIENT_HELPERS, "SSMSG_REG_EXPIRED",
+ channel->name);
snprintf(partmsg, sizeof(partmsg), "%s registration expired.", channel->name);
break;
case lost_all_users:
- snprintf(global, sizeof(global), "$X (channel %s) lost all users.", channel->name);
+ global_message_args(MESSAGE_RECIPIENT_OPERS | MESSAGE_RECIPIENT_HELPERS, "SSMSG_LOST_ALL_USERS",
+ channel->name);
snprintf(partmsg, sizeof(partmsg), "%s lost all users.", channel->name);
break;
}
spamserv_part_channel(channel, partmsg);
spamserv_unregister_channel(cInfo);
- global_message(MESSAGE_RECIPIENT_OPERS | MESSAGE_RECIPIENT_HELPERS, global);
}
}
SPAMSERV_FUNC(cmd_register)
{
struct chanInfo *cInfo;
- char reason[MAXLEN];
if(!channel || !channel->channel_info)
{
spamserv_join_channel(cInfo->channel);
- snprintf(reason, sizeof(reason), "%s (channel %s) registered by %s.", spamserv->nick, channel->name, user->handle_info->handle);
- global_message(MESSAGE_RECIPIENT_OPERS | MESSAGE_RECIPIENT_HELPERS, reason);
+ global_message_args(MESSAGE_RECIPIENT_OPERS | MESSAGE_RECIPIENT_HELPERS, "SSMSG_REGISTERED_BY",
+ channel->name, user->handle_info->handle);
ss_reply("SSMSG_REG_SUCCESS", channel->name);
return 1;
spamserv_unregister_channel(cInfo);
- snprintf(reason, sizeof(reason), "%s (channel %s) unregistered by %s.", spamserv->nick, channel->name, user->handle_info->handle);
- global_message(MESSAGE_RECIPIENT_OPERS | MESSAGE_RECIPIENT_HELPERS, reason);
+ global_message_args(MESSAGE_RECIPIENT_OPERS | MESSAGE_RECIPIENT_HELPERS, "SSMSG_UNREGISTERED_BY",
+ channel->name, user->handle_info->handle);
ss_reply("SSMSG_UNREG_SUCCESS", channel->name);
return 1;