diff options
author | joe <joe@jerkface.net> | 2013-07-01 22:15:50 -0400 |
---|---|---|
committer | joe <joe@jerkface.net> | 2013-07-01 22:15:50 -0400 |
commit | 09d58ee7dac8e147d71c2fefe77343457d1f57d8 (patch) | |
tree | 8c6a15ad4a8839e143023226132ef918ec52f517 /Presence/main.hs | |
parent | 43c4487e3763b741291c928e33f71aac0aa47358 (diff) |
discard bad hostnames in sendProbes
Diffstat (limited to 'Presence/main.hs')
-rw-r--r-- | Presence/main.hs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Presence/main.hs b/Presence/main.hs index 7a319630..fa4a98c1 100644 --- a/Presence/main.hs +++ b/Presence/main.hs | |||
@@ -35,7 +35,7 @@ import XMPP | |||
35 | #endif | 35 | #endif |
36 | import ControlMaybe | 36 | import ControlMaybe |
37 | import Data.HList | 37 | import Data.HList |
38 | import Control.Exception | 38 | import Control.Exception hiding (catch) |
39 | import LocalPeerCred | 39 | import LocalPeerCred |
40 | import System.Posix.User | 40 | import System.Posix.User |
41 | import qualified Data.Set as Set | 41 | import qualified Data.Set as Set |
@@ -234,9 +234,12 @@ newPresenceState hostname = atomically $ do | |||
234 | 234 | ||
235 | sendProbes state jid = do | 235 | sendProbes state jid = do |
236 | withJust (name jid) $ \user -> do | 236 | withJust (name jid) $ \user -> do |
237 | let parseHostNameJID' str = do | ||
238 | handle (\(SomeException _) -> return Nothing) | ||
239 | (fmap Just . parseHostNameJID $ str) | ||
237 | buddies <- do | 240 | buddies <- do |
238 | buddies <- ConfigFiles.getBuddies user | 241 | buddies <- ConfigFiles.getBuddies user |
239 | mapM parseHostNameJID buddies | 242 | fmap catMaybes (mapM parseHostNameJID' buddies) |
240 | remotes <- readTVarIO (remoteUsers state) | 243 | remotes <- readTVarIO (remoteUsers state) |
241 | forM_ buddies $ \buddy -> do | 244 | forM_ buddies $ \buddy -> do |
242 | let mjids = fmap snd $ Map.lookup (peer buddy) remotes | 245 | let mjids = fmap snd $ Map.lookup (peer buddy) remotes |