summaryrefslogtreecommitdiff
path: root/src/Main.hs
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2023-07-17 21:30:21 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2023-07-19 23:26:39 +0200
commitaa83cb804105594d43c2002352f2b1d9f9db3c45 (patch)
treef1f1caa82ca74ce5d9c628e91f43e47999177692 /src/Main.hs
parent95449bb4b93cf10468c47b27f20396d916c46778 (diff)
Send direct messages using identity
Diffstat (limited to 'src/Main.hs')
-rw-r--r--src/Main.hs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/Main.hs b/src/Main.hs
index aee0cc6..a84e820 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -303,7 +303,10 @@ cmdSend :: Command
cmdSend = void $ do
Just peer <- gets csPeer
text <- asks ciLine
- smsg <- sendDirectMessage peer $ T.pack text
+ powner <- peerIdentity peer >>= \case
+ PeerIdentityFull pid -> return $ finalOwner pid
+ _ -> throwError "incomplete peer identity"
+ smsg <- sendDirectMessage powner $ T.pack text
tzone <- liftIO $ getCurrentTimeZone
liftIO $ putStrLn $ formatMessage tzone $ fromStored smsg