proxy support

This commit is contained in:
Aiden McClelland
2021-01-11 13:27:52 -07:00
parent 615a5fe346
commit 24aac22b89
63 changed files with 23942 additions and 21669 deletions
+3 -2
View File
@@ -8,7 +8,7 @@ use crate::{
safe_string::SafeString,
schema::comments,
users::User,
Connection, Error, PlumeRocket, Result,
Connection, Error, PlumeRocket, Result, CONFIG,
};
use activitypub::{
activity::{Create, Delete},
@@ -239,6 +239,7 @@ impl FromId<PlumeRocket> for Comment {
c,
&note.object_props.attributed_to_link::<Id>()?,
None,
CONFIG.proxy(),
)
.map_err(|(_, e)| e)?
.id,
@@ -296,7 +297,7 @@ impl FromId<PlumeRocket> for Comment {
.collect::<HashSet<_>>() // remove duplicates (don't do a query more than once)
.into_iter()
.map(|v| {
if let Ok(user) = User::from_id(c, &v, None) {
if let Ok(user) = User::from_id(c, &v, None, CONFIG.proxy()) {
vec![user]
} else {
vec![] // TODO try to fetch collection