diff options
author | joe <joe@jerkface.net> | 2018-05-24 19:36:27 -0400 |
---|---|---|
committer | joe <joe@jerkface.net> | 2018-05-24 19:36:27 -0400 |
commit | 34a45811b35ce680270c88834951d36f19c7e4e8 (patch) | |
tree | a42c411269608f2fb067eb3fd0c3da590fd09073 /Presence/Presence.hs | |
parent | 3de9992f3e30a911617737827bce3242db0cc978 (diff) |
Diagnostic comments and debug print.
Diffstat (limited to 'Presence/Presence.hs')
-rw-r--r-- | Presence/Presence.hs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Presence/Presence.hs b/Presence/Presence.hs index 4aa24eb5..c6bf9ffa 100644 --- a/Presence/Presence.hs +++ b/Presence/Presence.hs | |||
@@ -1007,6 +1007,14 @@ peerSubscriptionRequest state fail k stanza chan = do | |||
1007 | flip (maybe fail) mto_u $ \u -> do | 1007 | flip (maybe fail) mto_u $ \u -> do |
1008 | flip (maybe fail) mfrom_u $ \from_u -> do | 1008 | flip (maybe fail) mfrom_u $ \from_u -> do |
1009 | let profile = fromMaybe "." $ clientProfile <$> Map.lookup k cmap | 1009 | let profile = fromMaybe "." $ clientProfile <$> Map.lookup k cmap |
1010 | -- XXX profile is wrong. | ||
1011 | -- TODO Likely the problem is that k is a peer ConnectionKey and of course | ||
1012 | -- will have no entry in the cmap. Thus giving "." even though it ought | ||
1013 | -- to be using a tox profile. | ||
1014 | -- | ||
1015 | -- Solution 1: Only .tox peers go in a tox profile. | ||
1016 | -- Solution 2: Duplicate non .tox peers in all profiles. | ||
1017 | -- Solution 3: Only one profile is active at a time. | ||
1010 | resolved_subs <- resolvedFromRoster ConfigFiles.getSubscribers u profile | 1018 | resolved_subs <- resolvedFromRoster ConfigFiles.getSubscribers u profile |
1011 | let already_subscribed = elem (mfrom_u,k) resolved_subs | 1019 | let already_subscribed = elem (mfrom_u,k) resolved_subs |
1012 | is_wanted = case stanzaType stanza of | 1020 | is_wanted = case stanzaType stanza of |
@@ -1151,6 +1159,7 @@ peerInformSubscription state fail k stanza = do | |||
1151 | was_solicited <- removeFromRosterFile ConfigFiles.modifySolicited user profile from'' addrs | 1159 | was_solicited <- removeFromRosterFile ConfigFiles.modifySolicited user profile from'' addrs |
1152 | subs <- resolvedFromRoster ConfigFiles.getSubscribers user profile | 1160 | subs <- resolvedFromRoster ConfigFiles.getSubscribers user profile |
1153 | let is_sub = not . null $ map ((from_u,) . PeerKey) addrs `intersect` subs | 1161 | let is_sub = not . null $ map ((from_u,) . PeerKey) addrs `intersect` subs |
1162 | putStrLn $ "DEBUG peerInformSubscription (is_sub,typ)=" ++ show (is_sub,stanzaType stanza) | ||
1154 | let (relationship,addf,remf) = | 1163 | let (relationship,addf,remf) = |
1155 | case stanzaType stanza of | 1164 | case stanzaType stanza of |
1156 | PresenceInformSubscription True -> | 1165 | PresenceInformSubscription True -> |