]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
IRC: add some readable console output
authorJānis Rūcis <parasti@gmail.com>
Thu, 1 Apr 2010 20:01:35 +0000 (23:01 +0300)
committerJānis Rūcis <parasti@gmail.com>
Sun, 27 Jun 2010 12:23:21 +0000 (15:23 +0300)
irc.c

diff --git a/irc.c b/irc.c
index 64cda92bb810cce768f583a32b23ec09b190668a..a4751e5735c487344816728224256109f6ee856a 100644 (file)
--- a/irc.c
+++ b/irc.c
@@ -239,13 +239,24 @@ static void IRC_ProcessMessage(const char *line)
                                        irc_registered = true;
                                        break;
                        }
+
+                       if (msg->args_num > 0)
+                               Con_Printf("[IRC] %s: %s\n", msg->prefix, msg->args[msg->args_num - 1]);
                }
                else if (strcmp("NICK", msg->command) == 0)
                {
                        size_t orig_len = strcspn(msg->prefix, "!");
 
                        if (strlen(irc_nickname.string) == orig_len && strncmp(irc_nickname.string, msg->prefix, orig_len) == 0)
+                       {
                                Cvar_SetQuick(&irc_nickname, msg->args[0]);
+                               Con_Printf("[IRC] You are now known as %s\n", irc_nickname.string);
+                       }
+                       else
+                       {
+                               /* Print only the nickname part of the prefix. */
+                               Con_Printf("[IRC] %.*s is now known as %s\n", (int) orig_len, msg->prefix, msg->args[0]);
+                       }
                }
 
                IRC_DumpMessage(msg);