X-Git-Url: https://git.martlubbers.net/?p=cloogle-irc.git;a=blobdiff_plain;f=IRC.icl;h=645edbd2b64f0a51ce95fd2ff0a0e5bf5cc89a59;hp=9b6b1342214e910ca5c288c9a0eeb4b8de14036c;hb=ddf4cad21f9bd05a526d0440c1612798baa88b71;hpb=a8fbb81c3108a913c6496553346037805157b9c0 diff --git a/IRC.icl b/IRC.icl index 9b6b134..645edbd 100644 --- a/IRC.icl +++ b/IRC.icl @@ -1,5 +1,6 @@ implementation module IRC +import StdList import GenPrint import StdOverloaded import Data.Maybe @@ -21,8 +22,8 @@ instance toString IRCCommands where //INFO (Maybe String) //INVITE String String //ISON [String] - JOIN chs = "JOIN " +++ either (const "0") - (\c->join ", " [join " " [ch:maybeToList mkey]\\(ch, mkey)<-c]) chs + JOIN chs = "JOIN " +++ (if (isEmpty chs) "0" + (join ", " [join " " [ch:maybeToList mk]\\(ch, mk)<-chs])) //KICK String String (Maybe String) //KILL String String //LINKS (Maybe (Maybe String, String)) @@ -39,7 +40,7 @@ instance toString IRCCommands where //PASS String //PING [String] //PONG [String] - PRIVMSG dest msg = join " " ["PRIVMSG", dest, msg] + PRIVMSG dest msg = join " " ["PRIVMSG", dest, ":"+++msg] QUIT msg = join " " ["QUIT":maybeToList msg] //REHASH //RESTART @@ -54,7 +55,7 @@ instance toString IRCCommands where //TIME (Maybe String) //TOPIC String (Maybe String) //TRACE (Maybe String) - USER login mode rn = join " " ["USER", login, toString mode, "*", ":", rn] + USER login mode rn = join " " ["USER", login, toString mode, "*", ":"+++rn] //USERHOST [String] //USERS (Maybe String) //VERSION (Maybe String)