last_refreshed_at: None,
inbox_url: None,
shared_inbox_url: None,
+ matrix_user_id: None,
};
let inserted_person = Person::create(&conn, &new_person).unwrap();
let local_user_form = LocalUserForm {
person_id: inserted_person.id,
email: None,
- matrix_user_id: None,
password_encrypted: "123456".to_string(),
admin: None,
show_nsfw: None,
last_refreshed_at: None,
inbox_url: Some(generate_inbox_url(&actor_id)?),
shared_inbox_url: Some(Some(generate_shared_inbox_url(&actor_id)?)),
+ matrix_user_id: None,
};
// insert the person
let local_user_form = LocalUserForm {
person_id: inserted_person.id,
email: Some(data.email.to_owned()),
- matrix_user_id: None,
password_encrypted: data.password.to_owned(),
admin: Some(no_admins),
show_nsfw: Some(data.show_nsfw),
public_key: None,
last_refreshed_at: None,
shared_inbox_url: None,
+ matrix_user_id,
};
let person_res = blocking(context.pool(), move |conn| {
let local_user_form = LocalUserForm {
person_id,
email,
- matrix_user_id,
password_encrypted,
admin: None,
show_nsfw: data.show_nsfw,
last_refreshed_at: Some(naive_now()),
inbox_url: Some(person.inner.inbox()?.to_owned().into()),
shared_inbox_url: Some(shared_inbox),
+ matrix_user_id: None, // TODO
})
}
}
last_refreshed_at: None,
inbox_url: None,
shared_inbox_url: None,
+ matrix_user_id: None,
};
let inserted_person = Person::create(&conn, &new_person).unwrap();
last_refreshed_at: None,
inbox_url: None,
shared_inbox_url: None,
+ matrix_user_id: None,
};
let another_inserted_person = Person::create(&conn, &another_person).unwrap();
last_refreshed_at: None,
inbox_url: None,
shared_inbox_url: None,
+ matrix_user_id: None,
};
let inserted_person = Person::create(&conn, &new_person).unwrap();
last_refreshed_at: None,
inbox_url: None,
shared_inbox_url: None,
+ matrix_user_id: None,
};
let another_inserted_person = Person::create(&conn, &another_person).unwrap();
last_refreshed_at: None,
inbox_url: None,
shared_inbox_url: None,
+ matrix_user_id: None,
};
let inserted_person = Person::create(&conn, &new_person).unwrap();
last_refreshed_at: None,
inbox_url: None,
shared_inbox_url: None,
+ matrix_user_id: None,
};
let another_inserted_person = Person::create(&conn, &another_person).unwrap();
last_refreshed_at: None,
inbox_url: None,
shared_inbox_url: None,
+ matrix_user_id: None,
};
let inserted_person = Person::create(&conn, &new_person).unwrap();
last_refreshed_at: None,
inbox_url: None,
shared_inbox_url: None,
+ matrix_user_id: None,
};
let another_inserted_person = Person::create(&conn, &another_person).unwrap();
last_refreshed_at: None,
inbox_url: None,
shared_inbox_url: None,
+ matrix_user_id: None,
};
let inserted_person = Person::create(&conn, &new_person).unwrap();
last_refreshed_at: None,
inbox_url: None,
shared_inbox_url: None,
+ matrix_user_id: None,
};
let inserted_creator = Person::create(&conn, &creator_form).unwrap();
last_refreshed_at: None,
inbox_url: None,
shared_inbox_url: None,
+ matrix_user_id: None,
};
let inserted_person = Person::create(&conn, &new_person).unwrap();
last_refreshed_at: None,
inbox_url: None,
shared_inbox_url: None,
+ matrix_user_id: None,
};
let inserted_person = Person::create(&conn, &new_person).unwrap();
lang,
show_avatars,
send_notifications_to_email,
- matrix_user_id,
validator_time,
);
lang,
show_avatars,
send_notifications_to_email,
- matrix_user_id,
validator_time,
)
}
last_refreshed_at: None,
inbox_url: None,
shared_inbox_url: None,
+ matrix_user_id: None,
};
let inserted_mod = Person::create(&conn, &new_mod).unwrap();
last_refreshed_at: None,
inbox_url: None,
shared_inbox_url: None,
+ matrix_user_id: None,
};
let inserted_person = Person::create(&conn, &new_person).unwrap();
last_refreshed_at: None,
inbox_url: None,
shared_inbox_url: None,
+ matrix_user_id: None,
};
let inserted_person = Person::create(&conn, &new_person).unwrap();
person_id: inserted_person.id,
password_encrypted: "pass".to_string(),
email: None,
- matrix_user_id: None,
admin: None,
show_nsfw: None,
theme: None,
deleted,
inbox_url,
shared_inbox_url,
+ matrix_user_id,
);
impl ToSafe for Person {
deleted,
inbox_url,
shared_inbox_url,
+ matrix_user_id,
)
}
}
deleted,
inbox_url,
shared_inbox_url,
+ matrix_user_id,
);
impl ToSafe for PersonAlias1 {
deleted,
inbox_url,
shared_inbox_url,
+ matrix_user_id,
)
}
}
deleted,
inbox_url,
shared_inbox_url,
+ matrix_user_id,
);
impl ToSafe for PersonAlias2 {
deleted,
inbox_url,
shared_inbox_url,
+ matrix_user_id,
)
}
}
// Set the local user info to none
diesel::update(local_user::table.filter(local_user::person_id.eq(person_id)))
- .set((
- local_user::email.eq::<Option<String>>(None),
- local_user::matrix_user_id.eq::<Option<String>>(None),
- ))
+ .set((local_user::email.eq::<Option<String>>(None),))
.execute(conn)?;
diesel::update(person.find(person_id))
.set((
preferred_username.eq::<Option<String>>(None),
bio.eq::<Option<String>>(None),
+ matrix_user_id.eq::<Option<String>>(None),
deleted.eq(true),
updated.eq(naive_now()),
))
last_refreshed_at: None,
inbox_url: None,
shared_inbox_url: None,
+ matrix_user_id: None,
};
let inserted_person = Person::create(&conn, &new_person).unwrap();
last_refreshed_at: inserted_person.published,
inbox_url: inserted_person.inbox_url.to_owned(),
shared_inbox_url: None,
+ matrix_user_id: None,
};
let read_person = Person::read(&conn, inserted_person.id).unwrap();
last_refreshed_at: None,
inbox_url: None,
shared_inbox_url: None,
+ matrix_user_id: None,
};
let inserted_person = Person::create(&conn, &new_person).unwrap();
last_refreshed_at: None,
inbox_url: None,
shared_inbox_url: None,
+ matrix_user_id: None,
};
let inserted_recipient = Person::create(&conn, &recipient_form).unwrap();
last_refreshed_at: None,
inbox_url: None,
shared_inbox_url: None,
+ matrix_user_id: None,
};
let inserted_person = Person::create(&conn, &new_person).unwrap();
last_refreshed_at: None,
inbox_url: None,
shared_inbox_url: None,
+ matrix_user_id: None,
};
let inserted_creator = Person::create(&conn, &creator_form).unwrap();
last_refreshed_at: None,
inbox_url: None,
shared_inbox_url: None,
+ matrix_user_id: None,
};
let inserted_recipient = Person::create(&conn, &recipient_form).unwrap();
lang -> Varchar,
show_avatars -> Bool,
send_notifications_to_email -> Bool,
- matrix_user_id -> Nullable<Text>,
validator_time -> Timestamp,
}
}
deleted -> Bool,
inbox_url -> Varchar,
shared_inbox_url -> Nullable<Varchar>,
+ matrix_user_id -> Nullable<Text>,
}
}
deleted -> Bool,
inbox_url -> Varchar,
shared_inbox_url -> Nullable<Varchar>,
+ matrix_user_id -> Nullable<Text>,
}
}
deleted -> Bool,
inbox_url -> Varchar,
shared_inbox_url -> Nullable<Varchar>,
+ matrix_user_id -> Nullable<Text>,
}
}
pub lang: String,
pub show_avatars: bool,
pub send_notifications_to_email: bool,
- pub matrix_user_id: Option<String>,
pub validator_time: chrono::NaiveDateTime,
}
pub lang: Option<String>,
pub show_avatars: Option<bool>,
pub send_notifications_to_email: Option<bool>,
- pub matrix_user_id: Option<Option<String>>,
}
/// A local user view that removes password encrypted
pub lang: String,
pub show_avatars: bool,
pub send_notifications_to_email: bool,
- pub matrix_user_id: Option<String>,
pub validator_time: chrono::NaiveDateTime,
}
pub deleted: bool,
pub inbox_url: DbUrl,
pub shared_inbox_url: Option<DbUrl>,
+ pub matrix_user_id: Option<String>,
}
/// A safe representation of person, without the sensitive info
pub deleted: bool,
pub inbox_url: DbUrl,
pub shared_inbox_url: Option<DbUrl>,
+ pub matrix_user_id: Option<String>,
}
#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
pub deleted: bool,
pub inbox_url: DbUrl,
pub shared_inbox_url: Option<DbUrl>,
+ pub matrix_user_id: Option<String>,
}
#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
pub deleted: bool,
pub inbox_url: DbUrl,
pub shared_inbox_url: Option<DbUrl>,
+ pub matrix_user_id: Option<String>,
}
#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
pub deleted: bool,
pub inbox_url: DbUrl,
pub shared_inbox_url: Option<DbUrl>,
+ pub matrix_user_id: Option<String>,
}
#[derive(Clone, Queryable, Identifiable, PartialEq, Debug, Serialize)]
pub deleted: bool,
pub inbox_url: DbUrl,
pub shared_inbox_url: Option<DbUrl>,
+ pub matrix_user_id: Option<String>,
}
#[derive(Insertable, AsChangeset, Clone)]
pub deleted: Option<bool>,
pub inbox_url: Option<DbUrl>,
pub shared_inbox_url: Option<Option<DbUrl>>,
+ pub matrix_user_id: Option<Option<String>>,
}
last_refreshed_at: None,
inbox_url: None,
shared_inbox_url: None,
+ matrix_user_id: None,
};
let inserted_person = Person::create(&conn, &new_person).unwrap();
updated: None,
inbox_url: inserted_person.inbox_url.to_owned(),
shared_inbox_url: None,
+ matrix_user_id: None,
},
recipient: None,
post: Post {
last_refreshed_at: None,
inbox_url: None,
shared_inbox_url: None,
+ matrix_user_id: None,
};
let inserted_person = Person::create(&conn, &new_person).unwrap();
updated: None,
inbox_url: inserted_person.inbox_url.to_owned(),
shared_inbox_url: None,
+ matrix_user_id: None,
},
creator_banned_from_community: false,
community: CommunitySafe {
--- /dev/null
+alter table local_user add column matrix_user_id text;
+
+update local_user lu
+set matrix_user_id = p.matrix_user_id
+from person p
+where p.id = lu.person_id;
+
+alter table person drop column matrix_user_id;
--- /dev/null
+alter table person add column matrix_user_id text;
+
+update person p
+set matrix_user_id = lu.matrix_user_id
+from local_user lu
+where p.id = lu.person_id;
+
+alter table local_user drop column matrix_user_id;
last_refreshed_at: Some(naive_now()),
inbox_url: None,
shared_inbox_url: None,
+ matrix_user_id: None,
};
Person::update(&conn, cperson.id, &form)?;