When this is done, a <code>Session</code> object can be acquired by calling
<code>session</code>. This object will be used for interacting with the library.
@ -44,23 +53,22 @@ The return type of <code>session</code> is <code>IO (Either XmppFailure
@@ -44,23 +53,22 @@ The return type of <code>session</code> is <code>IO (Either XmppFailure
doing it could be doing something like this:
sess <-caseresultof
Right (sess, Nothing) -> sess
Right (_sess, e) -> error "AuthFailure: " ++ (show e)
@ -10,66 +10,25 @@ sending them, using Pontarius XMPP. This file is in the public domain.
@@ -10,66 +10,25 @@ sending them, using Pontarius XMPP. This file is in the public domain.
moduleMainwhere
importControl.Concurrent
importControl.Monad
importData.Default
importData.Maybe(fromJust)
importqualifiedData.TextasText
importText.Printf
importNetwork.Xmpp
importNetwork.Xmpp.IM
-- import System.Log.Formatter
importSystem.Log.Handlerhiding(setLevel)
importSystem.Log.Handler.Simple
importSystem.Log.Logger
-- import Network.Xmpp.IM.Roster
-- Server and authentication details.
realm="species64739.dyndns.org"
username="echo"
password="pwd"
resource=Just"bot"
-- | Automatically accept all subscription requests from other entities
autoAccept::Session->IO()
autoAcceptsession=forever$do
st<-waitForPresenceisPresenceSubscribesession
friend<-casepresenceFromstof
Justfrom->do
sendPresence(presenceSubscribedfrom)session
return$showfrom
Nothing->return"anonymous"-- this shouldn't happen