mirror of
https://github.com/LemmyNet/lemmy.git
synced 2024-11-21 22:27:08 +00:00
Published user time (#1141)
* Adding published time to UserForm. - Federates user creation time. Fixes #1140 * Check the user published time.
This commit is contained in:
parent
fc525c8144
commit
7bdb1abbe6
|
@ -25,6 +25,7 @@ function assertUserFederation(
|
|||
expect(userOne.actor_id).toBe(userTwo.actor_id);
|
||||
expect(userOne.avatar).toBe(userTwo.avatar);
|
||||
expect(userOne.banner).toBe(userTwo.banner);
|
||||
expect(userOne.published).toBe(userTwo.published);
|
||||
}
|
||||
|
||||
test('Create user', async () => {
|
||||
|
@ -74,4 +75,4 @@ test('Set avatar and banner, check that they are federated', async () => {
|
|||
let searchBeta = await searchForUser(beta, apShortname);
|
||||
let userOnBeta = searchBeta.users[0];
|
||||
assertUserFederation(userOnAlpha, userOnBeta);
|
||||
});
|
||||
});
|
||||
|
|
|
@ -105,6 +105,7 @@ mod tests {
|
|||
banner: None,
|
||||
admin: false,
|
||||
banned: false,
|
||||
published: None,
|
||||
updated: None,
|
||||
show_nsfw: false,
|
||||
theme: "darkly".into(),
|
||||
|
|
|
@ -281,6 +281,7 @@ mod tests {
|
|||
banner: None,
|
||||
admin: false,
|
||||
banned: false,
|
||||
published: None,
|
||||
updated: None,
|
||||
show_nsfw: false,
|
||||
theme: "darkly".into(),
|
||||
|
|
|
@ -520,6 +520,7 @@ mod tests {
|
|||
banner: None,
|
||||
admin: false,
|
||||
banned: false,
|
||||
published: None,
|
||||
updated: None,
|
||||
show_nsfw: false,
|
||||
theme: "darkly".into(),
|
||||
|
|
|
@ -321,6 +321,7 @@ mod tests {
|
|||
banner: None,
|
||||
admin: false,
|
||||
banned: false,
|
||||
published: None,
|
||||
updated: None,
|
||||
show_nsfw: false,
|
||||
theme: "darkly".into(),
|
||||
|
|
|
@ -417,6 +417,7 @@ mod tests {
|
|||
banner: None,
|
||||
admin: false,
|
||||
banned: false,
|
||||
published: None,
|
||||
updated: None,
|
||||
show_nsfw: false,
|
||||
theme: "darkly".into(),
|
||||
|
@ -445,6 +446,7 @@ mod tests {
|
|||
banner: None,
|
||||
admin: false,
|
||||
banned: false,
|
||||
published: None,
|
||||
updated: None,
|
||||
show_nsfw: false,
|
||||
theme: "darkly".into(),
|
||||
|
|
|
@ -101,6 +101,7 @@ mod tests {
|
|||
banner: None,
|
||||
admin: false,
|
||||
banned: false,
|
||||
published: None,
|
||||
updated: None,
|
||||
show_nsfw: false,
|
||||
theme: "darkly".into(),
|
||||
|
|
|
@ -350,6 +350,7 @@ mod tests {
|
|||
banner: None,
|
||||
admin: false,
|
||||
banned: false,
|
||||
published: None,
|
||||
updated: None,
|
||||
show_nsfw: false,
|
||||
theme: "darkly".into(),
|
||||
|
|
|
@ -413,6 +413,7 @@ mod tests {
|
|||
matrix_user_id: None,
|
||||
avatar: None,
|
||||
banner: None,
|
||||
published: None,
|
||||
updated: None,
|
||||
admin: false,
|
||||
banned: false,
|
||||
|
|
|
@ -158,6 +158,7 @@ mod tests {
|
|||
banner: None,
|
||||
admin: false,
|
||||
banned: false,
|
||||
published: None,
|
||||
updated: None,
|
||||
show_nsfw: false,
|
||||
theme: "darkly".into(),
|
||||
|
@ -186,6 +187,7 @@ mod tests {
|
|||
banner: None,
|
||||
admin: false,
|
||||
banned: false,
|
||||
published: None,
|
||||
updated: None,
|
||||
show_nsfw: false,
|
||||
theme: "darkly".into(),
|
||||
|
|
|
@ -48,6 +48,7 @@ pub struct UserForm {
|
|||
pub banned: bool,
|
||||
pub email: Option<Option<String>>,
|
||||
pub avatar: Option<Option<String>>,
|
||||
pub published: Option<chrono::NaiveDateTime>,
|
||||
pub updated: Option<chrono::NaiveDateTime>,
|
||||
pub show_nsfw: bool,
|
||||
pub theme: String,
|
||||
|
@ -181,6 +182,7 @@ mod tests {
|
|||
banner: None,
|
||||
admin: false,
|
||||
banned: false,
|
||||
published: None,
|
||||
updated: None,
|
||||
show_nsfw: false,
|
||||
theme: "darkly".into(),
|
||||
|
|
|
@ -97,6 +97,7 @@ mod tests {
|
|||
banner: None,
|
||||
admin: false,
|
||||
banned: false,
|
||||
published: None,
|
||||
updated: None,
|
||||
show_nsfw: false,
|
||||
theme: "darkly".into(),
|
||||
|
@ -125,6 +126,7 @@ mod tests {
|
|||
banner: None,
|
||||
admin: false,
|
||||
banned: false,
|
||||
published: None,
|
||||
updated: None,
|
||||
show_nsfw: false,
|
||||
theme: "darkly".into(),
|
||||
|
|
|
@ -170,6 +170,7 @@ impl Perform for Register {
|
|||
banner: None,
|
||||
password_encrypted: data.password.to_owned(),
|
||||
preferred_username: None,
|
||||
published: None,
|
||||
updated: None,
|
||||
admin: data.admin,
|
||||
banned: false,
|
||||
|
@ -404,6 +405,7 @@ impl Perform for SaveUserSettings {
|
|||
banner,
|
||||
password_encrypted,
|
||||
preferred_username,
|
||||
published: Some(read_user.published),
|
||||
updated: Some(naive_now()),
|
||||
admin: read_user.admin,
|
||||
banned: read_user.banned,
|
||||
|
|
|
@ -262,6 +262,7 @@ impl FromApub for UserForm {
|
|||
email: None,
|
||||
avatar,
|
||||
banner,
|
||||
published: person.inner.published().map(|u| u.to_owned().naive_local()),
|
||||
updated: person.updated().map(|u| u.to_owned().naive_local()),
|
||||
show_nsfw: false,
|
||||
theme: "".to_string(),
|
||||
|
|
|
@ -54,6 +54,7 @@ fn user_updates_2020_04_02(conn: &PgConnection) -> Result<(), LemmyError> {
|
|||
banner: Some(cuser.banner.to_owned()),
|
||||
password_encrypted: cuser.password_encrypted.to_owned(),
|
||||
preferred_username: cuser.preferred_username.to_owned(),
|
||||
published: Some(cuser.published),
|
||||
updated: None,
|
||||
admin: cuser.admin,
|
||||
banned: cuser.banned,
|
||||
|
|
Loading…
Reference in a new issue