irc.client: Fix strings>privmsg, add test

db4
Bruno Deferrari 2009-03-07 20:43:25 -02:00
parent 5bfe50018e
commit 527b50fa56
2 changed files with 6 additions and 1 deletions

View File

@ -58,6 +58,11 @@ M: mb-writer dispose drop ;
string>irc-message forward-name ] unit-test
] with-irc
{ privmsg "#channel" "hello" } [
"#channel" "hello" strings>privmsg
[ class ] [ target>> ] [ trailing>> ] tri
] unit-test
! Test login and nickname set
[ { "factorbot2" } [
":some.where 001 factorbot2 :Welcome factorbot2" %push-line

View File

@ -313,7 +313,7 @@ DEFER: (connect-irc)
[ forward-message ] [ process-message ] [ irc-end? not ] tri ;
: strings>privmsg ( name string -- privmsg )
privmsg new [ (>>trailing) ] keep [ (>>target) ] keep ;
" :" prepend append "PRIVMSG " prepend string>irc-message ;
: maybe-annotate-with-name ( name obj -- obj )
{ { [ dup string? ] [ strings>privmsg ] }