use crate::{sensitive::Sensitive, site::FederatedInstances};
use lemmy_db_schema::{
- newtypes::{CommunityId, DbUrl, LocalUserId, PersonId, PostId},
+ newtypes::{CommunityId, LocalUserId, PersonId, PostId},
source::{
comment::Comment,
community::Community,
Ok(())
}
-
-pub fn check_image_has_local_domain(url: &Option<DbUrl>) -> Result<(), LemmyError> {
- if let Some(url) = url {
- let settings = Settings::get();
- let domain = url.domain().expect("url has domain");
- if domain != settings.hostname {
- return Err(LemmyError::from_message("image_not_local"));
- }
- }
- Ok(())
-}