Check user is host for host-broadcasted project messages
This commit is contained in:
@@ -60,8 +60,10 @@ macro_rules! request_messages {
|
||||
|
||||
#[macro_export]
|
||||
macro_rules! entity_messages {
|
||||
($id_field:ident, $($name:ident),* $(,)?) => {
|
||||
({$id_field:ident, $entity_type:ty}, $($name:ident),* $(,)?) => {
|
||||
$(impl EntityMessage for $name {
|
||||
type Entity = $entity_type;
|
||||
|
||||
fn remote_entity_id(&self) -> u64 {
|
||||
self.$id_field
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ pub trait EnvelopedMessage: Clone + Debug + Serialize + Sized + Send + Sync + 's
|
||||
}
|
||||
|
||||
pub trait EntityMessage: EnvelopedMessage {
|
||||
type Entity;
|
||||
fn remote_entity_id(&self) -> u64;
|
||||
}
|
||||
|
||||
@@ -369,7 +370,7 @@ request_messages!(
|
||||
);
|
||||
|
||||
entity_messages!(
|
||||
project_id,
|
||||
{project_id, ShareProject},
|
||||
AddProjectCollaborator,
|
||||
ApplyCodeAction,
|
||||
ApplyCompletionAdditionalEdits,
|
||||
@@ -422,7 +423,7 @@ entity_messages!(
|
||||
);
|
||||
|
||||
entity_messages!(
|
||||
channel_id,
|
||||
{channel_id, Channel},
|
||||
ChannelMessageSent,
|
||||
RemoveChannelMessage,
|
||||
UpdateChannelBuffer,
|
||||
|
||||
Reference in New Issue
Block a user