 TUPLE: nick-in-use < irc-message asterisk name ;
 TUPLE: notice < irc-message type ;
 TUPLE: mode < irc-message channel mode ;
-TUPLE: names-reply < irc-message who = channel ;
+TUPLE: names-reply < irc-message who channel ;
 TUPLE: unhandled < irc-message ;
 
 : <irc-client-message> ( command parameters trailing -- irc-message )

: split-trailing ( string -- string string/f )
    ":" split1 ;

PRIVATE>

UNION: sender-in-prefix privmsg join part quit kick mode nick ;

: parse-irc-line ( string -- message )
    string>irc-message
    dup command>> {
        { "PING" [ ping new ] }
        { "NOTICE" [ notice new ] }
        { "001" [ logged-in new ] }
        { "433" [ nick-in-use new ] }
        { "353" [ names-reply new ] }
        { "JOIN" [ join new ] }
        { "PART" [ part new ] }
        { "NICK" [ nick new ] }
        { "PRIVMSG" [ privmsg new ] }
        { "QUIT" [ quit new ] }
        { "MODE" [ mode new ] }
        { "KICK" [ kick new ] }
        [ drop unhandled new ]
    } case
    [ copy-contents ] keep ;
