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:
EvgenyandEvgeny @ SimpleX Chat authored and GitHub committed 2026-08-24 21:36:57 +01:00
1 parent 1196d362ee
commit 17cdef1692
65 files changed
+806 -162

No files matched your search

+17 -4
View File
@@ -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