summaryrefslogtreecommitdiff
path: root/src/Message.hs
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2020-12-20 21:47:22 +0100
committerRoman Smrž <roman.smrz@seznam.cz>2020-12-23 22:32:09 +0100
commit36b9a1ddbddf1477c61809d340cd0b86360a7a83 (patch)
tree7b327df1b1635270e98391ec1cf63478b8730793 /src/Message.hs
parent0c4c6618d43a8b7179f11b8edb1f289169b5f2bc (diff)
Network: STM-based synchronization rewrite
Diffstat (limited to 'src/Message.hs')
-rw-r--r--src/Message.hs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Message.hs b/src/Message.hs
index 874e375..2d00de2 100644
--- a/src/Message.hs
+++ b/src/Message.hs
@@ -115,8 +115,8 @@ findMsgProperty pid sel mss = concat $ flip findProperty mss $ \x -> do
sendDirectMessage :: (MonadIO m, MonadError String m) => Head LocalState -> Peer -> Text -> m (Stored DirectMessage)
sendDirectMessage h peer text = do
- pid <- case peerIdentity peer of PeerIdentityFull pid -> return pid
- _ -> throwError "incomplete peer identity"
+ pid <- peerIdentity peer >>= \case PeerIdentityFull pid -> return pid
+ _ -> throwError "incomplete peer identity"
let st = refStorage $ headRef h
self = headLocalIdentity h
powner = finalOwner pid