inbox_url,
shared_inbox_url,
matrix_user_id,
+ admin,
);
impl ToSafe for Person {
inbox_url,
shared_inbox_url,
matrix_user_id,
+ admin,
)
}
}
inbox_url,
shared_inbox_url,
matrix_user_id,
+ admin,
);
impl ToSafe for PersonAlias1 {
inbox_url,
shared_inbox_url,
matrix_user_id,
+ admin,
)
}
}
inbox_url,
shared_inbox_url,
matrix_user_id,
+ admin,
);
impl ToSafe for PersonAlias2 {
inbox_url,
shared_inbox_url,
matrix_user_id,
+ admin,
)
}
}
pub trait Person_ {
fn ban_person(conn: &PgConnection, person_id: PersonId, ban: bool) -> Result<Person, Error>;
+ fn add_admin(conn: &PgConnection, person_id: PersonId, added: bool) -> Result<Person, Error>;
fn find_by_name(conn: &PgConnection, name: &str) -> Result<Person, Error>;
fn mark_as_updated(conn: &PgConnection, person_id: PersonId) -> Result<Person, Error>;
fn delete_account(conn: &PgConnection, person_id: PersonId) -> Result<Person, Error>;
.get_result::<Self>(conn)
}
+ fn add_admin(conn: &PgConnection, person_id: PersonId, added: bool) -> Result<Self, Error> {
+ diesel::update(person.find(person_id))
+ .set(admin.eq(added))
+ .get_result::<Self>(conn)
+ }
+
fn find_by_name(conn: &PgConnection, from_name: &str) -> Result<Person, Error> {
person
.filter(deleted.eq(false))
actor_id: inserted_person.actor_id.to_owned(),
bio: None,
local: true,
+ admin: false,
private_key: None,
public_key: None,
last_refreshed_at: inserted_person.published,