summaryrefslogtreecommitdiff
path: root/Presence/ConfigFiles.hs
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2018-06-23 03:45:48 -0400
committerjoe <joe@jerkface.net>2018-06-23 03:45:48 -0400
commitf0e8ad8ff644f1f70cd7020684aca84b71f77539 (patch)
treee28dc43f2b596ef7dc4859d1167fa2f9af5cc4e1 /Presence/ConfigFiles.hs
parentbb01c902dedc5d12d407fdfeaf326751b21d8a4f (diff)
Some documentation about roster files.
Diffstat (limited to 'Presence/ConfigFiles.hs')
-rw-r--r--Presence/ConfigFiles.hs20
1 files changed, 13 insertions, 7 deletions
diff --git a/Presence/ConfigFiles.hs b/Presence/ConfigFiles.hs
index 46d5a01c..27a65bbf 100644
--- a/Presence/ConfigFiles.hs
+++ b/Presence/ConfigFiles.hs
@@ -25,12 +25,18 @@ configDir, buddyFile, subscriberFile,
25 otherFile, pendingFile, solicitedFile, 25 otherFile, pendingFile, solicitedFile,
26 secretsFile :: FilePath 26 secretsFile :: FilePath
27 27
28-- A "buddy" is somebody who approved our friend request and will keep
29-- us informed of their presence.
30--
31-- A "subscriber" is somebody who we approved and promised to keep informed
32-- of our own presence.
33
28configDir = ".presence" 34configDir = ".presence"
29buddyFile = "buddies" 35buddyFile = "buddies" -- subscription="to"
30subscriberFile = "subscribers" 36subscriberFile = "subscribers" -- subscription="from"
37pendingFile = "pending" -- pending subscriber (we've yet to approve)
38solicitedFile = "solicited" -- pending buddy (we sent a friend request)
31otherFile = "others" 39otherFile = "others"
32pendingFile = "pending"
33solicitedFile = "solicited"
34secretsFile = "secret" 40secretsFile = "secret"
35 41
36 42
@@ -86,9 +92,9 @@ modifyFile ::
86 (ByteString,FilePath) 92 (ByteString,FilePath)
87 -> User 93 -> User
88 -> Profile 94 -> Profile
89 -> (ByteString -> IO (Maybe ByteString)) -- Returns Just for each item you want to keep. 95 -> (ByteString -> IO (Maybe ByteString)) -- ^ Returns Just for each item you want to keep.
90 -> Maybe ByteString -- Optionally append this item. 96 -> Maybe ByteString -- ^ Optionally append this item.
91 -> IO Bool -- Returns True if test function ever returned Nothing 97 -> IO Bool -- Returns True if test function ever returned Nothing
92modifyFile (tag,file) user profile test appending = configPath user profile file >>= doit 98modifyFile (tag,file) user profile test appending = configPath user profile file >>= doit
93 where 99 where
94 doit path = do 100 doit path = do