core: support receiving file by id for any user (not only current) (#1759)

This commit is contained in:
JRoberts
2023-01-16 17:51:25 +04:00
committed by GitHub
parent df6cec6a32
commit 3ed5e6e50b
2 changed files with 15 additions and 3 deletions
+2 -2
View File
@@ -1247,9 +1247,9 @@ processChatCommand = \case
processChatCommand . APISendMessage chatRef False $ ComposedMessage (Just f) Nothing (MCImage "" fixedImagePreview)
ForwardFile chatName fileId -> forwardFile chatName fileId SendFile
ForwardImage chatName fileId -> forwardFile chatName fileId SendImage
ReceiveFile fileId rcvInline_ filePath_ -> withUser $ \user ->
ReceiveFile fileId rcvInline_ filePath_ -> withUser $ \_ ->
withChatLock "receiveFile" . procCmd $ do
ft <- withStore $ \db -> getRcvFileTransfer db user fileId
(user, ft) <- withStore $ \db -> getRcvFileTransferById db fileId
(CRRcvFileAccepted user <$> acceptFileReceive user ft rcvInline_ filePath_) `catchError` processError user ft
where
processError user ft = \case