diff --git a/extra/irc/ui/commandparser/commandparser.factor b/extra/irc/ui/commandparser/commandparser.factor index 7a048c13b1..2835023c0d 100755 --- a/extra/irc/ui/commandparser/commandparser.factor +++ b/extra/irc/ui/commandparser/commandparser.factor @@ -1,16 +1,17 @@ ! Copyright (C) 2008 William Schlieper ! See http://factorcode.org/license.txt for BSD license. -USING: kernel vocabs.loader sequences strings irc.messages ; +USING: kernel vocabs.loader sequences strings splitting words irc.messages ; IN: irc.ui.commandparser "irc.ui.commands" require -: command ( string -- command ) +: command ( string string -- string command ) dup empty? [ drop "say" ] when dup "irc.ui.commands" lookup - [ "quote" "irc.ui.commands" lookup ] unless* ; + [ nip ] + [ " " append prepend "quote" "irc.ui.commands" lookup ] if* ; : parse-message ( string -- ) - "/" head? [ " " split1 swap command execute ] when ; + "/" ?head [ " " split1 swap command ] [ "say" command ] if execute ; diff --git a/extra/irc/ui/commands/commands.factor b/extra/irc/ui/commands/commands.factor index 9f062f7d11..59f4526d23 100755 --- a/extra/irc/ui/commands/commands.factor +++ b/extra/irc/ui/commands/commands.factor @@ -1,7 +1,7 @@ ! Copyright (C) 2008 William Schlieper ! See http://factorcode.org/license.txt for BSD license. -USING: kernel irc.client irc.messages irc.ui +USING: accessors kernel irc.client irc.messages irc.ui namespaces ; IN: irc.ui.commands diff --git a/extra/irc/ui/ui.factor b/extra/irc/ui/ui.factor index dba3f2255c..2266c51f41 100755 --- a/extra/irc/ui/ui.factor +++ b/extra/irc/ui/ui.factor @@ -95,10 +95,10 @@ M: irc-message write-irc TUPLE: irc-editor < editor outstream listener client ; -: ( pane listener client -- editor ) - [ irc-editor new-editor +: ( page pane listener -- client editor ) + irc-editor new-editor swap >>listener swap >>outstream - ] dip >>client ; + over client>> >>client ; : editor-send ( irc-editor -- ) { [ outstream>> ] @@ -117,10 +117,9 @@ TUPLE: irc-page < frame listener client ; : ( listener client -- irc-page ) irc-page new-frame - [ g swap client>> >>client swap [ swap (>>listener) ] keep - [ [ g @center grid-add ] keep ] - [ g client>> g @bottom grid-add ] bi - g ] with-gadget ; + swap client>> >>client swap [ >>listener ] keep + [ [ @center grid-add* ] keep ] + [ @bottom grid-add* ] bi ; M: irc-page graft* [ listener>> ] [ client>> ] bi