"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "services/galley/src/Galley/API/Create.hs" between
wire-server-2020-06-10.tar.gz and wire-server-2020-06-19.tar.gz

About: Wire (server) offers end-to-end encrypted messaging, file-sharing, video and voice calls, and guest rooms for external communication (back-end server).

Create.hs  (wire-server-2020-06-10):Create.hs  (wire-server-2020-06-19)
skipping to change at line 238 skipping to change at line 238
notifyCreatedConversation Nothing usr conn c notifyCreatedConversation Nothing usr conn c
for_ (newPush ListComplete (evtFrom e) (ConvEvent e) (recipient <$> Data.c onvMembers c)) $ \p -> for_ (newPush ListComplete (evtFrom e) (ConvEvent e) (recipient <$> Data.c onvMembers c)) $ \p ->
push1 $ push1 $
p p
& pushRoute .~ RouteDirect & pushRoute .~ RouteDirect
& pushConn .~ conn & pushConn .~ conn
conversationCreated usr c conversationCreated usr c
update n conv = update n conv =
let mems = Data.convMembers conv let mems = Data.convMembers conv
in conversationExisted usr in conversationExisted usr
=<< if | makeIdOpaque usr `isMember` mems -> =<< if | Local usr `isMember` mems ->
-- we already were in the conversation, maybe also other -- we already were in the conversation, maybe also other
connect n conv connect n conv
| otherwise -> do | otherwise -> do
now <- liftIO getCurrentTime now <- liftIO getCurrentTime
mm <- snd <$> Data.addMember now (Data.convId conv) usr mm <- snd <$> Data.addMember now (Data.convId conv) usr
let conv' = let conv' =
conv conv
{ Data.convMembers = Data.convMembers conv <> toLis t mm { Data.convMembers = Data.convMembers conv <> toLis t mm
} }
if null mems if null mems
skipping to change at line 283 skipping to change at line 283
| otherwise = return conv | otherwise = return conv
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
-- Helpers -- Helpers
data ConversationResponse data ConversationResponse
= ConversationCreated !Public.Conversation = ConversationCreated !Public.Conversation
| ConversationExisted !Public.Conversation | ConversationExisted !Public.Conversation
conversationCreated :: UserId -> Data.Conversation -> Galley ConversationRespons e conversationCreated :: UserId -> Data.Conversation -> Galley ConversationRespons e
conversationCreated usr cnv = ConversationCreated <$> conversationView usr cnv conversationCreated usr cnv = ConversationCreated <$> conversationView (Local us r) cnv
conversationExisted :: UserId -> Data.Conversation -> Galley ConversationRespons e conversationExisted :: UserId -> Data.Conversation -> Galley ConversationRespons e
conversationExisted usr cnv = ConversationExisted <$> conversationView usr cnv conversationExisted usr cnv = ConversationExisted <$> conversationView (Local us r) cnv
handleConversationResponse :: ConversationResponse -> Response handleConversationResponse :: ConversationResponse -> Response
handleConversationResponse = \case handleConversationResponse = \case
ConversationCreated cnv -> json cnv & setStatus status201 . location (cnvId cn v) ConversationCreated cnv -> json cnv & setStatus status201 . location (cnvId cn v)
ConversationExisted cnv -> json cnv & setStatus status200 . location (cnvId cn v) ConversationExisted cnv -> json cnv & setStatus status200 . location (cnvId cn v)
notifyCreatedConversation :: Maybe UTCTime -> UserId -> Maybe ConnId -> Data.Con versation -> Galley () notifyCreatedConversation :: Maybe UTCTime -> UserId -> Maybe ConnId -> Data.Con versation -> Galley ()
notifyCreatedConversation dtime usr conn c = do notifyCreatedConversation dtime usr conn c = do
now <- maybe (liftIO getCurrentTime) pure dtime now <- maybe (liftIO getCurrentTime) pure dtime
pushSome =<< mapM (toPush now) (Data.convMembers c) pushSome =<< mapM (toPush now) (Data.convMembers c)
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)