Use shared inbox when available

But it is not yet stored in the database, so it means never
This commit is contained in:
Bat
2018-05-13 15:39:55 +01:00
parent b91f567777
commit fdc481e384
9 changed files with 52 additions and 32 deletions
+5 -1
View File
@@ -15,7 +15,7 @@ use models::instance::Instance;
use schema::blogs;
#[derive(Queryable, Identifiable, Serialize)]
#[derive(Queryable, Identifiable, Serialize, Clone)]
pub struct Blog {
pub id: i32,
pub actor_id: String,
@@ -130,6 +130,10 @@ impl Actor for Blog {
self.inbox_url.clone()
}
fn get_shared_inbox_url(&self) -> Option<String> {
None
}
fn from_url(conn: &PgConnection, url: String) -> Option<Blog> {
blogs::table.filter(blogs::ap_url.eq(url))
.limit(1)
+4
View File
@@ -300,6 +300,10 @@ impl Actor for User {
self.inbox_url.clone()
}
fn get_shared_inbox_url(&self) -> Option<String> {
None
}
fn custom_props(&self, conn: &PgConnection) -> serde_json::Map<String, serde_json::Value> {
let mut res = serde_json::Map::new();
res.insert("publicKey".to_string(), json!({