diff options
-rw-r--r-- | examples/dhtd.hs | 6 | ||||
-rw-r--r-- | src/Network/Tox/NodeId.hs | 4 | ||||
-rw-r--r-- | todo.txt | 4 |
3 files changed, 11 insertions, 3 deletions
diff --git a/examples/dhtd.hs b/examples/dhtd.hs index eaf908f8..f713b926 100644 --- a/examples/dhtd.hs +++ b/examples/dhtd.hs | |||
@@ -572,7 +572,11 @@ clientSession s@Session{..} sock cnum h = do | |||
572 | Left e -> | 572 | Left e -> |
573 | -- HACK: split nospam from hex toxid | 573 | -- HACK: split nospam from hex toxid |
574 | case dhtParseId (take 64 s) of | 574 | case dhtParseId (take 64 s) of |
575 | Left e -> "Error: " ++ e | 575 | Left e -> case Tox.parseNoSpamId $ T.pack s of |
576 | Left ej -> if elem '@' s | ||
577 | then "Error: " ++ ej | ||
578 | else "Error: " ++ e | ||
579 | Right jid -> show jid | ||
576 | Right nid -> show nid ++ " nospam:" ++ drop 64 s | 580 | Right nid -> show nid ++ " nospam:" ++ drop 64 s |
577 | Right nid -> show nid | 581 | Right nid -> show nid |
578 | 582 | ||
diff --git a/src/Network/Tox/NodeId.hs b/src/Network/Tox/NodeId.hs index 2f3a2bb1..1f79d1a5 100644 --- a/src/Network/Tox/NodeId.hs +++ b/src/Network/Tox/NodeId.hs | |||
@@ -548,7 +548,9 @@ parseNoSpamId spec | Text.length spec == 76 | |||
548 | parseNoSpamJID :: Text -> Either String NoSpamId | 548 | parseNoSpamJID :: Text -> Either String NoSpamId |
549 | parseNoSpamJID jid = do | 549 | parseNoSpamJID jid = do |
550 | (Just u,h,_) <- Right $ splitJID jid | 550 | (Just u,h,_) <- Right $ splitJID jid |
551 | (base64,".tox") <- Right $ splitAt 43 $ Text.unpack h | 551 | base64 <- case splitAt 43 $ Text.unpack h of |
552 | (base64,".tox") -> Right base64 | ||
553 | _ -> Left "Hostname should be 43 base64 digits followed by .tox." | ||
552 | pub <- id2key <$> readEither base64 | 554 | pub <- id2key <$> readEither base64 |
553 | let ustr = Text.unpack u | 555 | let ustr = Text.unpack u |
554 | '$' : b64digits <- Right ustr -- TODO: support 0x prefix also. | 556 | '$' : b64digits <- Right ustr -- TODO: support 0x prefix also. |
@@ -1,3 +1,5 @@ | |||
1 | tox: tcp relay | ||
2 | |||
1 | bug: local IPv6 addresses are occurring in the IPv4 tox routing table. | 3 | bug: local IPv6 addresses are occurring in the IPv4 tox routing table. |
2 | 4 | ||
3 | xmpp: xmpp-added roster keys are not in TransportCrypto and unusable from TOx.Crypto.Handlers. | 5 | xmpp: xmpp-added roster keys are not in TransportCrypto and unusable from TOx.Crypto.Handlers. |
@@ -6,7 +8,7 @@ xmpp: handle tox-friends in roster. | |||
6 | 8 | ||
7 | tox: Add fallback trials to cookie response in case response is from another address than request. | 9 | tox: Add fallback trials to cookie response in case response is from another address than request. |
8 | 10 | ||
9 | ui: Online help. | 11 | ui: Online help. Document confusing "friend" and "dhtkey" methods. |
10 | 12 | ||
11 | ui: Explicit routing table node deletion. "forget" command. | 13 | ui: Explicit routing table node deletion. "forget" command. |
12 | 14 | ||