]> jfr.im git - irc/evilnet/x3.git/commitdiff
make chanserv.c use global_message_args
authorsirvulcan <redacted>
Tue, 1 Aug 2006 04:01:29 +0000 (04:01 +0000)
committersirvulcan <redacted>
Tue, 1 Aug 2006 04:01:29 +0000 (04:01 +0000)
ChangeLog
src/chanserv.c
src/global.c

index e1fbae8dde21c2830f966a30f5628b665361b961..17c760956b6404f37a3e09c97148fc05f1c50a2e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,12 @@
 /***********************************************************************
  X3 ChangeLog
 
 /***********************************************************************
  X3 ChangeLog
 
+2006-08-01  Neil Spierling  <sirvulcan@gmail.com>
+
+       * src/chanserv.c: Changed global_message uses to global_message_arg's.
+
+       * src/global.c: Added language strings for chanserv.c
+
 2006-08-01  Neil Spierling  <sirvulcan@gmail.com>
 
        * src/global.c: Make sure we arnt sending duplicate messages in
 2006-08-01  Neil Spierling  <sirvulcan@gmail.com>
 
        * src/global.c: Make sure we arnt sending duplicate messages in
index 6ff9d5fd2ec334c9381374175c7d591174ac4c8e..901230ba17ba0e55bda110c7800768b7697895e6 100644 (file)
@@ -2105,10 +2105,10 @@ static CHANSERV_FUNC(cmd_register)
     if(handle != user->handle_info)
         reply("CSMSG_PROXY_SUCCESS", handle->handle, channel->name);
     else
     if(handle != user->handle_info)
         reply("CSMSG_PROXY_SUCCESS", handle->handle, channel->name);
     else
-        reply("CSMSG_REG_SUCCESS", channel->name);
 
     sprintf(reason, "%s registered to %s by %s.", channel->name, handle->handle, user->handle_info->handle);
 
     sprintf(reason, "%s registered to %s by %s.", channel->name, handle->handle, user->handle_info->handle);
-    global_message(MESSAGE_RECIPIENT_OPERS | MESSAGE_RECIPIENT_HELPERS, reason);
+    global_message_args(MESSAGE_RECIPIENT_OPERS | MESSAGE_RECIPIENT_HELPERS, "CSMSG_REGISTERED_TO", channel->name, 
+                        handle->handle, user->handle_info->handle);
     return 1;
 }
 
     return 1;
 }
 
@@ -2214,7 +2214,6 @@ static CHANSERV_FUNC(cmd_move)
     struct chanNode *target;
     struct modeNode *mn;
     struct userData *uData;
     struct chanNode *target;
     struct modeNode *mn;
     struct userData *uData;
-    char reason[MAXLEN];
     struct do_not_register *dnr;
     int chanserv_join = 0, spamserv_join;
 
     struct do_not_register *dnr;
     int chanserv_join = 0, spamserv_join;
 
@@ -2297,16 +2296,18 @@ static CHANSERV_FUNC(cmd_move)
     if (chanserv_join)
         ss_cs_join_channel(target, spamserv_join);
 
     if (chanserv_join)
         ss_cs_join_channel(target, spamserv_join);
 
-    sprintf(reason, "%s moved to %s by %s.", channel->name, target->name, user->handle_info->handle);
     if(!IsSuspended(target->channel_info))
     {
         char reason2[MAXLEN];
     if(!IsSuspended(target->channel_info))
     {
         char reason2[MAXLEN];
-       sprintf(reason2, "Channel moved to %s by %s.", target->name, user->handle_info->handle);
-       DelChannelUser(chanserv, channel, reason2, 0);
+        sprintf(reason2, "Channel moved to %s by %s.", target->name, user->handle_info->handle);
+        DelChannelUser(chanserv, channel, reason2, 0);
     }
     }
+
     UnlockChannel(channel);
     LockChannel(target);
     UnlockChannel(channel);
     LockChannel(target);
-    global_message(MESSAGE_RECIPIENT_OPERS | MESSAGE_RECIPIENT_HELPERS, reason);
+    global_message_args(MESSAGE_RECIPIENT_OPERS | MESSAGE_RECIPIENT_HELPERS, "CSMSG_CHANNEL_MOVED",
+                        channel->name, target->name, user->handle_info->handle);
+
     reply("CSMSG_MOVE_SUCCESS", target->name);
     return 1;
 }
     reply("CSMSG_MOVE_SUCCESS", target->name);
     return 1;
 }
@@ -5401,8 +5402,9 @@ static CHANSERV_FUNC(cmd_csuspend)
         suspended->previous->revoked = now;
         if(suspended->previous->expires)
             timeq_del(suspended->previous->expires, chanserv_expire_suspension, suspended->previous, 0);
         suspended->previous->revoked = now;
         if(suspended->previous->expires)
             timeq_del(suspended->previous->expires, chanserv_expire_suspension, suspended->previous, 0);
-        sprintf(reason, "%s suspension modified by %s.", channel->name, suspended->suspender);
-        global_message(MESSAGE_RECIPIENT_OPERS | MESSAGE_RECIPIENT_HELPERS, reason);
+
+        global_message_args(MESSAGE_RECIPIENT_OPERS | MESSAGE_RECIPIENT_HELPERS, "CSMSG_SUSPENSION_MODIFIED",
+                            channel->name, suspended->suspender);
     }
     else
     {
     }
     else
     {
@@ -5421,8 +5423,8 @@ static CHANSERV_FUNC(cmd_csuspend)
         spamserv_cs_suspend(channel, expiry, 1, suspended->reason);
         DelChannelUser(chanserv, channel, suspended->reason, 0);
         reply("CSMSG_SUSPENDED", channel->name);
         spamserv_cs_suspend(channel, expiry, 1, suspended->reason);
         DelChannelUser(chanserv, channel, suspended->reason, 0);
         reply("CSMSG_SUSPENDED", channel->name);
-        sprintf(reason, "%s suspended by %s.", channel->name, suspended->suspender);
-        global_message(MESSAGE_RECIPIENT_OPERS | MESSAGE_RECIPIENT_HELPERS, reason);
+        global_message_args(MESSAGE_RECIPIENT_OPERS | MESSAGE_RECIPIENT_HELPERS, "CSMSG_SUSPENDED_BY",
+                            channel->name, suspended->suspender);
     }
     return 1;
 }
     }
     return 1;
 }
@@ -5430,7 +5432,6 @@ static CHANSERV_FUNC(cmd_csuspend)
 static CHANSERV_FUNC(cmd_cunsuspend)
 {
     struct suspended *suspended;
 static CHANSERV_FUNC(cmd_cunsuspend)
 {
     struct suspended *suspended;
-    char message[MAXLEN];
 
     if(!IsSuspended(channel->channel_info))
     {
 
     if(!IsSuspended(channel->channel_info))
     {
@@ -5444,8 +5445,8 @@ static CHANSERV_FUNC(cmd_cunsuspend)
     timeq_del(suspended->expires, chanserv_expire_suspension, suspended, 0);
     chanserv_expire_suspension(suspended);
     reply("CSMSG_UNSUSPENDED", channel->name);
     timeq_del(suspended->expires, chanserv_expire_suspension, suspended, 0);
     chanserv_expire_suspension(suspended);
     reply("CSMSG_UNSUSPENDED", channel->name);
-    sprintf(message, "%s unsuspended by %s.", channel->name, user->handle_info->handle);
-    global_message(MESSAGE_RECIPIENT_OPERS|MESSAGE_RECIPIENT_HELPERS, message);
+    global_message_args(MESSAGE_RECIPIENT_OPERS|MESSAGE_RECIPIENT_HELPERS, "CSMSG_UNSUSPENDED_BY",
+                        channel->name, user->handle_info->handle);
     return 1;
 }
 
     return 1;
 }
 
@@ -6349,7 +6350,7 @@ static CHANSERV_FUNC(cmd_giveownership)
     struct giveownership *giveownership;
     unsigned int force, override;
     unsigned short co_access, new_owner_old_access;
     struct giveownership *giveownership;
     unsigned int force, override;
     unsigned short co_access, new_owner_old_access;
-    char reason[MAXLEN], transfer_reason[MAXLEN];
+    char transfer_reason[MAXLEN];
 
     REQUIRE_PARAMS(2);
     curr_user = GetChannelAccess(cData, user->handle_info);
 
     REQUIRE_PARAMS(2);
     curr_user = GetChannelAccess(cData, user->handle_info);
@@ -6449,8 +6450,8 @@ static CHANSERV_FUNC(cmd_giveownership)
     channel->channel_info->giveownership = giveownership;
 
     reply("CSMSG_OWNERSHIP_GIVEN", channel->name, new_owner_hi->handle);
     channel->channel_info->giveownership = giveownership;
 
     reply("CSMSG_OWNERSHIP_GIVEN", channel->name, new_owner_hi->handle);
-    sprintf(reason, "%s ownership transferred to %s by %s.", channel->name, new_owner_hi->handle, user->handle_info->handle);
-    global_message(MESSAGE_RECIPIENT_OPERS | MESSAGE_RECIPIENT_HELPERS, reason);
+    global_message_args(MESSAGE_RECIPIENT_OPERS | MESSAGE_RECIPIENT_HELPERS, "CSMSG_OWNERSHIP_TRANSFERRED",
+                       channel->name, new_owner_hi->handle, user->handle_info->handle);
     return 1;
 }
 
     return 1;
 }
 
index cc05870e8d0c84a3e9f32472a8ca04390706f632..6944caa2ab60e604ae9f4acdb7e7f9e1bc9eef8d 100644 (file)
@@ -67,9 +67,18 @@ static const struct message_entry msgtab[] = {
   * notices. Make sure you grep for them if you ever add args
   * to the notice.
   */
   * notices. Make sure you grep for them if you ever add args
   * to the notice.
   */
-    { "DEFCON_NETWORK_CHANGED", "Network DefCon level has changed to level %d" }, /* opserv.c */
-    { "DEFCON_OPER_LEVEL_CHANGE", "%s is changing the DefCon level to %d" }, /* opserv.c */
-    { "DEFCON_TIMEOUT_LEVEL_CHANGE", "The DefCon has changed back to level %d (timeout)" }, /* opserv.c */
+    /* chanserv.c */
+    { "CSMSG_REGISTERED_TO", "%s registered to %s by %s." },
+    { "CSMSG_CHANNEL_MOVED", "%s moved to %s by %s." },
+    { "CSMSG_SUSPENSION_MODIFIED", "%s suspension modified by %s." },
+    { "CSMSG_SUSPENDED_BY", "%s suspended by %s." },
+    { "CSMSG_UNSUSPENDED_BY", "%s unsuspended by %s." },
+    { "CSMSG_OWNERSHIP_TRANSFERRED", "%s ownership transferred to %s by %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)" },
 
     { NULL, NULL }
 };
 
     { NULL, NULL }
 };