New Feature: Add server-side channel unreads.

This commit is contained in:
Paul
2021-06-16 23:24:31 +01:00
parent d2b17b64e7
commit 4727f997ed
14 changed files with 133 additions and 10 deletions

View File

@@ -63,7 +63,7 @@ pub enum ClientboundNotification {
Ready {
users: Vec<User>,
servers: Vec<Server>,
channels: Vec<Channel>,
channels: Vec<Channel>
},
Message(Message),
@@ -103,6 +103,11 @@ pub enum ClientboundNotification {
id: String,
user: String,
},
ChannelAck {
id: String,
user: String,
message_id: String
},
ServerUpdate {
id: String,

View File

@@ -113,6 +113,6 @@ pub async fn generate_ready(mut user: User) -> Result<ClientboundNotification> {
Ok(ClientboundNotification::Ready {
users,
servers,
channels,
channels
})
}

View File

@@ -244,7 +244,8 @@ pub fn publish(ids: Vec<String>, notification: ClientboundNotification) {
// Block certain notifications from reaching users that aren't meant to see them.
match &notification {
ClientboundNotification::UserRelationship { id: user_id, .. }
| ClientboundNotification::UserSettingsUpdate { id: user_id, .. } => {
| ClientboundNotification::UserSettingsUpdate { id: user_id, .. }
| ClientboundNotification::ChannelAck { user: user_id, .. } => {
if &id != user_id {
continue;
}