mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-05-25 02:05:40 +00:00
core: auto accept via address and incognito mode specified (#1233)
* core: Auto accept via address and incognito mode specified * Fix test * Refactoring * No forcing * Apply suggestions from code review * refactor * refactor AutoAccept * Test * Test * allow different test output order * rename * rename Co-authored-by: Evgeny Poberezkin <2769109+epoberezkin@users.noreply.github.com> Co-authored-by: JRoberts <8711996+jr-simplex@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
5bcb725ea5
commit
1470b8d128
+6
-3
@@ -1,17 +1,20 @@
|
||||
{-# LANGUAGE QuasiQuotes #-}
|
||||
|
||||
module Simplex.Chat.Migrations.M20221021_connections_via_group_link where
|
||||
module Simplex.Chat.Migrations.M20221021_auto_accept__group_links where
|
||||
|
||||
import Database.SQLite.Simple (Query)
|
||||
import Database.SQLite.Simple.QQ (sql)
|
||||
|
||||
m20221021_connections_via_group_link :: Query
|
||||
m20221021_connections_via_group_link =
|
||||
m20221021_auto_accept__group_links :: Query
|
||||
m20221021_auto_accept__group_links =
|
||||
[sql|
|
||||
PRAGMA ignore_check_constraints=ON;
|
||||
|
||||
ALTER TABLE connections ADD COLUMN via_group_link INTEGER DEFAULT 0 CHECK (via_group_link NOT NULL); -- flag, 1 for connections via group link
|
||||
UPDATE connections SET via_group_link = 0;
|
||||
|
||||
ALTER TABLE user_contact_links ADD column auto_accept_incognito INTEGER DEFAULT 0 CHECK (auto_accept_incognito NOT NULL);
|
||||
UPDATE user_contact_links SET auto_accept_incognito = 0;
|
||||
|
||||
PRAGMA ignore_check_constraints=OFF;
|
||||
|]
|
||||
@@ -268,6 +268,7 @@ CREATE TABLE user_contact_links(
|
||||
auto_accept INTEGER DEFAULT 0,
|
||||
auto_reply_msg_content TEXT DEFAULT NULL,
|
||||
group_id INTEGER REFERENCES groups ON DELETE CASCADE,
|
||||
auto_accept_incognito INTEGER DEFAULT 0 CHECK(auto_accept_incognito NOT NULL),
|
||||
UNIQUE(user_id, local_display_name)
|
||||
);
|
||||
CREATE TABLE contact_requests(
|
||||
|
||||
Reference in New Issue
Block a user