mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-10-23 02:12:25 +00:00
core: include channel link and name when forwarding messages (#7409)
* core: include channel link and name when forwarding messages * wip * simplify * add member ID * refactor * refactor * refactor * update api types * store forward source group type * rename * api types * simpler layout * layout, translations * refactor ios * public * simpler * refactor kotlin * padding * padding --------- Co-authored-by: Evgeny @ SimpleX Chat <259188159+evgeny-simplex@users.noreply.github.com>
This commit is contained in:
1 parent
1196d362ee
commit
17cdef1692
65 files changed
+806
-162
No files matched your search
@@ -688,7 +688,17 @@ data MsgContainer = MsgContainer
|
||||
asGroup :: Maybe Bool,
|
||||
quote :: Maybe QuotedMsg,
|
||||
parent :: Maybe MsgRef,
|
||||
forward :: Maybe Bool
|
||||
forward :: Maybe Bool,
|
||||
forwardLink :: Maybe ForwardLink
|
||||
}
|
||||
deriving (Eq, Show)
|
||||
|
||||
data ForwardLink = ForwardLink
|
||||
{ displayName :: Text,
|
||||
groupLink :: ShortLinkContact,
|
||||
publicGroupId :: B64UrlByteString,
|
||||
memberId :: Maybe MemberId,
|
||||
msgId :: SharedMsgId
|
||||
}
|
||||
deriving (Eq, Show)
|
||||
|
||||
@@ -704,7 +714,8 @@ mcSimple content =
|
||||
asGroup = Nothing,
|
||||
quote = Nothing,
|
||||
parent = Nothing,
|
||||
forward = Nothing
|
||||
forward = Nothing,
|
||||
forwardLink = Nothing
|
||||
}
|
||||
|
||||
mcQuote :: QuotedMsg -> MsgContent -> MsgContainer
|
||||
@@ -713,8 +724,8 @@ mcQuote q c = (mcSimple c) {quote = Just q}
|
||||
mcComment :: MsgRef -> MsgContent -> MsgContainer
|
||||
mcComment p c = (mcSimple c) {parent = Just p}
|
||||
|
||||
mcForward :: MsgContent -> MsgContainer
|
||||
mcForward c = (mcSimple c) {forward = Just True}
|
||||
mcForward :: Maybe ForwardLink -> MsgContent -> MsgContainer
|
||||
mcForward fl c = (mcSimple c) {forward = Just True, forwardLink = fl}
|
||||
|
||||
data MsgContent
|
||||
= MCText {text :: Text}
|
||||
@@ -896,6 +907,8 @@ instance ToJSON MsgContent where
|
||||
MCReport {text, reason} -> J.pairs $ "type" .= MCReport_ <> "text" .= text <> "reason" .= reason
|
||||
MCChat {text, chatLink, ownerSig} -> J.pairs $ "type" .= MCChat_ <> "text" .= text <> "chatLink" .= chatLink <> maybe mempty ("ownerSig" .=) ownerSig
|
||||
|
||||
$(JQ.deriveJSON defaultJSON ''ForwardLink)
|
||||
|
||||
$(JQ.deriveJSON defaultJSON ''MsgContainer)
|
||||
|
||||
-- this limit reserves space for metadata in forwarded messages
|
||||
|
||||
Reference in new issue
Block a user