Add Actor ActivityPub representation

This commit is contained in:
Bat
2018-04-23 17:26:01 +01:00
parent 656b201244
commit e9bcaf4dd9
5 changed files with 69 additions and 9 deletions
+5 -1
View File
@@ -1,7 +1,7 @@
use diesel;
use diesel::{QueryDsl, RunQueryDsl, ExpressionMethods, PgConnection};
use schema::blogs;
use activity_pub::Actor;
use activity_pub::{Actor, ActorType};
use models::instance::Instance;
#[derive(Queryable, Identifiable)]
@@ -77,6 +77,10 @@ impl Actor for Blog {
fn get_instance(&self, conn: &PgConnection) -> Instance {
Instance::get(conn, self.instance_id).unwrap()
}
fn get_actor_type () -> ActorType {
ActorType::Blog
}
}
impl NewBlog {
+5 -1
View File
@@ -5,7 +5,7 @@ use diesel;
use diesel::{QueryDsl, RunQueryDsl, ExpressionMethods, PgConnection};
use schema::users;
use db_conn::DbConn;
use activity_pub::Actor;
use activity_pub::{ActorType, Actor};
use models::instance::Instance;
use bcrypt;
@@ -121,6 +121,10 @@ impl Actor for User {
fn get_instance(&self, conn: &PgConnection) -> Instance {
Instance::get(conn, self.instance_id).unwrap()
}
fn get_actor_type() -> ActorType {
ActorType::Person
}
}
impl NewUser {