mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-08-29 01:09:15 +00:00
core, ui: prohibit changing profile for prepared entity when first attempt to connect failed (#6037)
* core: prohibit changing profile for prepared entity when first attempt to connect failed * reuse incognito * schema * ios * postgres schema * ios * reenable tests * kotlin * update alert * rename predicate, combine queries * send the correct incognito mode, fail on attempt to change mode for prepared connection * query plans * ui: show group connecting status --------- Co-authored-by: Evgeny Poberezkin <evgeny@poberezkin.com>
This commit is contained in:
co-authored by
Evgeny Poberezkin
parent
e5d3029edf
commit
2dd54c6697
@@ -176,7 +176,7 @@ createConnReqConnection db userId acId preparedEntity_ cReqHash sLnk xContactId
|
||||
)
|
||||
connId <- insertedRowId db
|
||||
case preparedEntity_ of
|
||||
Just (PCEGroup gInfo _) -> updatePreparedGroup gInfo connId customUserProfileId currentTs
|
||||
Just (PCEGroup gInfo _) -> updatePreparedGroup gInfo customUserProfileId currentTs
|
||||
_ -> pure ()
|
||||
pure
|
||||
Connection
|
||||
@@ -214,8 +214,11 @@ createConnReqConnection db userId acId preparedEntity_ cReqHash sLnk xContactId
|
||||
Just (PCEContact Contact {contactId}) -> (ConnContact, Just contactId, Nothing, Just contactId)
|
||||
Just (PCEGroup _ GroupMember {groupMemberId}) -> (ConnMember, Nothing, Just groupMemberId, Just groupMemberId)
|
||||
Nothing -> (ConnContact, Nothing, Nothing, Nothing)
|
||||
updatePreparedGroup GroupInfo {groupId, membership} pccConnId customUserProfileId currentTs = do
|
||||
setViaGroupLinkHash db groupId pccConnId
|
||||
updatePreparedGroup GroupInfo {groupId, membership} customUserProfileId currentTs = do
|
||||
DB.execute
|
||||
db
|
||||
"UPDATE groups SET via_group_link_uri_hash = ?, conn_link_prepared_connection = ?, updated_at = ? WHERE group_id = ?"
|
||||
(cReqHash, BI True, currentTs, groupId)
|
||||
when (isJust customUserProfileId) $
|
||||
DB.execute
|
||||
db
|
||||
|
||||
Reference in New Issue
Block a user