summaryrefslogtreecommitdiff
path: root/Presence
diff options
context:
space:
mode:
Diffstat (limited to 'Presence')
-rw-r--r--Presence/ConsoleWriter.hs22
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 @@
1module ConsoleWriter where
2
3import XMPPServer ( Stanza )
4import Control.Concurrent.STM
5
6data ConsoleWriter = ConsoleWriter { cwPresenceChan :: TChan Stanza }
7
8newConsoleWriter :: IO ConsoleWriter
9newConsoleWriter = do
10 chan <- atomically newBroadcastTChan
11 return ConsoleWriter { cwPresenceChan = chan }
12
13writeActiveTTY :: ConsoleWriter -> Stanza -> IO Bool
14writeActiveTTY 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
20writeAllPty :: ConsoleWriter -> Stanza -> IO Bool
21writeAllPty cw msg = do
22 return False -- return True if a message was delivered