diff options
Diffstat (limited to 'Presence')
-rw-r--r-- | Presence/ConsoleWriter.hs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Presence/ConsoleWriter.hs b/Presence/ConsoleWriter.hs new file mode 100644 index 00000000..58474da2 --- /dev/null +++ b/Presence/ConsoleWriter.hs | |||
@@ -0,0 +1,22 @@ | |||
1 | module ConsoleWriter where | ||
2 | |||
3 | import XMPPServer ( Stanza ) | ||
4 | import Control.Concurrent.STM | ||
5 | |||
6 | data ConsoleWriter = ConsoleWriter { cwPresenceChan :: TChan Stanza } | ||
7 | |||
8 | newConsoleWriter :: IO ConsoleWriter | ||
9 | newConsoleWriter = do | ||
10 | chan <- atomically newBroadcastTChan | ||
11 | return ConsoleWriter { cwPresenceChan = chan } | ||
12 | |||
13 | writeActiveTTY :: ConsoleWriter -> Stanza -> IO Bool | ||
14 | writeActiveTTY cw msg = do | ||
15 | -- TODO: deliver to active console if not x | ||
16 | -- TODO: deliver to active x (notify-send of libnotify package) | ||
17 | -- chpst seems neccessary for notify-send to work | ||
18 | return False -- return True if a message was delivered | ||
19 | |||
20 | writeAllPty :: ConsoleWriter -> Stanza -> IO Bool | ||
21 | writeAllPty cw msg = do | ||
22 | return False -- return True if a message was delivered | ||