summaryrefslogtreecommitdiff
path: root/Presence
diff options
context:
space:
mode:
authorJoe Crayne <joe@jerkface.net>2018-11-03 09:35:08 -0400
committerJoe Crayne <joe@jerkface.net>2018-11-03 09:37:46 -0400
commit7dfb3adc819be4b3482ec58ccacf8ac55884683c (patch)
tree39285a751ceb8354b6a6151b7488b121242824e7 /Presence
parent41789213767b6422868011543cba1b71014ff166 (diff)
Fix roster bug: allow multiple tox buddies at once.
Diffstat (limited to 'Presence')
-rw-r--r--Presence/Presence.hs10
1 files changed, 4 insertions, 6 deletions
diff --git a/Presence/Presence.hs b/Presence/Presence.hs
index c2398607..cc3f488b 100644
--- a/Presence/Presence.hs
+++ b/Presence/Presence.hs
@@ -1050,7 +1050,7 @@ modifyRosterFile man doit whose profile to addrs bAdd bWildCard = do
1050 let (mu,_,_) = splitJID to 1050 let (mu,_,_) = splitJID to
1051 -- For each jid in the file, this function will decide whether to keep 1051 -- For each jid in the file, this function will decide whether to keep
1052 -- it (possibly modified) which is indicated by Just _ or to remove the 1052 -- it (possibly modified) which is indicated by Just _ or to remove the
1053 -- item from the file which is indicatd by Nothing. 1053 -- item from the file which is indicated by Nothing.
1054 cmp :: L.ByteString -> IO (Maybe L.ByteString) 1054 cmp :: L.ByteString -> IO (Maybe L.ByteString)
1055 cmp jid = do 1055 cmp jid = do
1056 let (msu,stored_h,mr) = splitJID (lazyByteStringToText jid) 1056 let (msu,stored_h,mr) = splitJID (lazyByteStringToText jid)
@@ -1064,11 +1064,9 @@ modifyRosterFile man doit whose profile to addrs bAdd bWildCard = do
1064 _ -> keep 1064 _ -> keep
1065 fmap join $ sequence $ do 1065 fmap join $ sequence $ do
1066 guard $ isNothing mr -- delete if resource specified in file. 1066 guard $ isNothing mr -- delete if resource specified in file.
1067 stored_u <- msu -- delete if user not specified in file. 1067 if mu == msu || bWildCard
1068 case mu of 1068 then Just iocheck -- do not delete unless hostname alias
1069 Nothing | not bWildCard -> Just keep -- do not delete if /to/ has no user field 1069 else Just keep -- do not delete if user field doesn't match.
1070 Just u | u /= stored_u -> Just keep -- do not delete if users don't match
1071 _ -> Just iocheck -- do not delete unless hostname alias
1072 doit (textToLazyByteString whose) (Text.unpack profile) 1070 doit (textToLazyByteString whose) (Text.unpack profile)
1073 cmp 1071 cmp
1074 (guard bAdd >> Just (textToLazyByteString to)) 1072 (guard bAdd >> Just (textToLazyByteString to))