From: Jānis Rūcis Date: Tue, 30 Mar 2010 20:18:34 +0000 (+0300) Subject: IRC: factor out message printing X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=e3f6b54d8b2d50d9b1c172443dae0c906dd26a6a;p=xonotic%2Fdarkplaces.git IRC: factor out message printing --- diff --git a/irc.c b/irc.c index d8890793..37f9f0cb 100644 --- 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); } }