@@ -293,10 +293,19 @@ connectionRequestTests =
293293 let contact = CSLContact SLSServer CCTContact
294294 shortenShortLink [srv] (contact srv (LinkKey " 0123456789abcdef0123456789abcdef" ))
295295 `shouldBe` contact shortSrv (LinkKey " 0123456789abcdef0123456789abcdef" )
296+ -- won't shorten link that uses only onion host from preset server
297+ shortenShortLink [srv] (contact srvOnion (LinkKey " 0123456789abcdef0123456789abcdef" ))
298+ `shouldBe` contact srvOnion (LinkKey " 0123456789abcdef0123456789abcdef" )
299+ -- will shorten link that uses only public host from preset server
300+ shortenShortLink [srv] (contact srv1 (LinkKey " 0123456789abcdef0123456789abcdef" ))
301+ `shouldBe` contact shortSrv (LinkKey " 0123456789abcdef0123456789abcdef" )
296302 shortenShortLink [srv] (contact srv2 (LinkKey " 0123456789abcdef0123456789abcdef" ))
297303 `shouldBe` contact srv2 (LinkKey " 0123456789abcdef0123456789abcdef" )
298304 restoreShortLink [srv] (contact shortSrv (LinkKey " 0123456789abcdef0123456789abcdef" ))
299305 `shouldBe` contact srv (LinkKey " 0123456789abcdef0123456789abcdef" )
306+ -- won't change link that has only public host of preset server with keyhash
307+ restoreShortLink [srv] (contact srv1 (LinkKey " 0123456789abcdef0123456789abcdef" ))
308+ `shouldBe` contact srv1 (LinkKey " 0123456789abcdef0123456789abcdef" )
300309 restoreShortLink [srv2] (contact shortSrv (LinkKey " 0123456789abcdef0123456789abcdef" ))
301310 `shouldBe` contact shortSrv (LinkKey " 0123456789abcdef0123456789abcdef" )
302311 restoreShortLink [srv] (contact srv2 (LinkKey " 0123456789abcdef0123456789abcdef" ))
@@ -307,5 +316,8 @@ connectionRequestTests =
307316shortSrv :: SMPServer
308317shortSrv = SMPServer " smp.simplex.im" " " (C. KeyHash " " )
309318
319+ srvOnion :: SMPServer
320+ srvOnion = SMPServer " jjbyvoemxysm7qxap7m5d5m35jzv5qq6gnlv7s4rsn7tdwwmuqciwpid.onion" " " (C. KeyHash " \215m\248\251" )
321+
310322srv2 :: SMPServer
311323srv2 = SMPServer " smp2.simplex.im,jjbyvoemxysm7qxap7m5d5m35jzv5qq6gnlv7s4rsn7tdwwmuqciwpid.onion" " " (C. KeyHash " \215m\248\251" )
0 commit comments