diff options
-rw-r--r-- | ToxToXMPP.hs | 1 | ||||
-rw-r--r-- | src/Data/Word64RangeMap.hs | 6 | ||||
-rw-r--r-- | src/Network/Tox/NodeId.hs | 1 |
3 files changed, 8 insertions, 0 deletions
diff --git a/ToxToXMPP.hs b/ToxToXMPP.hs index fca8ee30..12a08901 100644 --- a/ToxToXMPP.hs +++ b/ToxToXMPP.hs | |||
@@ -51,6 +51,7 @@ key2jid nospam key = T.pack $ show $ NoSpamId nsp key | |||
51 | nlo = fromIntegral (0x0FFFF .&. nospam) :: Word16 | 51 | nlo = fromIntegral (0x0FFFF .&. nospam) :: Word16 |
52 | nhi = fromIntegral (0x0FFFF .&. (nospam `shiftR` 16)) :: Word16 | 52 | nhi = fromIntegral (0x0FFFF .&. (nospam `shiftR` 16)) :: Word16 |
53 | 53 | ||
54 | dispatch :: Account -> Conn -> ContactEvent -> IO () | ||
54 | dispatch acnt conn (PolicyChange theirkey policy ) = return () -- todo | 55 | dispatch acnt conn (PolicyChange theirkey policy ) = return () -- todo |
55 | dispatch acnt conn (OnionRouted theirkey (OnionDHTPublicKey pkey)) = return () -- todo | 56 | dispatch acnt conn (OnionRouted theirkey (OnionDHTPublicKey pkey)) = return () -- todo |
56 | dispatch acnt conn (OnionRouted theirkey (OnionFriendRequest fr) ) = do | 57 | dispatch acnt conn (OnionRouted theirkey (OnionFriendRequest fr) ) = do |
diff --git a/src/Data/Word64RangeMap.hs b/src/Data/Word64RangeMap.hs index c754c226..36428233 100644 --- a/src/Data/Word64RangeMap.hs +++ b/src/Data/Word64RangeMap.hs | |||
@@ -49,7 +49,13 @@ deleteArrayAt (RefArray ref) pos = do | |||
49 | newMA <- MA.newListArray (0,n-1) (esBefore ++ drop 1 esAt) | 49 | newMA <- MA.newListArray (0,n-1) (esBefore ++ drop 1 esAt) |
50 | writeRef ref newMA | 50 | writeRef ref newMA |
51 | 51 | ||
52 | |||
53 | -- forall (ma :: * -> * -> *) i e (r :: * -> *) (m :: * -> *). | ||
54 | readRefArray :: Reference r m => RefArray r ma i e -> m (ma i e) | ||
52 | readRefArray (RefArray x) = readRef x | 55 | readRefArray (RefArray x) = readRef x |
56 | |||
57 | -- forall (ma :: * -> * -> *) i e (r :: * -> *) (m :: * -> *). | ||
58 | writeRefArray :: Reference r m => RefArray r ma i e -> ma i e -> m () | ||
53 | writeRefArray (RefArray x) y = writeRef x y | 59 | writeRefArray (RefArray x) y = writeRef x y |
54 | 60 | ||
55 | {- | 61 | {- |
diff --git a/src/Network/Tox/NodeId.hs b/src/Network/Tox/NodeId.hs index 2728a13d..74239710 100644 --- a/src/Network/Tox/NodeId.hs +++ b/src/Network/Tox/NodeId.hs | |||
@@ -537,6 +537,7 @@ instance Read NoSpamId where | |||
537 | nsid <- parseNoSpamId $ Text.pack jid | 537 | nsid <- parseNoSpamId $ Text.pack jid |
538 | return [(nsid,xs)] | 538 | return [(nsid,xs)] |
539 | 539 | ||
540 | parseNoSpamHex :: Text -> Either String NoSpamId | ||
540 | parseNoSpamHex hex = Right $ NoSpamId (read $ "0x"++nospamsum) (id2key $ read hkey) | 541 | parseNoSpamHex hex = Right $ NoSpamId (read $ "0x"++nospamsum) (id2key $ read hkey) |
541 | where | 542 | where |
542 | (hkey,nospamsum) = splitAt 64 $ Text.unpack hex | 543 | (hkey,nospamsum) = splitAt 64 $ Text.unpack hex |