feat: petnames

This commit is contained in:
Pascal Engélibert 2022-12-04 10:41:54 +01:00
commit aec876233d
Signed by: tuxmain
GPG key ID: 3504BC6D362F7DCA
4 changed files with 27 additions and 11 deletions

View file

@ -322,7 +322,11 @@ async fn handle_post_comments(
let comment = Comment {
topic_hash,
author: query.comment.author,
author: if query.comment.author.is_empty() {
petname::Petnames::large().generate_one(2, " ")
} else {
query.comment.author
},
email: if query.comment.email.is_empty() {
None
} else {
@ -395,7 +399,11 @@ async fn handle_post_comments(
.unwrap()
.as_secs();
comment.author = query.comment.author;
comment.author = if query.comment.author.is_empty() {
petname::Petnames::large().generate_one(2, " ")
} else {
query.comment.author
};
comment.email = if query.comment.email.is_empty() {
None
} else {