feat: limit message link previews count (#15214)
This commit is contained in:
parent
4170f589b3
commit
067f406572
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue