process badges

This commit is contained in:
Evgeny @ SimpleX Chat
2026-06-04 15:51:51 +00:00
parent 98ecff7943
commit a9bea25b7f
16 changed files with 310 additions and 180 deletions
+9
View File
@@ -34,6 +34,7 @@ import Simplex.Chat.Store.Profiles
import Simplex.Chat.Store.Shared
import Simplex.Chat.Operators
import Simplex.Messaging.Agent.Store.Entity (DBStored (..))
import Simplex.Chat.Badges (LocalBadge (..), BadgeStatus (..), SupporterBadge (..), BadgeType (..))
import Simplex.Chat.Types
import Simplex.Chat.Types.Preferences
import Simplex.Chat.Types.Shared
@@ -216,6 +217,8 @@ chatTypesDocsData =
(sti @ChatDeleteMode, STUnion, "CDM", [], Param "type" <> Choice "self" [("messages", "")] (OnOffParam "notify" "notify" (Just True)), ""),
(sti @ChatError, STUnion, "Chat", ["ChatErrorDatabase", "ChatErrorRemoteHost", "ChatErrorRemoteCtrl"], "", ""),
(sti @ChatErrorType, STUnion, "CE", ["CEContactNotFound", "CEServerProtocol", "CECallState", "CEInvalidChatMessage"], "", ""),
(sti @BadgeStatus, STEnum, "BS", [], "", ""),
(sti @BadgeType, STEnum, "BT", ["BTUnknown"], "", ""),
(sti @ChatFeature, STEnum, "CF", [], "", ""),
(sti @ChatItemDeletion, STRecord, "", [], "", "Message deletion result."),
(sti @ChatPeerType, STEnum, "CPT", [], "", ""),
@@ -303,6 +306,7 @@ chatTypesDocsData =
(sti @LinkContent, STUnion, "LC", [], "", ""),
(sti @LinkOwnerSig, STRecord, "", [], "", ""),
(sti @LinkPreview, STRecord, "", [], "", ""),
(sti @LocalBadge, STRecord, "", [], "", ""),
(sti @LocalProfile, STRecord, "", [], "", ""),
(sti @MemberCriteria, STEnum1, "MC", [], "", ""),
(sti @MsgChatLink, STUnion, "MCL", [], "", "Connection link sent in a message - only short links are allowed."),
@@ -360,6 +364,7 @@ chatTypesDocsData =
(sti @SrvError, STUnion, "SrvErr", [], "", ""),
(sti @StoreError, STUnion, "SE", [], "", ""),
(sti @SubscriptionStatus, STUnion, "SS", [], "", ""),
(sti @SupporterBadge, STRecord, "", [], "", ""),
(sti @SupportGroupPreference, STRecord, "", [], "", ""),
(sti @SwitchPhase, STEnum, "SP", [], "", ""),
(sti @TimedMessagesGroupPreference, STRecord, "", [], "", ""),
@@ -427,6 +432,8 @@ deriving instance Generic BlockingReason
deriving instance Generic BrokerErrorType
deriving instance Generic BusinessChatInfo
deriving instance Generic BusinessChatType
deriving instance Generic BadgeStatus
deriving instance Generic BadgeType
deriving instance Generic ChatBotCommand
deriving instance Generic ChatDeleteMode
deriving instance Generic ChatError
@@ -524,6 +531,7 @@ deriving instance Generic JSONCIStatus
deriving instance Generic LinkContent
deriving instance Generic LinkOwnerSig
deriving instance Generic LinkPreview
deriving instance Generic LocalBadge
deriving instance Generic LocalProfile
deriving instance Generic MemberCriteria
deriving instance Generic MsgChatLink
@@ -550,6 +558,7 @@ deriving instance Generic ProxyClientError
deriving instance Generic ProxyError
deriving instance Generic PublicGroupAccess
deriving instance Generic PublicGroupData
deriving instance Generic SupporterBadge
deriving instance Generic PublicGroupProfile
deriving instance Generic RatchetSyncState
deriving instance Generic RCErrorType
+1 -1
View File
@@ -67,7 +67,7 @@ pattern TUTCTime :: String
pattern TUTCTime = "UTCTime"
primitiveTypes :: [ConsName]
primitiveTypes = [TBool, TString, TInt, TInt64, TWord32, TDouble, TJSONObject, TUTCTime]
primitiveTypes = [TBool, TString, TInt, TInt64, TWord32, TDouble, TJSONObject, TUTCTime, "BBSProof", "BBSPresHeader", "ByteString"]
data SumTypeInfo = STI {typeName :: String, recordTypes :: [RecordTypeInfo]}
deriving (Show)