From 770649a15332df52e98c8d99582e5d67d8d84787 Mon Sep 17 00:00:00 2001 From: James Crayne Date: Fri, 24 Jan 2020 09:10:56 +0000 Subject: fix formatting which confuses haddock --- dht/Presence/Chat.hs | 2 +- dht/Presence/ClientState.hs | 4 ++-- dht/Presence/Presence.hs | 4 ++-- dht/Presence/Stanza/Types.hs | 4 ++-- dht/ToxManager.hs | 2 +- dht/src/Data/Tox/Message.hs | 14 +++++++------- dht/src/Network/Lossless.hs | 6 +++--- dht/src/Network/Tox.hs | 2 +- dht/src/Network/Tox/ContactInfo.hs | 3 ++- dht/src/Network/Tox/Onion/Routes.hs | 2 +- 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 { reservedNick :: Text } -data ChatEvent = Join | Part | Action Text | Talk Text -- | NickChange Text +data ChatEvent = Join | Part | Action Text | Talk Text -- NickChange Text deriving (Eq,Ord,Show) data 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 ) import XMPPServer ( Stanza ) data ClientState = ClientState - -- | The unix tty or the jabber resource for this client. - { clientResource :: Text + { -- | The unix tty or the jabber resource for this client. + clientResource :: Text -- | Unix user that is running this client. , clientUser :: Text -- | 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 = -- unique value should be able to hold a reference to the ToxID identity which -- should stay online until all interested keys have run 'deactivateAccount'. data ToxManager k = ToxManager - -- | Put the given ToxID online. - { activateAccount :: k -> Text -> SecretKey -> IO () + { -- | Put the given ToxID online. + activateAccount :: k -> Text -> SecretKey -> IO () -- | Take the given ToxID offline (assuming no other /k/ has a claim). , deactivateAccount :: k -> Text -> IO () , 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 -- to that resource; otherwise the server MUST either -- silently ignore the message or return an error (see -- Section 8). - + -- -- | ErrorMsg -- The message is generated by an entity that experiences an -- error when processing a message received from another entity (for -- details regarding stanza error syntax, refer to [XMPP‑CORE]). A client -- that receives a message of type "error" SHOULD present an appropriate -- interface informing the original sender regarding the nature of the -- error. - + -- deriving (Show,Read,Ord,Eq,Enum) 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 let theirDhtKey' = theirDhtKey { Tox.dhtpkNodes = Tox.SendNodes (cycled ns) } scheduleRel ann tkey (ScheduledItem $ connectViaRelay tx theirKey theirDhtKey') 5 return $ when (not established) (go ns) - -- $ scheduleImmediately ann tkey $ ScheduledItem go + -- scheduleImmediately ann tkey $ ScheduledItem go -- return $ return () where 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 -- | The one-byte type code prefix that classifies a 'CryptoMessage'. newtype MessageID = MessageID Word8 deriving (Eq,Enum,Ord,Bounded) -pattern Padding = MessageID 0 -- ^ 0 padding (skipped until we hit a non zero (data id) byte) -pattern PacketRequest = MessageID 1 -- ^ 1 packet request packet (lossy packet) -pattern KillPacket = MessageID 2 -- ^ 2 connection kill packet (lossy packet) -pattern UnspecifiedPacket003 = MessageID 3 -- ^ 3+ unspecified -pattern PING = MessageID 16 -- ^ 16+ reserved for Messenger usage (lossless packets) +pattern Padding = MessageID 0 -- 0 padding (skipped until we hit a non zero (data id) byte) +pattern PacketRequest = MessageID 1 -- 1 packet request packet (lossy packet) +pattern KillPacket = MessageID 2 -- 2 connection kill packet (lossy packet) +pattern UnspecifiedPacket003 = MessageID 3 -- 3+ unspecified +pattern PING = MessageID 16 -- 16+ reserved for Messenger usage (lossless packets) -- TODO: rename to ALIVE 16 -- SHARE_RELAYS 17 -- FRIEND_REQUESTS 18 @@ -40,9 +40,9 @@ pattern DIRECT_GROUPCHAT = MessageID 98 -- 0x62 pattern MESSAGE_GROUPCHAT = MessageID 99 -- 0x63 -- TODO: rename to MESSAGE_CONFERENCE 99 -- LOSSLESS_RANGE_START 160 -pattern MessengerLossy192 = MessageID 192 -- ^ 192+ reserved for Messenger usage (lossy packets) +pattern MessengerLossy192 = MessageID 192 -- 192+ reserved for Messenger usage (lossy packets) pattern LOSSY_GROUPCHAT = MessageID 199 -- 0xC7 -pattern Messenger255 = MessageID 255 -- ^ 255 reserved for Messenger usage (lossless packet) +pattern Messenger255 = MessageID 255 -- 255 reserved for Messenger usage (lossless packet) instance Show MessageID where 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 => -> addr -- ^ The remote address for this session. -> TransportA String addr x y -- ^ An unreliable lossy transport. - -> IO ( Transport String addr' x' -- ^ A reliable lossless transport. - , [Word32] -> IO () -- ^ Use this to request lost packets be re-sent. - , IO ([Word32],Word32) -- ^ Use this to discover missing packets to request. + -> IO ( Transport String addr' x' -- A reliable lossless transport. + , [Word32] -> IO () -- Use this to request lost packets be re-sent. + , IO ([Word32],Word32) -- Use this to discover missing packets to request. ) lossless lbl isLossless encode saddr udp = do 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 return (msg, maybe (Multi.OnionUDP ==> addr) (const $ Multi.OnionTCP ==> addr) mtcp)) <$> mergeTransports (DMap.fromList [ Multi.OnionUDP :=> ByAddress onioncryptUDP - , Multi.OnionTCP :=> ByAddress {- $ onInbound updateOnTCP -} onioncryptTCP ]) + , Multi.OnionTCP :=> ByAddress {- onInbound updateOnTCP -} onioncryptTCP ]) -- dtacrypt :: Transport String AnnouncedRendezvous (PublicKey,OnionData) (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 import DebugTag newtype ContactInfo extra = ContactInfo + { -- | Map our toxid public key to an Account record. - { accounts :: TVar (HashMap NodeId{-my userkey-} (Account extra)) + accounts :: TVar (HashMap NodeId{-my userkey-} (Account extra)) } data 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 selectGateway :: TVar (R.BucketList TCP.NodeInfo) -> NodeInfo -> STM (Maybe TCP.NodeInfo) selectGateway tbl ni = do ns <- kclosest TCP.tcpSpace 2 (nodeId ni) <$> readTVar tbl - return $ listToMaybe ns -- $ dropWhile (\n -> TCP.nodeId n == nodeId ni) ns + return $ listToMaybe ns -- dropWhile (\n -> TCP.nodeId n == nodeId ni) ns quitRouteBuilder :: OnionRouter -> IO () quitRouteBuilder or = do -- cgit v1.2.3