From 35347e4cfbd9070d1065b1ff9600013d648c5e6e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Roman=20Smr=C5=BE?= <roman.smrz@seznam.cz>
Date: Sat, 7 Dec 2019 22:35:55 +0100
Subject: Mergeable stored list

---
 src/Message/Service.hs | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

(limited to 'src/Message')

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
-- 
cgit v1.2.3