|
35 | 35 |
|
36 | 36 | module API.Federation where
|
37 | 37 |
|
| 38 | +import API.MLS.Util |
38 | 39 | import API.Util
|
39 | 40 | import Bilge
|
40 | 41 | import Bilge.Assert
|
@@ -63,6 +64,7 @@ import Federator.MockServer (FederatedRequest (..))
|
63 | 64 | import Galley.Types
|
64 | 65 | import Galley.Types.Conversations.Intra
|
65 | 66 | import Imports
|
| 67 | +import System.IO.Temp |
66 | 68 | import Test.QuickCheck (arbitrary, generate)
|
67 | 69 | import Test.Tasty
|
68 | 70 | import qualified Test.Tasty.Cannon as WS
|
@@ -106,7 +108,8 @@ tests s =
|
106 | 108 | test s "POST /federation/on-message-sent : Receive a message from another backend" onMessageSent,
|
107 | 109 | test s "POST /federation/send-message : Post a message sent from another backend" sendMessage,
|
108 | 110 | test s "POST /federation/on-user-deleted-conversations : Remove deleted remote user from local conversations" onUserDeleted,
|
109 |
| - test s "POST /federation/update-conversation : Update local conversation by a remote admin " updateConversationByRemoteAdmin |
| 111 | + test s "POST /federation/update-conversation : Update local conversation by a remote admin " updateConversationByRemoteAdmin, |
| 112 | + test s "POST /federation/mls-welcome : Post an MLS welcome message from another backend" sendMLSWelcome |
110 | 113 | ]
|
111 | 114 |
|
112 | 115 | getConversationsAllFound :: TestM ()
|
@@ -1158,6 +1161,13 @@ updateConversationByRemoteAdmin = do
|
1158 | 1161 | let convUpdate :: ConversationUpdate = fromRight (error $ "Could not parse ConversationUpdate from " <> show (frBody rpc)) $ A.eitherDecode (frBody rpc)
|
1159 | 1162 | pure (rpc, convUpdate)
|
1160 | 1163 |
|
| 1164 | +sendMLSWelcome :: TestM () |
| 1165 | +sendMLSWelcome = withSystemTempDirectory "mls" $ \tmp -> do |
| 1166 | + -- add bob to it and get welcome message |
| 1167 | + let bob = undefined |
| 1168 | + (_commit, _welcome) <- liftIO $ setupCommit tmp "group" "group" (pClients bob) |
| 1169 | + undefined |
| 1170 | + |
1161 | 1171 | getConvAction :: Sing tag -> SomeConversationAction -> Maybe (ConversationAction tag)
|
1162 | 1172 | getConvAction tquery (SomeConversationAction tag action) =
|
1163 | 1173 | case (tag, tquery) of
|
|
0 commit comments