From 94d2128963f28c0b02a282e5ab2a470275b7de1c Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Sat, 13 Jul 2019 05:12:32 -0400 Subject: remove redundant field --- lib/Kiki.hs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/Kiki.hs b/lib/Kiki.hs index 1cc387b..292197a 100644 --- a/lib/Kiki.hs +++ b/lib/Kiki.hs @@ -339,9 +339,10 @@ importAndRefresh root cmn cipher = do data Peer = Peer { peerHostnames :: Hostnames - , addr :: SockAddr , kd :: KeyData } +addr :: Peer -> SockAddr +addr = gpgipv6addr . peerHostnames newtype IpsecPeerConfig = IpsecPeerConfig Char8.ByteString -- Installs the cert file for the peer to the filesystem, and returns an @@ -558,15 +559,14 @@ newtype UidHostname = UidHostname Char8.ByteString newtype ResolvableHostname = ResolvableHostname Char8.ByteString listPeers :: KeyRingRuntime -> [Peer] -listPeers rt = map conv . filter notme . mapMaybe namedContact . Map.elems . byKeyKey . rtKeyDB $ rt +listPeers rt = map (uncurry Peer) . filter notme . mapMaybe namedContact . Map.elems . byKeyKey . rtKeyDB $ rt where - conv = \(a,b,c) -> Peer a b c - kk = keykey (fromJust $ rtWorkingKey rt) - notme (_,_,kd) = keykey (keyPacket kd) /= kk + kk = keykey (fromJust $ rtWorkingKey rt) + notme (_,kd) = keykey (keyPacket kd) /= kk namedContact kd = do let h = getHostnames kd _ <- listToMaybe $ allNames h - return (h, gpgipv6addr h, kd) + return (h, kd) writePublicKeyFiles :: KeyRingRuntime -> FileWriter -> String -> MyIdentity -> IO () writePublicKeyFiles rt fw grip myId = do -- cgit v1.2.3