diff --git a/src/Simplex/Chat/Library/Subscriber.hs b/src/Simplex/Chat/Library/Subscriber.hs index c012822849..5d29253f88 100644 --- a/src/Simplex/Chat/Library/Subscriber.hs +++ b/src/Simplex/Chat/Library/Subscriber.hs @@ -3216,7 +3216,7 @@ runDeliveryJobWorker a deliveryKey Worker {doWork} = do MessageDeliveryJob {jobId, jobScope, singleSenderGMId_, body, cursorGMId_ = startingCursor} = job sendBodyToMembers :: CM () sendBodyToMembers - | useRelays gInfo = -- channel + | isTrue (useRelays gInfo) = -- channel case jobScope of -- there's no member review in channels, so job spec includePending is ignored DJSGroup {} -> sendLoop startingCursor diff --git a/src/Simplex/Chat/Store/Delivery.hs b/src/Simplex/Chat/Store/Delivery.hs index 632231adef..4779572679 100644 --- a/src/Simplex/Chat/Store/Delivery.hs +++ b/src/Simplex/Chat/Store/Delivery.hs @@ -164,7 +164,7 @@ getNextDeliveryTasks db gInfo task = MessageDeliveryTask {jobScope, senderGMId} = task getTaskIds :: IO [Int64] getTaskIds - | useRelays = + | isTrue useRelays = map fromOnly <$> DB.query db diff --git a/src/Simplex/Chat/Store/Groups.hs b/src/Simplex/Chat/Store/Groups.hs index 30d1e799e0..1fc773738a 100644 --- a/src/Simplex/Chat/Store/Groups.hs +++ b/src/Simplex/Chat/Store/Groups.hs @@ -339,7 +339,7 @@ createNewGroup db vr gVar user@User {userId} groupProfile incognitoProfile = Exc pure GroupInfo { groupId, - useRelays = False, + useRelays = BoolDef False, localDisplayName = ldn, groupProfile, localAlias = "", @@ -414,7 +414,7 @@ createGroupInvitation db vr user@User {userId} contact@Contact {contactId, activ pure ( GroupInfo { groupId, - useRelays = False, + useRelays = BoolDef False, localDisplayName, groupProfile, localAlias = "", diff --git a/src/Simplex/Chat/Store/Shared.hs b/src/Simplex/Chat/Store/Shared.hs index 21c2d354f3..7475165533 100644 --- a/src/Simplex/Chat/Store/Shared.hs +++ b/src/Simplex/Chat/Store/Shared.hs @@ -669,7 +669,7 @@ toGroupInfo vr userContactId chatTags ((groupId, localDisplayName, displayName, businessChat = toBusinessChatInfo businessRow preparedGroup = toPreparedGroup preparedGroupRow groupSummary = GroupSummary {currentMembers} - in GroupInfo {groupId, useRelays = False, localDisplayName, groupProfile, localAlias, businessChat, fullGroupPreferences, membership, chatSettings, createdAt, updatedAt, chatTs, userMemberProfileSentAt, preparedGroup, chatTags, chatItemTTL, uiThemes, groupSummary, customData, membersRequireAttention, viaGroupLinkUri} + in GroupInfo {groupId, useRelays = BoolDef False, localDisplayName, groupProfile, localAlias, businessChat, fullGroupPreferences, membership, chatSettings, createdAt, updatedAt, chatTs, userMemberProfileSentAt, preparedGroup, chatTags, chatItemTTL, uiThemes, groupSummary, customData, membersRequireAttention, viaGroupLinkUri} toPreparedGroup :: PreparedGroupRow -> Maybe PreparedGroup toPreparedGroup = \case diff --git a/src/Simplex/Chat/Types.hs b/src/Simplex/Chat/Types.hs index 198fdf8293..2cc67d1ff8 100644 --- a/src/Simplex/Chat/Types.hs +++ b/src/Simplex/Chat/Types.hs @@ -446,7 +446,7 @@ type GroupId = Int64 data GroupInfo = GroupInfo { groupId :: GroupId, - useRelays :: Bool, + useRelays :: BoolDef, localDisplayName :: GroupName, groupProfile :: GroupProfile, localAlias :: Text, @@ -2030,7 +2030,11 @@ $(JQ.deriveJSON defaultJSON ''BusinessChatInfo) $(JQ.deriveJSON defaultJSON ''PreparedGroup) -$(JQ.deriveJSON defaultJSON ''GroupSummary) +$(JQ.deriveToJSON defaultJSON ''GroupSummary) + +instance FromJSON GroupSummary where + parseJSON = $(JQ.mkParseJSON defaultJSON ''GroupSummary) + omittedField = Just GroupSummary {currentMembers = 0} $(JQ.deriveJSON defaultJSON ''GroupInfo)