fix: Only send unfurled link previews (#11976)

This commit is contained in:
Igor Sirotin 2023-08-22 16:47:17 +03:00 committed by GitHub
parent a1bf7bed19
commit 9716f9b1ac
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions

View File

@ -1,4 +1,4 @@
import io_interface, chronicles, tables import io_interface, chronicles, tables, sequtils
import ../../../../../../app_service/service/message/service as message_service import ../../../../../../app_service/service/message/service as message_service
import ../../../../../../app_service/service/community/service as community_service import ../../../../../../app_service/service/community/service as community_service
@ -102,13 +102,14 @@ proc sendChatMessage*(
let urls = self.messageService.getTextUrls(msg) let urls = self.messageService.getTextUrls(msg)
let linkPreviews = self.linkPreviewCache.linkPreviewsSeq(urls) let linkPreviews = self.linkPreviewCache.linkPreviewsSeq(urls)
let unfurledLinkPreviews = filter(linkPreviews, proc(x: LinkPreview): bool = x.hostname.len > 0)
self.chatService.sendChatMessage(self.chatId, self.chatService.sendChatMessage(self.chatId,
msg, msg,
replyTo, replyTo,
contentType, contentType,
preferredUsername, preferredUsername,
linkPreviews unfurledLinkPreviews
) )
proc requestAddressForTransaction*(self: Controller, fromAddress: string, amount: string, tokenAddress: string) = proc requestAddressForTransaction*(self: Controller, fromAddress: string, amount: string, tokenAddress: string) =