mirror of https://github.com/LemmyNet/lemmy.git
parent
3753a3bf54
commit
1a164a649e
|
@ -78,8 +78,9 @@ impl Collection for ApubCommunityModerators {
|
||||||
|
|
||||||
// Add new mods to database which have been added to moderators collection
|
// Add new mods to database which have been added to moderators collection
|
||||||
for mod_id in apub.ordered_items {
|
for mod_id in apub.ordered_items {
|
||||||
let mod_user: ApubPerson = mod_id.dereference(data).await?;
|
// Ignore errors as mod accounts might be deleted or instances unavailable.
|
||||||
|
let mod_user: Option<ApubPerson> = mod_id.dereference(data).await.ok();
|
||||||
|
if let Some(mod_user) = mod_user {
|
||||||
if !current_moderators
|
if !current_moderators
|
||||||
.iter()
|
.iter()
|
||||||
.map(|c| c.moderator.actor_id.clone())
|
.map(|c| c.moderator.actor_id.clone())
|
||||||
|
@ -92,6 +93,7 @@ impl Collection for ApubCommunityModerators {
|
||||||
CommunityModerator::join(&mut data.pool(), &community_moderator_form).await?;
|
CommunityModerator::join(&mut data.pool(), &community_moderator_form).await?;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// This return value is unused, so just set an empty vec
|
// This return value is unused, so just set an empty vec
|
||||||
Ok(ApubCommunityModerators(Vec::new()))
|
Ok(ApubCommunityModerators(Vec::new()))
|
||||||
|
|
Loading…
Reference in New Issue