mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-10-01 10:49:11 +00:00
fixes
This commit is contained in:
@@ -47,7 +47,7 @@ import Simplex.Messaging.Agent.Protocol
|
||||
import Simplex.Messaging.Client
|
||||
import Simplex.Messaging.Crypto.File
|
||||
import Simplex.Messaging.Parsers (dropPrefix, fstToLower)
|
||||
import Simplex.Messaging.Protocol (BlockingInfo (..), BlockingReason (..), CommandError (..), ErrorType (..), NameErrorType (..), NetworkError (..), ProxyError (..))
|
||||
import Simplex.Messaging.Protocol (BlockingInfo (..), BlockingReason (..), CommandError (..), ErrorType (..), NameErrorType (..), NamePricing (..), NameRecord (..), NameRegistration (..), NameReservedReason (..), NetworkError (..), ProxyError (..))
|
||||
import Simplex.Messaging.Protocol.Types (ClientNotice (..))
|
||||
import Simplex.Messaging.Transport
|
||||
import Simplex.Chat.Remote.Types (CtrlAppInfo (..))
|
||||
@@ -183,6 +183,14 @@ ciQuoteType =
|
||||
updateRecord (RecordTypeInfo name fields) = RecordTypeInfo name $ map optChatDir fields
|
||||
in st {recordTypes = map updateRecord records} -- need to map even though there is one constructor in this type
|
||||
|
||||
-- JSON field names drop the "nr" prefix, as NameRecord's deriveJSON does
|
||||
nameRecordType :: SumTypeInfo
|
||||
nameRecordType =
|
||||
let st@(STI _ records) = sti @NameRecord
|
||||
dropNr (FieldInfo n t) = FieldInfo (dropPrefix "nr" n) t
|
||||
updateRecord (RecordTypeInfo name fields) = RecordTypeInfo name $ map dropNr fields
|
||||
in st {recordTypes = map updateRecord records}
|
||||
|
||||
-- type info, JSON encoding, constructor prefix, removed constructors, string encoding for commands, description
|
||||
chatTypesDocsData :: [(SumTypeInfo, SumTypeJsonEncoding, String, [ConsName], Expr, Text)]
|
||||
chatTypesDocsData =
|
||||
@@ -331,6 +339,10 @@ chatTypesDocsData =
|
||||
(sti @MsgSigStatus, STEnum, "MSS", [], "", ""),
|
||||
(sti @MsgVerified, STUnion, "MV", [], "", ""),
|
||||
(sti @NameErrorType, STUnion, "", [], "", ""),
|
||||
(sti @NamePricing, STRecord, "", [], "", ""),
|
||||
(nameRecordType, STRecord, "", [], "", ""),
|
||||
(sti @NameRegistration, STUnion, "NR", [], "", ""),
|
||||
(sti @NameReservedReason, STEnum, "NRR", ["NRRUnknown"], "", ""),
|
||||
(sti @NetworkError, STUnion, "NE", [], "", ""),
|
||||
(sti @NewUser, STRecord, "", [], "", ""),
|
||||
(sti @NoteFolder, STRecord, "", [], "", ""),
|
||||
@@ -571,6 +583,10 @@ deriving instance Generic MsgReceiptStatus
|
||||
deriving instance Generic MsgSigStatus
|
||||
deriving instance Generic MsgVerified
|
||||
deriving instance Generic NameErrorType
|
||||
deriving instance Generic NamePricing
|
||||
deriving instance Generic NameRecord
|
||||
deriving instance Generic NameRegistration
|
||||
deriving instance Generic NameReservedReason
|
||||
deriving instance Generic NetworkError
|
||||
deriving instance Generic NewUser
|
||||
deriving instance Generic NoteFolder
|
||||
|
||||
@@ -169,6 +169,8 @@ toTypeInfo tr =
|
||||
"AgentUserId" -> ST TInt64 []
|
||||
"DBEntityId'" -> ST TInt64 []
|
||||
"Integer" -> ST TInt64 []
|
||||
"RoundedSystemTime" -> ST TInt64 []
|
||||
"USDCents" -> ST TInt64 []
|
||||
"Version" -> ST TInt []
|
||||
"VersionRoster" -> ST TInt64 []
|
||||
"BoolDef" -> ST TBool []
|
||||
|
||||
Reference in New Issue
Block a user