Skip to content

Commit

Permalink
add: publicly shame people with bad usernames instead of escaping them
Browse files Browse the repository at this point in the history
bad usernames will now literally say "bad username"
  • Loading branch information
trisuaso committed Nov 23, 2024
1 parent 73a7604 commit 47911fe
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion crates/rainbeam-core/src/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2252,7 +2252,7 @@ impl Database {
// get question from database
match self.get_question(props.question.clone()).await {
Ok(q) => q,
Err(_) => Question::unknown(),
Err(_) => return Err(DatabaseError::NotFound),
}
} else {
// create post question
Expand Down
2 changes: 1 addition & 1 deletion crates/rainbeam/src/routing/pages/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pub fn escape_username(name: &String) -> String {
}

if !found_good {
return name.escape_default().to_string();
return "bad username".to_string();
}

// return given data
Expand Down
4 changes: 4 additions & 0 deletions crates/rainbeam/static/css/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -1708,6 +1708,10 @@ canvas {
transform: rotateZ(-25deg);
}

.date {
display: none;
}

/* codemirror */
.CodeMirror {
color: var(--color-text) !important;
Expand Down
2 changes: 2 additions & 0 deletions crates/rainbeam/static/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@

element.innerText =
pretty === undefined ? then.toLocaleDateString() : pretty;

element.style.display = "inline-block";
}
});

Expand Down

0 comments on commit 47911fe

Please sign in to comment.