]> gitweb.factorcode.org Git - factor.git/blobdiff - extra/irc/client/internals/internals.factor
factor: trim using lists
[factor.git] / extra / irc / client / internals / internals.factor
index f2030e87b018bab93d3c9059668ee4638e8eaa84..03632f41f5892f315765969f22f17f0c2017f212 100644 (file)
@@ -1,10 +1,10 @@
 ! Copyright (C) 2009 Bruno Deferrari
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors assocs arrays concurrency.mailboxes continuations destructors
-hashtables io irc.client.base irc.client.chats irc.messages kernel namespaces
-strings words.symbol irc.messages.base irc.client.participants fry threads
-combinators irc.messages.parser math ;
-EXCLUDE: sequences => join ;
+USING: accessors arrays assocs combinators concurrency.mailboxes
+continuations destructors io irc.client.base irc.client.chats
+irc.client.participants irc.messages irc.messages.base
+irc.messages.parser kernel math sequences strings threads
+words.symbol ;
 IN: irc.client.internals
 
 : do-connect ( server port quot: ( host port -- stream ) attempts -- stream/f )
@@ -12,7 +12,7 @@ IN: irc.client.internals
         [ drop call( host port -- stream ) ]
         [ drop 15 sleep 1 - do-connect ]
         recover
-    ] [ 2drop 2drop f ] if ;
+    ] [ 4drop f ] if ;
 
 : /NICK ( nick -- ) "NICK " prepend irc-print ;
 : /PONG ( text -- ) "PONG " prepend irc-print ;
@@ -76,7 +76,9 @@ GENERIC: process-message ( irc-message -- )
 M: object process-message drop ;
 M: ping   process-message trailing>> /PONG ;
 ! FIXME: it shouldn't be checking for the presence of chat here...
-M: join   process-message [ sender>> ] [ chat> ] bi [ join-participant ] [ drop ] if* ;
+M: irc.messages:join
+    process-message [ sender>> ] [ chat> ] bi
+    [ join-participant ] [ drop ] if* ;
 M: part   process-message [ sender>> ] [ chat> ] bi [ part-participant ] [ drop ] if* ;
 M: quit   process-message sender>> quit-participant ;
 M: nick   process-message [ trailing>> ] [ sender>> ] bi rename-participant* ;
@@ -165,7 +167,7 @@ M: irc-chat (attach-chat)
     2bi ;
 
 M: irc-server-chat (attach-chat)
-    irc> [ (>>client) ] [ chats>> +server-chat+ set-at ] 2bi ;
+    irc> [ client<< ] [ chats>> +server-chat+ set-at ] 2bi ;
 
 GENERIC: remove-chat ( irc-chat -- )
 M: irc-nick-chat remove-chat name>> unregister-chat ;