mirror of
https://github.com/simplex-chat/simplexmq.git
synced 2026-04-25 12:02:18 +00:00
Merge branch 'master' into ep/rfc-rotation
This commit is contained in:
@@ -397,7 +397,9 @@ acceptContact' c connId enableNtfs invId ownConnInfo = do
|
||||
withStore c (`getConn` contactConnId) >>= \case
|
||||
SomeConn _ ContactConnection {} -> do
|
||||
withStore' c $ \db -> acceptInvitation db invId ownConnInfo
|
||||
joinConn c connId enableNtfs connReq ownConnInfo
|
||||
joinConn c connId enableNtfs connReq ownConnInfo `catchError` \err -> do
|
||||
withStore' c (`unacceptInvitation` invId)
|
||||
throwError err
|
||||
_ -> throwError $ CMD PROHIBITED
|
||||
|
||||
-- | Reject contact (RJCT command) in Reader monad
|
||||
|
||||
@@ -51,6 +51,7 @@ module Simplex.Messaging.Agent.Store.SQLite
|
||||
createInvitation,
|
||||
getInvitation,
|
||||
acceptInvitation,
|
||||
unacceptInvitation,
|
||||
deleteInvitation,
|
||||
-- Messages
|
||||
updateRcvIds,
|
||||
@@ -548,6 +549,10 @@ acceptInvitation db invitationId ownConnInfo =
|
||||
":invitation_id" := invitationId
|
||||
]
|
||||
|
||||
unacceptInvitation :: DB.Connection -> InvitationId -> IO ()
|
||||
unacceptInvitation db invitationId =
|
||||
DB.execute db "UPDATE conn_invitations SET accepted = 0, own_conn_info = NULL WHERE invitation_id = ?" (Only invitationId)
|
||||
|
||||
deleteInvitation :: DB.Connection -> ConnId -> InvitationId -> IO (Either StoreError ())
|
||||
deleteInvitation db contactConnId invId =
|
||||
getConn db contactConnId $>>= \case
|
||||
|
||||
Reference in New Issue
Block a user