Skip to content

Commit

Permalink
fix(backend): mention notification title
Browse files Browse the repository at this point in the history
  • Loading branch information
trisuaso committed Dec 27, 2024
1 parent 36a2ba2 commit 968405c
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/rainbeam-core/src/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2529,7 +2529,7 @@ impl Database {
// ...
let timestamp = utility::unix_epoch_timestamp();
let mut response = QuestionResponse {
author,
author: author.clone(),
content: props.content.trim().to_string(),
// id: utility::random_id(),
id: AlmostSnowflake::new(self.config.snowflake_server_id).to_string(),
Expand Down Expand Up @@ -2566,7 +2566,7 @@ impl Database {
NotificationCreate {
title: format!(
"[@{}]({}) mentioned you in a response!",
profile.username, profile.id
author.username, author.id
),
content: format!("You were mentioned in a response."),
address: format!("/response/{}", response.id),
Expand Down Expand Up @@ -3793,7 +3793,7 @@ impl Database {
// ...
let timestamp = utility::unix_epoch_timestamp();
let mut comment = ResponseComment {
author,
author: author.clone(),
response: response.id.clone(),
content: props.content.trim().to_string(),
// id: utility::random_id(),
Expand All @@ -3818,7 +3818,7 @@ impl Database {
NotificationCreate {
title: format!(
"[@{}]({}) mentioned you in a comment!",
profile.username, profile.id
author.username, author.id
),
content: format!("You were mentioned in a comment."),
address: format!("/comment/{}", comment.id),
Expand Down
16 changes: 16 additions & 0 deletions crates/rb/src/routing/pages/profile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,22 @@ All mail sent to this account can be viewed by any staff member with access.
.render()
.unwrap(),
);
} else if other.id == "@" {
return Html(
MarkdownTemplate {
config: database.config.clone(),
lang: database.lang(if let Some(c) = jar.get("net.rainbeam.langs.choice") {
c.value_trimmed()
} else {
""
}),
profile: auth_user,
title: "Everybody".to_string(),
text: "Hello from everyone!".to_string(),
}
.render()
.unwrap(),
);
}

let is_following = if let Some(ref ua) = auth_user {
Expand Down

0 comments on commit 968405c

Please sign in to comment.