mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-10-23 08:33:09 +00:00
core: filter all messages with links in text when link content filter is used (#6591)
* core: change msg_content_tag stored as blob to text * track if items have links and use has_link when searching for links (MCLink_ MsgContentTag is passed) * fix test (broken in master) * merge migrations, update api and schema * minor fixes * tests * update plans * update migrations
This commit is contained in:
1 parent
d08202ee2d
commit
5453d8875c
21 files changed
+355
-82
No files matched your search
@@ -178,6 +178,16 @@ isSimplexLink = \case
|
||||
SimplexLink {} -> True
|
||||
_ -> False
|
||||
|
||||
isLink :: Format -> Bool
|
||||
isLink = \case
|
||||
Uri -> True
|
||||
HyperLink {} -> True
|
||||
SimplexLink {} -> True
|
||||
_ -> False
|
||||
|
||||
hasLinks :: MarkdownList -> Bool
|
||||
hasLinks = any $ \(FormattedText f _) -> maybe False isLink f
|
||||
|
||||
markdownP :: Parser Markdown
|
||||
markdownP = mconcat <$> A.many' fragmentP
|
||||
where
|
||||
|
||||
Reference in new issue
Block a user