Merge commit 'origin/master' into emacs

db4
Jose A. Ortega Ruiz 2009-06-02 00:06:29 +02:00
commit 91554bbbc7
2 changed files with 18 additions and 1 deletions

View File

@ -85,6 +85,18 @@ M: mb-writer dispose drop ;
] with-irc
] unit-test
! Test connect with password
{ V{ "PASS password" "NICK factorbot" "USER factorbot hostname servername :irc.factor" } } [
"someserver" irc-port "factorbot" "password" <irc-profile> <irc-client>
[ 2drop <test-stream> ] >>connect
[
(connect-irc)
(do-login)
irc> stream>> out>> lines>>
(terminate-irc)
] with-irc
] unit-test
! Test join
[ { "JOIN #factortest" } [
"#factortest" %join %pop-output-line

View File

@ -16,6 +16,7 @@ IN: irc.client.internals
: /NICK ( nick -- ) "NICK " prepend irc-print ;
: /PONG ( text -- ) "PONG " prepend irc-print ;
: /PASS ( password -- ) "PASS " prepend irc-print ;
: /LOGIN ( nick -- )
dup /NICK
@ -44,7 +45,11 @@ IN: irc.client.internals
in-messages>> [ irc-connected ] dip mailbox-put
] [ (terminate-irc) ] if* ;
: (do-login) ( -- ) irc> nick>> /LOGIN ;
: (do-login) ( -- )
irc>
[ profile>> password>> [ /PASS ] when* ]
[ nick>> /LOGIN ]
bi ;
GENERIC: initialize-chat ( chat -- )
M: irc-chat initialize-chat drop ;