mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-07-18 07:56:13 +00:00
* core: forward notifications about message processing (for iOS notifications) * simplexmq * the option to keep database key, to allow re-opening the database * export new init with keepKey and reopen DB api * stop remote ctrl when suspending chat * ios: close/re-open db on suspend/activate * allow activating chat without restoring (for NSE) * update NSE to suspend/activate (does not work) * simplexmq * suspend chat and close database when last notification in the process is processed * stop reading notifications on message markers * replace async stream with cancellable concurrent queue * better synchronization of app and NSE * remove outside of task * remove unused var * whitespace * more debug logging, handle cancelled read after dequeue * comments * more comments
29 lines
901 B
Haskell
29 lines
901 B
Haskell
module Simplex.Chat.Store
|
|
( SQLiteStore,
|
|
StoreError (..),
|
|
UserMsgReceiptSettings (..),
|
|
UserContactLink (..),
|
|
AutoAccept (..),
|
|
createChatStore,
|
|
migrations, -- used in tests
|
|
chatStoreFile,
|
|
agentStoreFile,
|
|
withTransaction,
|
|
)
|
|
where
|
|
|
|
import Data.ByteArray (ScrubbedBytes)
|
|
import Simplex.Chat.Store.Migrations
|
|
import Simplex.Chat.Store.Profiles
|
|
import Simplex.Chat.Store.Shared
|
|
import Simplex.Messaging.Agent.Store.SQLite (MigrationConfirmation, MigrationError, SQLiteStore (..), createSQLiteStore, withTransaction)
|
|
|
|
createChatStore :: FilePath -> ScrubbedBytes -> Bool -> MigrationConfirmation -> IO (Either MigrationError SQLiteStore)
|
|
createChatStore dbPath key keepKey = createSQLiteStore dbPath key keepKey migrations
|
|
|
|
chatStoreFile :: FilePath -> FilePath
|
|
chatStoreFile = (<> "_chat.db")
|
|
|
|
agentStoreFile :: FilePath -> FilePath
|
|
agentStoreFile = (<> "_agent.db")
|