]> gitweb.factorcode.org Git - factor.git/commitdiff
Merge branch 'master' of git://factorcode.org/git/factor
authorBruno Deferrari <utizoc@gmail.com>
Sat, 25 Oct 2008 22:43:02 +0000 (20:43 -0200)
committerBruno Deferrari <utizoc@gmail.com>
Sat, 25 Oct 2008 22:43:02 +0000 (20:43 -0200)
1  2 
extra/irc/client/client.factor

index d11823b344d251a37708e61b265c91816cec4721,ce7a6e5373095bd38779be5b77445e76dd99b678..d24d0c615f6d44cf3d157583495060647ad22a24
@@@ -19,9 -19,16 +19,16 @@@ C: <irc-profile> irc-profil
  
  TUPLE: irc-client profile stream in-messages out-messages
         chats is-running nick connect reconnect-time is-ready ;
  : <irc-client> ( profile -- irc-client )
-     [ f <mailbox> <mailbox> H{ } clone f ] keep nickname>>
-     [ <inet> latin1 <client> ] 15 seconds f irc-client boa ;
+     irc-client new
+         swap >>profile
+         <mailbox> >>in-messages
+         <mailbox> >>out-messages
+         H{ } clone >>chats
+         dup profile>> nickname>> >>nick
+         [ <inet> latin1 <client> ] >>connect
+         15 seconds >>reconnect-time ;
  
  TUPLE: irc-chat in-messages client ;
  TUPLE: irc-server-chat < irc-chat ;
@@@ -141,9 -148,7 +148,9 @@@ M: irc-chat to-chat in-messages>> mailb
  : change-participant-mode ( channel mode nick -- )
      rot chat>
      [ participants>> set-at ]
 -    [ [ [ +mode+ ] dip <participant-changed> ] dip to-chat ] 3bi ; ! FIXME
 +    [ [ participant-changed new
 +        [ (>>nick) ] [ (>>parameter) ] [ +mode+ >>action ] tri ] dip to-chat ]
 +    3bi ; ! FIXME
  
  DEFER: me?
  
@@@ -226,11 -231,11 +233,11 @@@ M: quit process-messag
  M: nick process-message
      [ irc-message-sender ] [ trailing>> ] bi rename-participant-in-all ;
  
 -M: mode process-message ( mode -- )
 -!    [ channel-mode? ] keep and [
 -!        [ name>> ] [ mode>> ] [ parameter>> ] tri
 -!        [ change-participant-mode ] [ 2drop ] if*
 -!    ] when* ;
 +M: mode process-message ( mode -- )
 +    [ channel-mode? ] keep and [
 +        [ name>> ] [ mode>> ] [ parameter>> ] tri
 +        [ change-participant-mode ] [ 2drop ] if*
 +    ] when* ;
  
  : >nick/mode ( string -- nick mode )
      dup first "+@" member? [ unclip ] [ 0 ] if participant-mode ;
@@@ -357,7 -362,7 +364,7 @@@ PRIVATE
  
  : attach-chat ( irc-chat irc-client -- ) [ (attach-chat) ] with-irc-client ;
  
- : dettach-chat ( irc-chat -- )
+ : detach-chat ( irc-chat -- )
      [ client>> ] keep '[ _ (remove-chat) ] with-irc-client ;
  
  : speak ( message irc-chat -- )