summaryrefslogtreecommitdiff
path: root/Presence/ConfigFiles.hs
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2013-06-20 18:50:18 -0400
committerjoe <joe@jerkface.net>2013-06-20 18:50:18 -0400
commitfa6a523704984bd98762a4e639b739e73320068f (patch)
treeca7d30d7b37e2c97368fa2ff14e2c5116b03c4ca /Presence/ConfigFiles.hs
parent2e72fc27f26fc75cd236701b220f4e2bfaf686c1 (diff)
Work toward sending outgoing messages to remote peers
Diffstat (limited to 'Presence/ConfigFiles.hs')
-rw-r--r--Presence/ConfigFiles.hs10
1 files changed, 6 insertions, 4 deletions
diff --git a/Presence/ConfigFiles.hs b/Presence/ConfigFiles.hs
index ee0d5b85..f0e18f70 100644
--- a/Presence/ConfigFiles.hs
+++ b/Presence/ConfigFiles.hs
@@ -54,10 +54,12 @@ addSubscriber :: User -> ByteString -> IO ()
54addSubscriber user subscriber = 54addSubscriber user subscriber =
55 subscriberPath user >>= addItem subscriber "<? subscribers ?>" 55 subscriberPath user >>= addItem subscriber "<? subscribers ?>"
56 56
57getConfigList path = withFile path ReadMode $ 57getConfigList path =
58 L.hGetContents 58 handle (\e -> if isDoesNotExistError e then (return []) else throw e)
59 >=> return . Prelude.tail . L.lines 59 $ withFile path ReadMode $
60 >=> (\a -> seq (rnf a) (return a)) 60 L.hGetContents
61 >=> return . Prelude.tail . L.lines
62 >=> (\a -> seq (rnf a) (return a))
61 63
62getBuddies :: User -> IO [ByteString] 64getBuddies :: User -> IO [ByteString]
63getBuddies user = buddyPath user >>= getConfigList 65getBuddies user = buddyPath user >>= getConfigList