Ok(())
}
-// TODO this probably isn't necessary anymore
-// pub async fn is_admin(pool: &DbPool, person_id: i32) -> Result<(), LemmyError> {
-// let user = blocking(pool, move |conn| LocalUser::read(conn, person_id)).await??;
-// if !user.admin {
-// return Err(ApiError::err("not_an_admin").into());
-// }
-// Ok(())
-// }
-
pub fn is_admin(local_user_view: &LocalUserView) -> Result<(), LemmyError> {
if !local_user_view.local_user.admin {
return Err(ApiError::err("not_an_admin").into());
Ok(ids)
}
-// TODO should this really use person_ids as recipient ids? or local_user_ids ?
fn do_send_local_notifs(
conn: &PgConnection,
mentions: &[MentionData],
.filter(|m| m.is_local() && m.name.ne(&person.name))
.collect::<Vec<&MentionData>>()
{
- // TODO do a local user fetch
if let Ok(mention_user_view) = LocalUserView::read_from_name(&conn, &mention.name) {
// TODO
// At some point, make it so you can't tag the parent creator either