add: chat notifications

use sql_chanes/notifications_tag.sql; ignore first statement if you never used a preview commit
This commit is contained in:
trisua 2025-05-03 17:51:36 -04:00
parent a009ef9e34
commit 59cfec4819
22 changed files with 267 additions and 136 deletions

View file

@ -40,10 +40,6 @@ pub struct User {
/// External service connection details.
#[serde(default)]
pub connections: UserConnections,
/// Subscribed channels data. Each entry is a channel ID, as well as the ID of
/// the last message the user saw in that channel.
#[serde(default)]
pub subscriptions: HashMap<usize, usize>,
}
pub type UserConnections =
@ -239,7 +235,6 @@ impl User {
post_count: 0,
request_count: 0,
connections: HashMap::new(),
subscriptions: HashMap::new(),
}
}
@ -392,6 +387,7 @@ pub struct Notification {
pub content: String,
pub owner: usize,
pub read: bool,
pub tag: String,
}
impl Notification {
@ -407,6 +403,7 @@ impl Notification {
content,
owner,
read: false,
tag: String::new(),
}
}
}