summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjoe <joe@jerkface.net>2018-05-27 21:00:37 -0400
committerjoe <joe@jerkface.net>2018-05-27 21:00:37 -0400
commit2e448ed7647c0d0a97bd191b32ebc3dd8cda0b9e (patch)
tree696a210e55f0cccc85b15084504283f948b7a123 /src
parentdda052d5dfac60c647aff7f5a03605350eaf2f62 (diff)
Enabled generated nospam-id via the "nid" command.
Diffstat (limited to 'src')
-rw-r--r--src/Network/Tox/NodeId.hs4
1 files changed, 3 insertions, 1 deletions
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
548parseNoSpamJID :: Text -> Either String NoSpamId 548parseNoSpamJID :: Text -> Either String NoSpamId
549parseNoSpamJID jid = do 549parseNoSpamJID 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.