This commit is contained in:
spaced4ndy
2026-06-16 00:06:24 +04:00
parent 094c9d5d7b
commit 1c5b21dc26
2 changed files with 7 additions and 12 deletions
@@ -9,14 +9,14 @@ import Text.RawString.QQ (r)
m20260601_group_roster :: Text
m20260601_group_roster =
[r|
ALTER TABLE groups ADD COLUMN roster_version INTEGER;
ALTER TABLE groups ADD COLUMN roster_version BIGINT;
ALTER TABLE groups ADD COLUMN roster_msg_body BYTEA;
ALTER TABLE groups ADD COLUMN roster_msg_chat_binding TEXT;
ALTER TABLE groups ADD COLUMN roster_msg_signatures BYTEA;
ALTER TABLE groups ADD COLUMN roster_sending_owner_gm_id BIGINT;
ALTER TABLE groups ADD COLUMN roster_broker_ts TIMESTAMPTZ;
ALTER TABLE groups ADD COLUMN roster_blob BYTEA;
ALTER TABLE groups ADD COLUMN roster_pending_version INTEGER;
ALTER TABLE groups ADD COLUMN roster_pending_version BIGINT;
ALTER TABLE groups ADD COLUMN roster_pending_digest BYTEA;
ALTER TABLE groups ADD COLUMN roster_pending_msg_body BYTEA;
ALTER TABLE groups ADD COLUMN roster_pending_msg_chat_binding TEXT;
+5 -10
View File
@@ -2075,16 +2075,11 @@ newtype StoreCxt = StoreCxt {vr :: VersionRangeChat}
pattern VersionChat :: Word16 -> VersionChat
pattern VersionChat v = Version v
data RosterVersion
instance VersionScope RosterVersion
type VersionRoster = Version RosterVersion
pattern VersionRoster :: Word16 -> VersionRoster
pattern VersionRoster v = Version v
{-# COMPLETE VersionRoster #-}
-- A monotonic per-change counter, not a negotiated protocol version: Int64 rather than the Word16 of
-- Version, so a long-lived high-churn channel cannot wrap and be permanently rejected by relays (v >= cur).
newtype VersionRoster = VersionRoster Int64
deriving (Eq, Ord, Show)
deriving newtype (FromJSON, ToJSON, FromField, ToField)
-- this newtype exists to have a concise JSON encoding of version ranges in chat protocol messages in the form of "1-2" or just "1"
newtype ChatVersionRange = ChatVersionRange {fromChatVRange :: VersionRangeChat} deriving (Eq, Show)