From: Jānis Rūcis Date: Thu, 1 Apr 2010 20:01:35 +0000 (+0300) Subject: IRC: add some readable console output X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=85306da6ed16fd274ac507fce7c768cf288db840;p=xonotic%2Fdarkplaces.git IRC: add some readable console output --- 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);