diff options
Diffstat (limited to 'dht/src')
-rw-r--r-- | dht/src/Network/Tox/NodeId.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/dht/src/Network/Tox/NodeId.hs b/dht/src/Network/Tox/NodeId.hs index 68888fdd..6c82ce09 100644 --- a/dht/src/Network/Tox/NodeId.hs +++ b/dht/src/Network/Tox/NodeId.hs | |||
@@ -575,9 +575,9 @@ parseNoSpamJID jid = do | |||
575 | (u,h) <- maybe (Left "Invalid JID.") Right | 575 | (u,h) <- maybe (Left "Invalid JID.") Right |
576 | $ let (mu,h,_) = splitJID jid | 576 | $ let (mu,h,_) = splitJID jid |
577 | in fmap (, h) mu | 577 | in fmap (, h) mu |
578 | based <- case splitAt 52 $ Text.unpack h of | 578 | based <- case stripSuffix ".tox" h of |
579 | (base32,".tox") -> Right base32 | 579 | Just base32 -> Right $ Text.unpack base32 |
580 | _ -> Left "Hostname should be 52 z-base32 digits followed by .tox." | 580 | _ -> Left "Hostname should be 52 z-base32 digits followed by .tox." |
581 | pub <- id2key <$> readEither based | 581 | pub <- id2key <$> readEither based |
582 | let ustr = Text.unpack u | 582 | let ustr = Text.unpack u |
583 | case ustr of | 583 | case ustr of |