Skip to content

Commit

Permalink
fix: Only send unfurled link previews (#11976)
Browse files Browse the repository at this point in the history
  • Loading branch information
igor-sirotin authored Aug 22, 2023
1 parent a1bf7be commit 9716f9b
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -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/community/service as community_service
Expand Down Expand Up @@ -102,13 +102,14 @@ proc sendChatMessage*(

let urls = self.messageService.getTextUrls(msg)
let linkPreviews = self.linkPreviewCache.linkPreviewsSeq(urls)

let unfurledLinkPreviews = filter(linkPreviews, proc(x: LinkPreview): bool = x.hostname.len > 0)

self.chatService.sendChatMessage(self.chatId,
msg,
replyTo,
contentType,
preferredUsername,
linkPreviews
unfurledLinkPreviews
)

proc requestAddressForTransaction*(self: Controller, fromAddress: string, amount: string, tokenAddress: string) =
Expand Down

0 comments on commit 9716f9b

Please sign in to comment.