--- a/src/main.c
+++ b/src/main.c
@@ -90,6 +90,7 @@
if (uc.channel) {
fprintf (message.stream, "JOIN :%s\r\n", uc.channel);
+ message.current_channel = uc.channel;
if (uc.topic)
fprintf (message.stream, "TOPIC %s :%s\r\n", uc.channel, uc.topic);
}
@@ -101,6 +102,8 @@
if ((command = irc_parsemessage (buf, &message))) {
printf ("%10s %s %s\n", command, message.channel, message.line);
+ if (!strcmp (command, "ERROR"))
+ break;
} else {
if ((msg = parse (&message)) != NULL) {
fprintf (message.stream, "%s\r\n", msg);