diff --git a/src/app/modules/main/chat_section/chat_content/input_area/controller.nim b/src/app/modules/main/chat_section/chat_content/input_area/controller.nim index fc6fca5675..99c72b3807 100644 --- a/src/app/modules/main/chat_section/chat_content/input_area/controller.nim +++ b/src/app/modules/main/chat_section/chat_content/input_area/controller.nim @@ -13,6 +13,8 @@ import ../../../../../core/eventemitter import ../../../../../core/unique_event_emitter import ./link_preview_cache +const MESSAGE_LINK_PREVIEWS_LIMIT = 5 + type Controller* = ref object of RootObj delegate: io_interface.AccessInterface @@ -195,6 +197,9 @@ proc handleUnfurlingPlan*(self: Controller, unfurlNewUrls: bool) = allAllowedUrls.add(metadata.url) continue + if allAllowedUrls.len == MESSAGE_LINK_PREVIEWS_LIMIT: + continue + # Split unfurling into 2 packs, which will be different RPCs. # In most cases we expect status links to ufurl immediately. # In future we could unfurl each link in a separate RPC,