Implement channel changes for messages

This commit is contained in:
Mikayla 2023-10-01 22:21:27 -07:00
parent 51cf6a5ff3
commit 1d5b665f13
No known key found for this signature in database
12 changed files with 212 additions and 28 deletions

View file

@ -464,10 +464,14 @@ impl Database {
}
let mut channels_with_changed_notes = HashSet::default();
let mut channels_with_new_messages = HashSet::default();
for channel in graph.channels.iter() {
if self.has_note_changed(user_id, channel.id, tx).await? {
channels_with_changed_notes.insert(channel.id);
}
if self.has_new_message(channel.id, user_id, tx).await? {
channels_with_new_messages.insert(channel.id);
}
}
Ok(ChannelsForUser {
@ -475,6 +479,7 @@ impl Database {
channel_participants,
channels_with_admin_privileges,
channels_with_changed_notes,
channels_with_new_messages,
})
}