diff options
Diffstat (limited to 'Presence/main.hs')
-rw-r--r-- | Presence/main.hs | 15 |
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 | ||
3 | import System.Directory | 5 | import System.Directory |
4 | import Control.Monad | 6 | import Control.Monad |
@@ -35,6 +37,15 @@ utmp_event e = do | |||
35 | forM_ ids putStrLn | 37 | forM_ ids putStrLn |
36 | #endif | 38 | #endif |
37 | 39 | ||
40 | data UnixSession = UnixSession | ||
41 | |||
42 | instance 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 | |||
38 | on_chvt vtnum = do | 49 | on_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 | {- |