From 851d7d0bc4e4244f85e8633c74326be929952587 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Thu, 19 Oct 2023 13:29:14 -0700 Subject: [PATCH] Rename NewNotification proto message to AddNotification --- crates/channel/src/channel_chat.rs | 3 +++ crates/collab/src/rpc.rs | 2 +- crates/notifications/src/notification_store.rs | 2 +- crates/rpc/proto/zed.proto | 4 ++-- crates/rpc/src/proto.rs | 2 +- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/crates/channel/src/channel_chat.rs b/crates/channel/src/channel_chat.rs index 5f256f2f29dc48efaec30c9976a7f954152db698..c08b6571871522d473f2da7f81edbb06976ce00d 100644 --- a/crates/channel/src/channel_chat.rs +++ b/crates/channel/src/channel_chat.rs @@ -242,6 +242,9 @@ impl ChannelChat { }) } + /// Load all of the chat messages since a certain message id. + /// + /// For now, we always maintain a suffix of the channel's messages. pub async fn load_history_since_message( chat: ModelHandle, message_id: u64, diff --git a/crates/collab/src/rpc.rs b/crates/collab/src/rpc.rs index 7ff1dc7717c9d721c097cedc8e1b0c88a544f30a..adb7ff50ff845d1d9599cb1a90fa0dea10af3d9b 100644 --- a/crates/collab/src/rpc.rs +++ b/crates/collab/src/rpc.rs @@ -2934,7 +2934,7 @@ fn send_notifications( for connection_id in connection_pool.user_connection_ids(user_id) { if let Err(error) = peer.send( connection_id, - proto::NewNotification { + proto::AddNotification { notification: Some(notification.clone()), }, ) { diff --git a/crates/notifications/src/notification_store.rs b/crates/notifications/src/notification_store.rs index 0ee4ad35f1581bf9e75a2de3863a79346de876ac..6aeb792e870c0bdbe9389626ec9b01bf8601ecc9 100644 --- a/crates/notifications/src/notification_store.rs +++ b/crates/notifications/src/notification_store.rs @@ -154,7 +154,7 @@ impl NotificationStore { async fn handle_new_notification( this: ModelHandle, - envelope: TypedEnvelope, + envelope: TypedEnvelope, _: Arc, cx: AsyncAppContext, ) -> Result<()> { diff --git a/crates/rpc/proto/zed.proto b/crates/rpc/proto/zed.proto index 6eeb006f3a609d86815f401fb296591ee9aaf53a..854c3f0f9a0a0d86361e9f8deee9712c21f1a2a1 100644 --- a/crates/rpc/proto/zed.proto +++ b/crates/rpc/proto/zed.proto @@ -176,7 +176,7 @@ message Envelope { MoveChannel move_channel = 147; SetChannelVisibility set_channel_visibility = 148; - NewNotification new_notification = 149; + AddNotification add_notification = 149; GetNotifications get_notifications = 150; GetNotificationsResponse get_notifications_response = 151; DeleteNotification delete_notification = 152; @@ -1610,7 +1610,7 @@ message GetNotifications { optional uint64 before_id = 1; } -message NewNotification { +message AddNotification { Notification notification = 1; } diff --git a/crates/rpc/src/proto.rs b/crates/rpc/src/proto.rs index 1c46bbbb14188a44bf0f138bf829cc45c5a5ffa9..571fbec86529fbde19922a560434af687b9538b8 100644 --- a/crates/rpc/src/proto.rs +++ b/crates/rpc/src/proto.rs @@ -135,6 +135,7 @@ messages!( (Ack, Foreground), (AckBufferOperation, Background), (AckChannelMessage, Background), + (AddNotification, Foreground), (AddProjectCollaborator, Foreground), (ApplyCodeAction, Background), (ApplyCodeActionResponse, Background), @@ -212,7 +213,6 @@ messages!( (LinkChannel, Foreground), (MarkNotificationsRead, Foreground), (MoveChannel, Foreground), - (NewNotification, Foreground), (OnTypeFormatting, Background), (OnTypeFormattingResponse, Background), (OpenBufferById, Background),