summaryrefslogtreecommitdiff
path: root/Presence/main.hs
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2013-06-17 01:18:37 -0400
committerjoe <joe@jerkface.net>2013-06-17 01:18:37 -0400
commit87c5c2ae4fb60b58dcfb172c5e9b44151b02d777 (patch)
tree4fd16ee881ce7360be3f01b729acb07f275d7526 /Presence/main.hs
parent1f679837dcc881b4de211d55234ad793815ed26b (diff)
XMPPSession class
Diffstat (limited to 'Presence/main.hs')
-rw-r--r--Presence/main.hs15
1 files changed, 13 insertions, 2 deletions
diff --git a/Presence/main.hs b/Presence/main.hs
index 7df81903..63ebf817 100644
--- a/Presence/main.hs
+++ b/Presence/main.hs
@@ -1,4 +1,6 @@
1{-# LANGUAGE CPP #-} 1{-# LANGUAGE CPP #-}
2{-# LANGUAGE OverloadedStrings #-}
3{-# LANGUAGE TypeFamilies #-}
2 4
3import System.Directory 5import System.Directory
4import Control.Monad 6import Control.Monad
@@ -35,6 +37,15 @@ utmp_event e = do
35 forM_ ids putStrLn 37 forM_ ids putStrLn
36#endif 38#endif
37 39
40data UnixSession = UnixSession
41
42instance XMPPSession UnixSession where
43 data XMPPClass UnixSession = UnixSessions
44 newSession _ sock handle = return UnixSession
45 setResource _ resource = return ()
46 getJID _ = return "nobody@fake.bad"
47 closeSession _ = return ()
48
38on_chvt vtnum = do 49on_chvt vtnum = do
39 putStrLn $ "changed vt to "++ show vtnum 50 putStrLn $ "changed vt to "++ show vtnum
40 51
@@ -55,7 +66,7 @@ start = do
55 print wd 66 print wd
56#endif 67#endif
57 mtty <- monitorTTY on_chvt 68 mtty <- monitorTTY on_chvt
58 sock <- listenForXmppClients 5222 HNil 69 sock <- listenForXmppClients UnixSessions 5222 HNil
59 putStrLn "Hit enter to terminate..." 70 putStrLn "Hit enter to terminate..."
60 getLine 71 getLine
61 {- 72 {-