]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
IRC: factor out message printing
authorJānis Rūcis <parasti@gmail.com>
Tue, 30 Mar 2010 20:18:34 +0000 (23:18 +0300)
committerJānis Rūcis <parasti@gmail.com>
Sun, 27 Jun 2010 12:23:20 +0000 (15:23 +0300)
irc.c

diff --git a/irc.c b/irc.c
index d889079374b6a6d635cf90951f51875212056c67..37f9f0cbe2e61badd74ad8a69ca4373fb111304c 100644 (file)
--- a/irc.c
+++ b/irc.c
@@ -239,20 +239,24 @@ static ircmessage_t *IRC_ParseMessage(const char *line)
        return msg;
 }
 
+static void IRC_DumpMessage(const ircmessage_t *msg)
+{
+       int i;
+
+       Con_Printf("[IRC] prefix : %s\n", msg->prefix ? msg->prefix : "");
+       Con_Printf("[IRC] command: %s\n", msg->command);
+
+       for (i = 0; i < msg->args_num; i++)
+               Con_Printf("[IRC] arg %-3d: %s\n", i, msg->args[i]);
+}
+
 static void IRC_ProcessMessage(const char *line)
 {
        ircmessage_t *msg;
 
        if ((msg = IRC_ParseMessage(line)))
        {
-               int i;
-
-               Con_Printf("[IRC] prefix : %s\n", msg->prefix ? msg->prefix : "");
-               Con_Printf("[IRC] command: %s\n", msg->command);
-
-               for (i = 0; i < msg->args_num; i++)
-                       Con_Printf("[IRC] arg %-3d: %s\n", i, msg->args[i]);
-
+               IRC_DumpMessage(msg);
                IRC_FreeMessage(msg);
        }
 }