]> jfr.im git - irc/evilnet/x3.git/commitdiff
Changed the last of the global_message uses to global_message_arg's.
authorsirvulcan <redacted>
Tue, 1 Aug 2006 04:49:57 +0000 (04:49 +0000)
committersirvulcan <redacted>
Tue, 1 Aug 2006 04:49:57 +0000 (04:49 +0000)
ChangeLog
src/global.c
src/mod-helpserv.c
src/nickserv.c
src/opserv.c
src/spamserv.c

index 17c760956b6404f37a3e09c97148fc05f1c50a2e..be1c15536be08ecb8d8d1478cb6c232fc71611a4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,19 @@
 /***********************************************************************
  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.
index 6944caa2ab60e604ae9f4acdb7e7f9e1bc9eef8d..63702a658a55460788ea8e81f7d0657e9d251d73 100644 (file)
@@ -75,10 +75,31 @@ static const struct message_entry msgtab[] = {
     { "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 }
 };
index dcfe35db9bde329a491987d549a1ae6c315f9505..25574585690c869dca3203934698307f1e60ef38 100644 (file)
@@ -2216,7 +2216,7 @@ static HELPSERV_FUNC(cmd_move) {
     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);
 
@@ -2231,8 +2231,8 @@ static HELPSERV_FUNC(cmd_move) {
 
         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])) {
@@ -2282,8 +2282,8 @@ static HELPSERV_FUNC(cmd_move) {
         }
         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 {
@@ -2659,7 +2659,7 @@ static struct helpserv_bot *register_helpserv(const char *nick, const char *help
 }
 
 static HELPSERV_FUNC(cmd_register) {
-    char *nick, *helpchan, reason[MAXLEN];
+    char *nick, *helpchan;
     struct handle_info *handle;
 
     REQUIRE_PARMS(4);
@@ -2695,9 +2695,9 @@ static HELPSERV_FUNC(cmd_register) {
 
     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;
 }
 
@@ -2738,8 +2738,7 @@ static void helpserv_unregister(struct helpserv_bot *bot, const char *quit_fmt,
     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) {
@@ -2751,7 +2750,7 @@ 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;
 }
 
@@ -2767,7 +2766,7 @@ static HELPSERV_FUNC(cmd_expire) {
         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);
index 19bb174f3424ccf661e4fcf05234d6b1a345831d..ccd9748dae74c0c97c4cf197891fff939a3dc520 100644 (file)
@@ -1810,7 +1810,7 @@ static NICKSERV_FUNC(cmd_rename_handle)
 {
     struct handle_info *hi;
     struct userNode *uNode;
-    char msgbuf[MAXLEN], *old_handle;
+    char *old_handle;
     unsigned int nn;
 
     NICKSERV_MIN_PARMS(3);
@@ -1835,8 +1835,6 @@ static NICKSERV_FUNC(cmd_rename_handle)
     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)
@@ -1846,7 +1844,9 @@ static NICKSERV_FUNC(cmd_rename_handle)
     }
 
     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;
 }
@@ -3439,7 +3439,6 @@ static NICKSERV_FUNC(cmd_merge)
     struct userNode *last_user;
     struct userData *cList, *cListNext;
     unsigned int ii, jj, n;
-    char buffer[MAXLEN];
 
     NICKSERV_MIN_PARMS(3);
 
@@ -3550,9 +3549,9 @@ static NICKSERV_FUNC(cmd_merge)
         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);
index 3566c9aa5562a5dfd2125c0e25f35e370fd21c34..64982be7034d58050458b6138b447329be21c3fc 100644 (file)
@@ -867,9 +867,7 @@ static MODCMD_FUNC(cmd_warn)
     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;
 }
@@ -2490,9 +2488,7 @@ opserv_channel_check(struct chanNode *newchan)
     }
     /*
     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);
     }
     */
 
index a8e0a8bcbba2b8e8669f082789ea92a1c56e69ca..09079297c94219ec4e16f2db2a0f92c5ef58acfb 100644 (file)
@@ -316,11 +316,14 @@ spamserv_cs_move_merge(struct userNode *user, struct chanNode *channel, struct c
                        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;
        }
 
@@ -334,20 +337,23 @@ spamserv_cs_unregister(struct userNode *user, struct chanNode *channel, enum cs_
 
        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;
                }
@@ -356,7 +362,6 @@ spamserv_cs_unregister(struct userNode *user, struct chanNode *channel, enum cs_
                        spamserv_part_channel(channel, partmsg);
                
                spamserv_unregister_channel(cInfo);
-               global_message(MESSAGE_RECIPIENT_OPERS | MESSAGE_RECIPIENT_HELPERS, global);
        }
 }
 
@@ -1128,7 +1133,6 @@ static
 SPAMSERV_FUNC(cmd_register)
 {
        struct chanInfo *cInfo;
-       char reason[MAXLEN];
 
        if(!channel || !channel->channel_info)
        {
@@ -1162,8 +1166,8 @@ SPAMSERV_FUNC(cmd_register)
 
        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;
@@ -1212,8 +1216,8 @@ SPAMSERV_FUNC(cmd_unregister)
        
        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;