]> gitweb.factorcode.org Git - factor.git/commitdiff
irc.client: Make to-chat work with sequences
authorBruno Deferrari <utizoc@gmail.com>
Fri, 20 Mar 2009 13:15:13 +0000 (10:15 -0300)
committerBruno Deferrari <utizoc@gmail.com>
Thu, 9 Apr 2009 02:13:17 +0000 (23:13 -0300)
extra/irc/client/client.factor

index c7e90eb802ebe8c72e9d29e91755986259effe95..ee46cd954a9907a7023b3ea1121233f0cd29e1c7 100755 (executable)
@@ -104,6 +104,7 @@ M: string to-chat
     [ to-chat ] [ drop ] if* ;
 
 M: irc-chat to-chat in-messages>> mailbox-put ;
+M: sequence to-chat [ to-chat ] with each ;
 
 : unregister-chat ( name -- )
     irc> chats>>
@@ -123,9 +124,6 @@ M: irc-chat to-chat in-messages>> mailbox-put ;
     [ dup irc-channel-chat? [ participants>> key? ] [ 2drop f ] if ]
     with filter ;
 
-: to-chats-with-participant ( message nickname -- )
-    chats-with-participant [ to-chat ] with each ;
-
 : remove-participant-from-all ( nick -- )
     dup chats-with-participant [ (remove-participant) ] with each ;
 
@@ -199,7 +197,7 @@ M: irc-message forward-message
 M: single-forward forward-message dup forward-name to-chat ;
 
 M: multiple-forward forward-message
-    dup sender>> to-chats-with-participant ;
+    dup sender>> chats-with-participant to-chat ;
   
 M: broadcast-forward forward-message
     irc> chats>> values [ to-chat ] with each ;