From 0e2cd8c9e94a66bd34c2e884f8f5cf678199f17f Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Thu, 13 Dec 2018 14:51:09 -0800 Subject: [PATCH] Store ephemeral events --- src/Scylla/Sync.elm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Scylla/Sync.elm b/src/Scylla/Sync.elm index f8b33d5..c60a33c 100644 --- a/src/Scylla/Sync.elm +++ b/src/Scylla/Sync.elm @@ -309,11 +309,15 @@ mergeState s1 s2 = State <| mergeMaybe mergeStateEvents s1.events s2.events mergeTimeline : Timeline -> Timeline -> Timeline mergeTimeline t1 t2 = Timeline (mergeMaybe mergeRoomEvents t1.events t2.events) Nothing t2.prevBatch +mergeEphemeral : Ephemeral -> Ephemeral -> Ephemeral +mergeEphemeral e1 e2 = Ephemeral <| mergeMaybe mergeEvents e1.events e2.events + mergeJoinedRoom : JoinedRoom -> JoinedRoom -> JoinedRoom mergeJoinedRoom r1 r2 = { r2 | state = mergeMaybe mergeState r1.state r2.state , timeline = mergeMaybe mergeTimeline r1.timeline r2.timeline , accountData = mergeMaybe mergeAccountData r1.accountData r2.accountData + , ephemeral = mergeMaybe mergeEphemeral r1.ephemeral r2.ephemeral } mergeInviteState : InviteState -> InviteState -> InviteState