Add Actor ActivityPub representation
This commit is contained in:
+5
-1
@@ -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
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user