diff options
author | joe <joe@jerkface.net> | 2018-05-27 17:17:18 -0400 |
---|---|---|
committer | joe <joe@jerkface.net> | 2018-05-27 17:17:18 -0400 |
commit | 14d245ee6b5d3f1e51d5455c2c1b055087b99485 (patch) | |
tree | 8d69fd30b7b457f926deb9dd2cc40087482bb104 /Presence/Presence.hs | |
parent | 735fa5c892700efb78c7a9205b719f064ce429a6 (diff) |
Comments.
Diffstat (limited to 'Presence/Presence.hs')
-rw-r--r-- | Presence/Presence.hs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Presence/Presence.hs b/Presence/Presence.hs index f1bae255..41204818 100644 --- a/Presence/Presence.hs +++ b/Presence/Presence.hs | |||
@@ -502,6 +502,9 @@ peerKeyToResolvedName buds pk = do | |||
502 | return $ fromMaybe (peerKeyToText pk) (listToMaybe ns') | 502 | return $ fromMaybe (peerKeyToText pk) (listToMaybe ns') |
503 | 503 | ||
504 | 504 | ||
505 | -- Given a local address and an IP-address JID, we return True if the JID is | ||
506 | -- local, False otherwise. Additionally, a list of equivalent hostname JIDS | ||
507 | -- are returned. | ||
505 | multiplyJIDForClient :: SockAddr -> Text -> IO (Bool,[(Maybe Text,Text,Maybe Text)]) | 508 | multiplyJIDForClient :: SockAddr -> Text -> IO (Bool,[(Maybe Text,Text,Maybe Text)]) |
506 | multiplyJIDForClient laddr jid = do | 509 | multiplyJIDForClient laddr jid = do |
507 | let (n,h,r) = splitJID jid | 510 | let (n,h,r) = splitJID jid |
@@ -819,6 +822,8 @@ answerProbe state mto k chan = do | |||
819 | pstanza <- makePresenceStanza "jabber:server" (Just jid) Offline | 822 | pstanza <- makePresenceStanza "jabber:server" (Just jid) Offline |
820 | atomically $ writeTChan (connChan conn) pstanza | 823 | atomically $ writeTChan (connChan conn) pstanza |
821 | 824 | ||
825 | -- Send friend requests and remote presences stored in remotesByPeer to XMPP | ||
826 | -- clients. | ||
822 | sendCachedPresence :: PresenceState -> ConnectionKey -> IO () | 827 | sendCachedPresence :: PresenceState -> ConnectionKey -> IO () |
823 | sendCachedPresence state k = do | 828 | sendCachedPresence state k = do |
824 | forClient state k (return ()) $ \client -> do | 829 | forClient state k (return ()) $ \client -> do |
@@ -888,7 +893,9 @@ modifyRosterFile :: (Traversable t, MonadPlus t) => | |||
888 | -> t1) | 893 | -> t1) |
889 | -> Text -- user | 894 | -> Text -- user |
890 | -> Text -- profile | 895 | -> Text -- profile |
891 | -> Text -> [SockAddr] -> Bool -> t1 | 896 | -> Text |
897 | -> [SockAddr] -- If a JID reverse-resolves to this address, consider it same. | ||
898 | -> Bool -> t1 | ||
892 | modifyRosterFile doit whose profile to addrs bAdd = do | 899 | modifyRosterFile doit whose profile to addrs bAdd = do |
893 | let (mu,_,_) = splitJID to | 900 | let (mu,_,_) = splitJID to |
894 | cmp jid = runTraversableT $ do | 901 | cmp jid = runTraversableT $ do |
@@ -1058,6 +1065,7 @@ peerSubscriptionRequest state fail k stanza chan = do | |||
1058 | 1065 | ||
1059 | let from' = unsplitJID fromtup | 1066 | let from' = unsplitJID fromtup |
1060 | 1067 | ||
1068 | -- Update roster files (subscribe: add to pending, unsubscribe: remove from subscribers). | ||
1061 | already_pending <- | 1069 | already_pending <- |
1062 | if is_wanted then | 1070 | if is_wanted then |
1063 | addToRosterFile ConfigFiles.modifyPending u profile from' addrs | 1071 | addToRosterFile ConfigFiles.modifyPending u profile from' addrs |