summaryrefslogtreecommitdiff
path: root/Presence
diff options
context:
space:
mode:
authorJoe Crayne <joe@jerkface.net>2018-09-09 20:39:46 -0400
committerJoe Crayne <joe@jerkface.net>2018-10-03 07:00:51 -0400
commitca7517ff180f61ce03831c5b4348860d8ca39d97 (patch)
treeac52c244872227ddedf06f30b1866189352d9885 /Presence
parent38505a54b28492ad303cad66f07591df3abf2a4d (diff)
Untested tox: Update buddies/subscribers on established connection.
Diffstat (limited to 'Presence')
-rw-r--r--Presence/Presence.hs13
1 files changed, 7 insertions, 6 deletions
diff --git a/Presence/Presence.hs b/Presence/Presence.hs
index c3e60239..2086133d 100644
--- a/Presence/Presence.hs
+++ b/Presence/Presence.hs
@@ -1006,7 +1006,7 @@ addToRosterFile ::
1006 -> Text -- profile 1006 -> Text -- profile
1007 -> Text -> [PeerAddress] -> t1 1007 -> Text -> [PeerAddress] -> t1
1008addToRosterFile man doit whose profile to addrs = 1008addToRosterFile man doit whose profile to addrs =
1009 modifyRosterFile man doit whose profile to addrs True 1009 modifyRosterFile man doit whose profile to addrs True False
1010 1010
1011removeFromRosterFile :: 1011removeFromRosterFile ::
1012 Connection.Manager s Text 1012 Connection.Manager s Text
@@ -1019,7 +1019,7 @@ removeFromRosterFile ::
1019 -> Text -- profile 1019 -> Text -- profile
1020 -> Text -> [PeerAddress] -> t1 1020 -> Text -> [PeerAddress] -> t1
1021removeFromRosterFile man doit whose profile to addrs = 1021removeFromRosterFile man doit whose profile to addrs =
1022 modifyRosterFile man doit whose profile to addrs False 1022 modifyRosterFile man doit whose profile to addrs False False
1023 1023
1024-- | Sanity-checked roster file manipulation. Primarily, this function handles 1024-- | Sanity-checked roster file manipulation. Primarily, this function handles
1025-- hostname aliases. 1025-- hostname aliases.
@@ -1045,8 +1045,9 @@ modifyRosterFile ::
1045 -> Text -- ^ JID that will be added or removed a hostname 1045 -> Text -- ^ JID that will be added or removed a hostname
1046 -> [PeerAddress] -- ^ Alias addresses for hostname in the JID. 1046 -> [PeerAddress] -- ^ Alias addresses for hostname in the JID.
1047 -> Bool -- ^ True if adding, otherwise False 1047 -> Bool -- ^ True if adding, otherwise False
1048 -> Bool -- ^ True to allow deleting all users at a host.
1048 -> t1 1049 -> t1
1049modifyRosterFile man doit whose profile to addrs bAdd = do 1050modifyRosterFile man doit whose profile to addrs bAdd bWildCard = do
1050 let (mu,_,_) = splitJID to 1051 let (mu,_,_) = splitJID to
1051 -- For each jid in the file, this function will decide whether to keep 1052 -- 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 1053 -- it (possibly modified) which is indicated by Just _ or to remove the
@@ -1066,9 +1067,9 @@ modifyRosterFile man doit whose profile to addrs bAdd = do
1066 guard $ isNothing mr -- delete if resource specified in file. 1067 guard $ isNothing mr -- delete if resource specified in file.
1067 stored_u <- msu -- delete if user not specified in file. 1068 stored_u <- msu -- delete if user not specified in file.
1068 case mu of 1069 case mu of
1069 Nothing -> Just keep -- do not delete if /to/ has no user field 1070 Nothing | not bWildCard -> Just keep -- do not delete if /to/ has no user field
1070 Just u | u /= stored_u -> Just keep -- do not delete if users don't match 1071 Just u | u /= stored_u -> Just keep -- do not delete if users don't match
1071 Just _ -> Just iocheck -- do not delete unless hostname alias 1072 _ -> Just iocheck -- do not delete unless hostname alias
1072 doit (textToLazyByteString whose) (Text.unpack profile) 1073 doit (textToLazyByteString whose) (Text.unpack profile)
1073 cmp 1074 cmp
1074 (guard bAdd >> Just (textToLazyByteString to)) 1075 (guard bAdd >> Just (textToLazyByteString to))