2009-03-28 10:47:22 +00:00
|
|
|
#lang scheme
|
|
|
|
|
|
|
|
;; exmaple chat client
|
|
|
|
|
|
|
|
(require "xmpp.scm")
|
2009-04-06 20:15:28 +00:00
|
|
|
(require openssl)
|
2009-03-28 10:47:22 +00:00
|
|
|
|
|
|
|
(define (read-input prompt)
|
|
|
|
(display prompt)
|
|
|
|
(read-line (current-input-port)))
|
|
|
|
|
|
|
|
(define (chat)
|
|
|
|
(let ((jid (read-input "jid: "))
|
|
|
|
(pass (read-input "password: "))
|
|
|
|
(to (read-input "chat with: ")))
|
|
|
|
(with-xmpp-session jid pass
|
|
|
|
(set-xmpp-handler 'message print-message)
|
|
|
|
(let loop ()
|
|
|
|
(let ((msg (read-line (current-input-port))))
|
|
|
|
(send (message to msg))
|
|
|
|
(loop))))))
|
|
|
|
|
|
|
|
|
|
|
|
|