mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-06-04 21:12:05 +00:00
core: add fields to chat relay profiles; remove unique name requirement; update relay profile in relay address link data (#6743)
* core: add fields to chat relay profiles * wip * wip * fix * fix * fix * enable tests * schema * api --------- Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com> Co-authored-by: spaced4ndy <8711996+spaced4ndy@users.noreply.github.com>
This commit is contained in:
@@ -1455,11 +1455,22 @@ data RelayShortLinkData = RelayShortLinkData
|
||||
|
||||
$(JQ.deriveJSON defaultJSON ''RelayShortLinkData)
|
||||
|
||||
data RelayProfile = RelayProfile {name :: ContactName}
|
||||
data RelayProfile = RelayProfile
|
||||
{ displayName :: ContactName,
|
||||
fullName :: Text,
|
||||
shortDescr :: Maybe Text,
|
||||
image :: Maybe ImageData
|
||||
}
|
||||
deriving (Eq, Show)
|
||||
|
||||
$(JQ.deriveJSON defaultJSON ''RelayProfile)
|
||||
|
||||
toRelayProfile :: (ContactName, Text, Maybe Text, Maybe ImageData) -> RelayProfile
|
||||
toRelayProfile (displayName, fullName, shortDescr, image) = RelayProfile {displayName, fullName, shortDescr, image}
|
||||
|
||||
relayProfileFromName :: ContactName -> RelayProfile
|
||||
relayProfileFromName displayName = RelayProfile {displayName, fullName = "", shortDescr = Nothing, image = Nothing}
|
||||
|
||||
data RelayAddressLinkData = RelayAddressLinkData {relayProfile :: RelayProfile}
|
||||
deriving (Show)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user