summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Crayne <jim.crayne@gmail.com>2020-01-24 09:10:56 +0000
committerJames Crayne <jim.crayne@gmail.com>2020-01-24 09:10:56 +0000
commit770649a15332df52e98c8d99582e5d67d8d84787 (patch)
tree9b9c3382bb5113182f1ddc9b738f60df16e2317f
parentb7d05c1aa9fe88880eca5ee3f6a20ac16c9e6137 (diff)
fix formatting which confuses haddock
-rw-r--r--dht/Presence/Chat.hs2
-rw-r--r--dht/Presence/ClientState.hs4
-rw-r--r--dht/Presence/Presence.hs4
-rw-r--r--dht/Presence/Stanza/Types.hs4
-rw-r--r--dht/ToxManager.hs2
-rw-r--r--dht/src/Data/Tox/Message.hs14
-rw-r--r--dht/src/Network/Lossless.hs6
-rw-r--r--dht/src/Network/Tox.hs2
-rw-r--r--dht/src/Network/Tox/ContactInfo.hs3
-rw-r--r--dht/src/Network/Tox/Onion/Routes.hs2
10 files changed, 22 insertions, 21 deletions
diff --git a/dht/Presence/Chat.hs b/dht/Presence/Chat.hs
index 03bea44b..9c109895 100644
--- a/dht/Presence/Chat.hs
+++ b/dht/Presence/Chat.hs
@@ -34,7 +34,7 @@ newtype Affiliation = Affiliation
34 { reservedNick :: Text 34 { reservedNick :: Text
35 } 35 }
36 36
37data ChatEvent = Join | Part | Action Text | Talk Text -- | NickChange Text 37data ChatEvent = Join | Part | Action Text | Talk Text -- NickChange Text
38 deriving (Eq,Ord,Show) 38 deriving (Eq,Ord,Show)
39 39
40data Membership = Outside | Inside 40data Membership = Outside | Inside
diff --git a/dht/Presence/ClientState.hs b/dht/Presence/ClientState.hs
index 08cc54ed..9c7e7b97 100644
--- a/dht/Presence/ClientState.hs
+++ b/dht/Presence/ClientState.hs
@@ -9,8 +9,8 @@ import UTmp ( ProcessID )
9import XMPPServer ( Stanza ) 9import XMPPServer ( Stanza )
10 10
11data ClientState = ClientState 11data ClientState = ClientState
12 -- | The unix tty or the jabber resource for this client. 12 { -- | The unix tty or the jabber resource for this client.
13 { clientResource :: Text 13 clientResource :: Text
14 -- | Unix user that is running this client. 14 -- | Unix user that is running this client.
15 , clientUser :: Text 15 , clientUser :: Text
16 -- | The specific roster/identity of the user that this client presenting. 16 -- | The specific roster/identity of the user that this client presenting.
diff --git a/dht/Presence/Presence.hs b/dht/Presence/Presence.hs
index c54c3659..87c00656 100644
--- a/dht/Presence/Presence.hs
+++ b/dht/Presence/Presence.hs
@@ -78,8 +78,8 @@ localJID user profile resource =
78-- unique value should be able to hold a reference to the ToxID identity which 78-- unique value should be able to hold a reference to the ToxID identity which
79-- should stay online until all interested keys have run 'deactivateAccount'. 79-- should stay online until all interested keys have run 'deactivateAccount'.
80data ToxManager k = ToxManager 80data ToxManager k = ToxManager
81 -- | Put the given ToxID online. 81 { -- | Put the given ToxID online.
82 { activateAccount :: k -> Text -> SecretKey -> IO () 82 activateAccount :: k -> Text -> SecretKey -> IO ()
83 -- | Take the given ToxID offline (assuming no other /k/ has a claim). 83 -- | Take the given ToxID offline (assuming no other /k/ has a claim).
84 , deactivateAccount :: k -> Text -> IO () 84 , deactivateAccount :: k -> Text -> IO ()
85 , toxConnections :: Connection.Manager ToxProgress ToxContact 85 , toxConnections :: Connection.Manager ToxProgress ToxContact
diff --git a/dht/Presence/Stanza/Types.hs b/dht/Presence/Stanza/Types.hs
index 8fc23f84..f09025e0 100644
--- a/dht/Presence/Stanza/Types.hs
+++ b/dht/Presence/Stanza/Types.hs
@@ -122,14 +122,14 @@ data MessageType
122 -- to that resource; otherwise the server MUST either 122 -- to that resource; otherwise the server MUST either
123 -- silently ignore the message or return an error (see 123 -- silently ignore the message or return an error (see
124 -- Section 8). 124 -- Section 8).
125 125 --
126 -- | ErrorMsg -- The message is generated by an entity that experiences an 126 -- | ErrorMsg -- The message is generated by an entity that experiences an
127 -- error when processing a message received from another entity (for 127 -- error when processing a message received from another entity (for
128 -- details regarding stanza error syntax, refer to [XMPP‑CORE]). A client 128 -- details regarding stanza error syntax, refer to [XMPP‑CORE]). A client
129 -- that receives a message of type "error" SHOULD present an appropriate 129 -- that receives a message of type "error" SHOULD present an appropriate
130 -- interface informing the original sender regarding the nature of the 130 -- interface informing the original sender regarding the nature of the
131 -- error. 131 -- error.
132 132 --
133 deriving (Show,Read,Ord,Eq,Enum) 133 deriving (Show,Read,Ord,Eq,Enum)
134 134
135 135
diff --git a/dht/ToxManager.hs b/dht/ToxManager.hs
index 63cb3967..c1112a05 100644
--- a/dht/ToxManager.hs
+++ b/dht/ToxManager.hs
@@ -303,7 +303,7 @@ connectViaRelay tx theirKey theirDhtKey ann tkey now = do
303 let theirDhtKey' = theirDhtKey { Tox.dhtpkNodes = Tox.SendNodes (cycled ns) } 303 let theirDhtKey' = theirDhtKey { Tox.dhtpkNodes = Tox.SendNodes (cycled ns) }
304 scheduleRel ann tkey (ScheduledItem $ connectViaRelay tx theirKey theirDhtKey') 5 304 scheduleRel ann tkey (ScheduledItem $ connectViaRelay tx theirKey theirDhtKey') 5
305 return $ when (not established) (go ns) 305 return $ when (not established) (go ns)
306 -- $ scheduleImmediately ann tkey $ ScheduledItem go 306 -- scheduleImmediately ann tkey $ ScheduledItem go
307 -- return $ return () 307 -- return $ return ()
308 where 308 where
309 myPublicKey = toPublic $ userSecret (txAccount tx) 309 myPublicKey = toPublic $ userSecret (txAccount tx)
diff --git a/dht/src/Data/Tox/Message.hs b/dht/src/Data/Tox/Message.hs
index 9f1ce339..93750f90 100644
--- a/dht/src/Data/Tox/Message.hs
+++ b/dht/src/Data/Tox/Message.hs
@@ -9,11 +9,11 @@ import Data.Word
9 9
10-- | The one-byte type code prefix that classifies a 'CryptoMessage'. 10-- | The one-byte type code prefix that classifies a 'CryptoMessage'.
11newtype MessageID = MessageID Word8 deriving (Eq,Enum,Ord,Bounded) 11newtype MessageID = MessageID Word8 deriving (Eq,Enum,Ord,Bounded)
12pattern Padding = MessageID 0 -- ^ 0 padding (skipped until we hit a non zero (data id) byte) 12pattern Padding = MessageID 0 -- 0 padding (skipped until we hit a non zero (data id) byte)
13pattern PacketRequest = MessageID 1 -- ^ 1 packet request packet (lossy packet) 13pattern PacketRequest = MessageID 1 -- 1 packet request packet (lossy packet)
14pattern KillPacket = MessageID 2 -- ^ 2 connection kill packet (lossy packet) 14pattern KillPacket = MessageID 2 -- 2 connection kill packet (lossy packet)
15pattern UnspecifiedPacket003 = MessageID 3 -- ^ 3+ unspecified 15pattern UnspecifiedPacket003 = MessageID 3 -- 3+ unspecified
16pattern PING = MessageID 16 -- ^ 16+ reserved for Messenger usage (lossless packets) 16pattern PING = MessageID 16 -- 16+ reserved for Messenger usage (lossless packets)
17-- TODO: rename to ALIVE 16 17-- TODO: rename to ALIVE 16
18-- SHARE_RELAYS 17 18-- SHARE_RELAYS 17
19-- FRIEND_REQUESTS 18 19-- FRIEND_REQUESTS 18
@@ -40,9 +40,9 @@ pattern DIRECT_GROUPCHAT = MessageID 98 -- 0x62
40pattern MESSAGE_GROUPCHAT = MessageID 99 -- 0x63 40pattern MESSAGE_GROUPCHAT = MessageID 99 -- 0x63
41-- TODO: rename to MESSAGE_CONFERENCE 99 41-- TODO: rename to MESSAGE_CONFERENCE 99
42-- LOSSLESS_RANGE_START 160 42-- LOSSLESS_RANGE_START 160
43pattern MessengerLossy192 = MessageID 192 -- ^ 192+ reserved for Messenger usage (lossy packets) 43pattern MessengerLossy192 = MessageID 192 -- 192+ reserved for Messenger usage (lossy packets)
44pattern LOSSY_GROUPCHAT = MessageID 199 -- 0xC7 44pattern LOSSY_GROUPCHAT = MessageID 199 -- 0xC7
45pattern Messenger255 = MessageID 255 -- ^ 255 reserved for Messenger usage (lossless packet) 45pattern Messenger255 = MessageID 255 -- 255 reserved for Messenger usage (lossless packet)
46 46
47instance Show MessageID where 47instance Show MessageID where
48 show Padding = "Padding" 48 show Padding = "Padding"
diff --git a/dht/src/Network/Lossless.hs b/dht/src/Network/Lossless.hs
index 079f4d07..41203ca5 100644
--- a/dht/src/Network/Lossless.hs
+++ b/dht/src/Network/Lossless.hs
@@ -49,9 +49,9 @@ lossless :: Show addr =>
49 -> addr -- ^ The remote address for this session. 49 -> addr -- ^ The remote address for this session.
50 -> TransportA String addr x y -- ^ An unreliable lossy transport. 50 -> TransportA String addr x y -- ^ An unreliable lossy transport.
51 51
52 -> IO ( Transport String addr' x' -- ^ A reliable lossless transport. 52 -> IO ( Transport String addr' x' -- A reliable lossless transport.
53 , [Word32] -> IO () -- ^ Use this to request lost packets be re-sent. 53 , [Word32] -> IO () -- Use this to request lost packets be re-sent.
54 , IO ([Word32],Word32) -- ^ Use this to discover missing packets to request. 54 , IO ([Word32],Word32) -- Use this to discover missing packets to request.
55 ) 55 )
56lossless lbl isLossless encode saddr udp = do 56lossless lbl isLossless encode saddr udp = do
57 pb <- atomically newPacketBuffer 57 pb <- atomically newPacketBuffer
diff --git a/dht/src/Network/Tox.hs b/dht/src/Network/Tox.hs
index 23dbfe27..1628b435 100644
--- a/dht/src/Network/Tox.hs
+++ b/dht/src/Network/Tox.hs
@@ -392,7 +392,7 @@ newToxOverTransport keydb addr onNewSession (crypto,roster) udp tcp = do
392 return (msg, maybe (Multi.OnionUDP ==> addr) (const $ Multi.OnionTCP ==> addr) mtcp)) 392 return (msg, maybe (Multi.OnionUDP ==> addr) (const $ Multi.OnionTCP ==> addr) mtcp))
393 <$> mergeTransports (DMap.fromList 393 <$> mergeTransports (DMap.fromList
394 [ Multi.OnionUDP :=> ByAddress onioncryptUDP 394 [ Multi.OnionUDP :=> ByAddress onioncryptUDP
395 , Multi.OnionTCP :=> ByAddress {- $ onInbound updateOnTCP -} onioncryptTCP ]) 395 , Multi.OnionTCP :=> ByAddress {- onInbound updateOnTCP -} onioncryptTCP ])
396 396
397 -- dtacrypt :: Transport String AnnouncedRendezvous (PublicKey,OnionData) 397 -- dtacrypt :: Transport String AnnouncedRendezvous (PublicKey,OnionData)
398 (dtacrypt,onioncrypt) <- partitionTransportM (Onion.parseDataToRoute crypto) (Onion.encodeDataToRoute crypto) onioncrypt 398 (dtacrypt,onioncrypt) <- partitionTransportM (Onion.parseDataToRoute crypto) (Onion.encodeDataToRoute crypto) onioncrypt
diff --git a/dht/src/Network/Tox/ContactInfo.hs b/dht/src/Network/Tox/ContactInfo.hs
index e7cb48c1..d5640ce8 100644
--- a/dht/src/Network/Tox/ContactInfo.hs
+++ b/dht/src/Network/Tox/ContactInfo.hs
@@ -18,8 +18,9 @@ import DPut
18import DebugTag 18import DebugTag
19 19
20newtype ContactInfo extra = ContactInfo 20newtype ContactInfo extra = ContactInfo
21 {
21 -- | Map our toxid public key to an Account record. 22 -- | Map our toxid public key to an Account record.
22 { accounts :: TVar (HashMap NodeId{-my userkey-} (Account extra)) 23 accounts :: TVar (HashMap NodeId{-my userkey-} (Account extra))
23 } 24 }
24 25
25data Account extra = Account 26data Account extra = Account
diff --git a/dht/src/Network/Tox/Onion/Routes.hs b/dht/src/Network/Tox/Onion/Routes.hs
index 2f13a513..374b9648 100644
--- a/dht/src/Network/Tox/Onion/Routes.hs
+++ b/dht/src/Network/Tox/Onion/Routes.hs
@@ -276,7 +276,7 @@ updateTCP or addr x = do
276selectGateway :: TVar (R.BucketList TCP.NodeInfo) -> NodeInfo -> STM (Maybe TCP.NodeInfo) 276selectGateway :: TVar (R.BucketList TCP.NodeInfo) -> NodeInfo -> STM (Maybe TCP.NodeInfo)
277selectGateway tbl ni = do 277selectGateway tbl ni = do
278 ns <- kclosest TCP.tcpSpace 2 (nodeId ni) <$> readTVar tbl 278 ns <- kclosest TCP.tcpSpace 2 (nodeId ni) <$> readTVar tbl
279 return $ listToMaybe ns -- $ dropWhile (\n -> TCP.nodeId n == nodeId ni) ns 279 return $ listToMaybe ns -- dropWhile (\n -> TCP.nodeId n == nodeId ni) ns
280 280
281quitRouteBuilder :: OnionRouter -> IO () 281quitRouteBuilder :: OnionRouter -> IO ()
282quitRouteBuilder or = do 282quitRouteBuilder or = do