]> Untitled Git - lemmy.git/blobdiff - crates/api_common/src/utils.rs
Remove check that avatars/banners are locally hosted (fixes #2254) (#2255)
[lemmy.git] / crates / api_common / src / utils.rs
index 38ea9a865e7b6f6926530f3942fa8bda64263578..d3c8a1f43df4ea578ef62a3127ce446bcb77260d 100644 (file)
@@ -1,6 +1,6 @@
 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,
@@ -592,14 +592,3 @@ pub async fn delete_user_account(person_id: PersonId, pool: &DbPool) -> Result<(
 
   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(())
-}