Enable URL-previews for m.notice

Desktop has those too.

Change-Id: I14fd4b3afff17b23e34ea78a4cd7948b85816a2f
This commit is contained in:
SpiritCroc 2020-12-19 19:57:49 +01:00
parent 5f30336542
commit 997fcf8fff
2 changed files with 4 additions and 1 deletions

View File

@ -32,7 +32,7 @@ internal class UrlsExtractor @Inject constructor() {
return event.takeIf { it.getClearType() == EventType.MESSAGE }
?.getClearContent()
?.toModel<MessageContent>()
?.takeIf { it.msgType == MessageType.MSGTYPE_TEXT || it.msgType == MessageType.MSGTYPE_EMOTE }
?.takeIf { it.msgType == MessageType.MSGTYPE_TEXT || it.msgType == MessageType.MSGTYPE_NOTICE || it.msgType == MessageType.MSGTYPE_EMOTE }
?.body
?.let { urlRegex.findAll(it) }
?.map { it.value }

View File

@ -512,6 +512,9 @@ class MessageItemFactory @Inject constructor(
return MessageTextItem_()
.leftGuideline(avatarSizeProvider.leftGuideline)
.previewUrlRetriever(callback?.getPreviewUrlRetriever())
.imageContentRenderer(imageContentRenderer)
.previewUrlCallback(callback)
.attributes(attributes)
.message(message)
.highlighted(highlight)