mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-08-28 09:44:15 +00:00
fix test
This commit is contained in:
+1
-1
@@ -95,7 +95,7 @@ library
|
||||
Simplex.Chat.Options.Postgres
|
||||
Simplex.Chat.Store.Postgres.Migrations
|
||||
Simplex.Chat.Store.Postgres.Migrations.M20241220_initial
|
||||
-- Simplex.Chat.Store.Postgres.Migrations.M20250227_member_acceptance
|
||||
Simplex.Chat.Store.Postgres.Migrations.M20250227_member_acceptance
|
||||
else
|
||||
exposed-modules:
|
||||
Simplex.Chat.Archive
|
||||
|
||||
@@ -5,11 +5,13 @@ module Simplex.Chat.Store.Postgres.Migrations (migrations) where
|
||||
import Data.List (sortOn)
|
||||
import Data.Text (Text)
|
||||
import Simplex.Chat.Store.Postgres.Migrations.M20241220_initial
|
||||
import Simplex.Chat.Store.Postgres.Migrations.M20250227_member_acceptance
|
||||
import Simplex.Messaging.Agent.Store.Shared (Migration (..))
|
||||
|
||||
schemaMigrations :: [(String, Text, Maybe Text)]
|
||||
schemaMigrations =
|
||||
[ ("20241220_initial", m20241220_initial, Nothing)
|
||||
[ ("20241220_initial", m20241220_initial, Nothing),
|
||||
("20250227_member_acceptance", m20250227_member_acceptance, Just down_m20250227_member_acceptance)
|
||||
]
|
||||
|
||||
-- | The list of migrations in ascending order by date
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
{-# LANGUAGE QuasiQuotes #-}
|
||||
|
||||
module Simplex.Chat.Store.Postgres.Migrations.M20250227_member_acceptance where
|
||||
|
||||
import Data.Text (Text)
|
||||
import qualified Data.Text as T
|
||||
import Text.RawString.QQ (r)
|
||||
|
||||
m20250227_member_acceptance :: Text
|
||||
m20250227_member_acceptance =
|
||||
T.pack
|
||||
[r|
|
||||
ALTER TABLE user_contact_links ADD COLUMN group_link_auto_accept TEXT NULL;
|
||||
|]
|
||||
|
||||
down_m20250227_member_acceptance :: Text
|
||||
down_m20250227_member_acceptance =
|
||||
T.pack
|
||||
[r|
|
||||
ALTER TABLE user_contact_links DROP COLUMN group_link_auto_accept;
|
||||
|]
|
||||
@@ -495,7 +495,7 @@ getUserContactLinkById db userId userContactLinkId =
|
||||
DB.query
|
||||
db
|
||||
[sql|
|
||||
SELECT conn_req_contact, auto_accept, business_address, auto_accept_incognito, auto_reply_msg_content, group_id, group_link_member_role, group_link_auto_accept
|
||||
SELECT conn_req_contact, auto_accept, business_address, auto_accept_incognito, auto_reply_msg_content, group_id, group_link_auto_accept, group_link_member_role
|
||||
FROM user_contact_links
|
||||
WHERE user_id = ?
|
||||
AND user_contact_link_id = ?
|
||||
|
||||
@@ -998,11 +998,11 @@ data GroupMemberStatus
|
||||
| GSMemGroupDeleted -- user member of the deleted group
|
||||
| GSMemUnknown -- unknown member, whose message was forwarded by an admin (likely member wasn't introduced due to not being a current member, but message was included in history)
|
||||
| GSMemInvited -- member is sent to or received invitation to join the group
|
||||
| GSMemPendingApproval -- member is connected to host but pending host approval before connecting to other members ("knocking")
|
||||
| GSMemIntroduced -- user received x.grp.mem.intro for this member (only with GCPreMember)
|
||||
| GSMemIntroInvited -- member is sent to or received from intro invitation
|
||||
| GSMemAccepted -- member accepted invitation (only User and Invitee)
|
||||
| GSMemAnnounced -- host announced (x.grp.mem.new) a member (Invitee and PostMember) to the group - at this point this member can send messages and invite other members (if they have sufficient permissions)
|
||||
| GSMemPendingApproval -- member is connected to host but pending host approval before connecting to other members ("knocking")
|
||||
| GSMemConnected -- member created the group connection with the inviting member
|
||||
| GSMemComplete -- host confirmed (x.grp.mem.all) that a member (User, Invitee and PostMember) created group connections with all previous members
|
||||
| GSMemCreator -- user member that created the group (only GCUserMember)
|
||||
@@ -1027,11 +1027,11 @@ memberActive m = case memberStatus m of
|
||||
GSMemGroupDeleted -> False
|
||||
GSMemUnknown -> False
|
||||
GSMemInvited -> False
|
||||
GSMemPendingApproval -> False -- TODO [knocking] True?
|
||||
GSMemIntroduced -> False
|
||||
GSMemIntroInvited -> False
|
||||
GSMemAccepted -> False
|
||||
GSMemAnnounced -> False
|
||||
GSMemPendingApproval -> True -- TODO [knocking] False?
|
||||
GSMemConnected -> True
|
||||
GSMemComplete -> True
|
||||
GSMemCreator -> True
|
||||
@@ -1048,11 +1048,11 @@ memberCurrent' = \case
|
||||
GSMemGroupDeleted -> False
|
||||
GSMemUnknown -> False
|
||||
GSMemInvited -> False
|
||||
GSMemPendingApproval -> False -- TODO [knocking] True?
|
||||
GSMemIntroduced -> True
|
||||
GSMemIntroInvited -> True
|
||||
GSMemAccepted -> True
|
||||
GSMemAnnounced -> True
|
||||
GSMemPendingApproval -> True -- TODO [knocking] False
|
||||
GSMemConnected -> True
|
||||
GSMemComplete -> True
|
||||
GSMemCreator -> True
|
||||
@@ -1065,11 +1065,11 @@ memberRemoved m = case memberStatus m of
|
||||
GSMemGroupDeleted -> True
|
||||
GSMemUnknown -> False
|
||||
GSMemInvited -> False
|
||||
GSMemPendingApproval -> False
|
||||
GSMemIntroduced -> False
|
||||
GSMemIntroInvited -> False
|
||||
GSMemAccepted -> False
|
||||
GSMemAnnounced -> False
|
||||
GSMemPendingApproval -> False
|
||||
GSMemConnected -> False
|
||||
GSMemComplete -> False
|
||||
GSMemCreator -> False
|
||||
@@ -1082,11 +1082,11 @@ instance TextEncoding GroupMemberStatus where
|
||||
"deleted" -> Just GSMemGroupDeleted
|
||||
"unknown" -> Just GSMemUnknown
|
||||
"invited" -> Just GSMemInvited
|
||||
"pending_approval" -> Just GSMemPendingApproval
|
||||
"introduced" -> Just GSMemIntroduced
|
||||
"intro-inv" -> Just GSMemIntroInvited
|
||||
"accepted" -> Just GSMemAccepted
|
||||
"announced" -> Just GSMemAnnounced
|
||||
"pending_approval" -> Just GSMemPendingApproval
|
||||
"connected" -> Just GSMemConnected
|
||||
"complete" -> Just GSMemComplete
|
||||
"creator" -> Just GSMemCreator
|
||||
@@ -1098,11 +1098,11 @@ instance TextEncoding GroupMemberStatus where
|
||||
GSMemGroupDeleted -> "deleted"
|
||||
GSMemUnknown -> "unknown"
|
||||
GSMemInvited -> "invited"
|
||||
GSMemPendingApproval -> "pending_approval"
|
||||
GSMemIntroduced -> "introduced"
|
||||
GSMemIntroInvited -> "intro-inv"
|
||||
GSMemAccepted -> "accepted"
|
||||
GSMemAnnounced -> "announced"
|
||||
GSMemPendingApproval -> "pending_approval"
|
||||
GSMemConnected -> "connected"
|
||||
GSMemComplete -> "complete"
|
||||
GSMemCreator -> "creator"
|
||||
|
||||
Reference in New Issue
Block a user