From 85306da6ed16fd274ac507fce7c768cf288db840 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C4=81nis=20R=C5=ABcis?= Date: Thu, 1 Apr 2010 23:01:35 +0300 Subject: [PATCH] IRC: add some readable console output --- irc.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/irc.c b/irc.c index 64cda92b..a4751e57 100644 --- 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); -- 2.39.2