|
|
|
|
@ -224,12 +224,6 @@ modifyHandlers f = do
@@ -224,12 +224,6 @@ modifyHandlers f = do
|
|
|
|
|
eh <- asks eventHandlers |
|
|
|
|
liftIO . atomically $ writeTVar eh . f =<< readTVar eh |
|
|
|
|
|
|
|
|
|
-- | Sets the handler to be executed when the session ends. |
|
|
|
|
setSessionEndHandler :: Xmpp () -> Xmpp () |
|
|
|
|
setSessionEndHandler eh = do |
|
|
|
|
r <- ask |
|
|
|
|
modifyHandlers (\s -> s{sessionEndHandler = runReaderT eh r}) |
|
|
|
|
|
|
|
|
|
-- | Sets the handler to be executed when the server connection is closed. |
|
|
|
|
setConnectionClosedHandler :: (StreamError -> Xmpp ()) -> Xmpp () |
|
|
|
|
setConnectionClosedHandler eh = do |
|
|
|
|
@ -247,7 +241,6 @@ endSession :: Xmpp ()
@@ -247,7 +241,6 @@ endSession :: Xmpp ()
|
|
|
|
|
endSession = do -- TODO: This has to be idempotent (is it?) |
|
|
|
|
void $ withConnection xmppKillConnection |
|
|
|
|
liftIO =<< asks stopThreads |
|
|
|
|
runHandler sessionEndHandler |
|
|
|
|
|
|
|
|
|
-- | Close the connection to the server. |
|
|
|
|
closeConnection :: Xmpp () |
|
|
|
|
|