feat: petnames
This commit is contained in:
parent
7ee817de46
commit
aec876233d
4 changed files with 27 additions and 11 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue