summaryrefslogtreecommitdiff
path: root/src/Message/Service.hs
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2019-12-07 22:35:55 +0100
committerRoman Smrž <roman.smrz@seznam.cz>2019-12-07 22:35:55 +0100
commit35347e4cfbd9070d1065b1ff9600013d648c5e6e (patch)
tree0f09520e841012b0a702ec4ea068b89983a0aa2a /src/Message/Service.hs
parent51bc5cd6948985ab294ed3216345d046f4aefc85 (diff)
Mergeable stored list
Diffstat (limited to 'src/Message/Service.hs')
-rw-r--r--src/Message/Service.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Message/Service.hs b/src/Message/Service.hs
index 044b882..1311e24 100644
--- a/src/Message/Service.hs
+++ b/src/Message/Service.hs
@@ -32,7 +32,8 @@ instance Service DirectMessageService where
-> do erb <- gets svcLocal
let st = storedStorage erb
erb' <- liftIO $ do
- slist <- case find (sameIdentity powner . msgPeer . fromStored) (storedFromSList $ lsMessages $ fromStored erb) of
+ threads <- storedFromSList $ lsMessages $ fromStored erb
+ slist <- case find (sameIdentity powner . msgPeer . fromStored) threads of
Just thread -> do thread' <- wrappedStore st (fromStored thread) { msgHead = smsg : msgHead (fromStored thread) }
slistReplaceS thread thread' $ lsMessages $ fromStored erb
Nothing -> slistAdd (emptyDirectThread powner) { msgHead = [smsg] } $ lsMessages $ fromStored erb