1
0
Fork 0
mirror of https://gitlab.com/famedly/conduit.git synced 2025-08-06 17:40:59 +00:00

Change URL preview setting from bool to a mode, and add support for an allowlist

This commit is contained in:
Reiner Herrmann 2023-07-29 00:38:58 +02:00
parent bb4cade9fd
commit 61fd9166f6
5 changed files with 90 additions and 26 deletions

View file

@ -12,6 +12,7 @@ use futures_util::FutureExt;
use hickory_resolver::TokioAsyncResolver;
use hyper_util::client::legacy::connect::dns::{GaiResolver, Name as HyperName};
use reqwest::dns::{Addrs, Name, Resolve, Resolving};
use crate::config::UrlPreviewMode;
use ruma::{
api::{client::sync::sync_events, federation::discovery::ServerSigningKeys},
DeviceId, RoomVersionId, ServerName, UserId,
@ -324,8 +325,12 @@ impl Service {
self.config.allow_federation
}
pub fn allow_url_preview(&self) -> bool {
self.config.allow_url_preview
pub fn url_preview_mode(&self) -> UrlPreviewMode {
self.config.url_preview_mode
}
pub fn url_preview_allowlist(&self) -> &Vec<String> {
&self.config.url_preview_allowlist
}
pub fn allow_room_creation(&self) -> bool {