From 665009d0b2fa2f85634405312b91ef17fb580d4f Mon Sep 17 00:00:00 2001 From: Abdulrahman Salah Date: Sun, 26 Jun 2022 17:32:55 +0000 Subject: [PATCH] fix: remove useless group events --- src/gateway/payload.rs | 2 -- src/gateway/upgrade.rs | 6 ------ src/routes/invites/join.rs | 2 +- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/gateway/payload.rs b/src/gateway/payload.rs index beea3eb..67b36e0 100644 --- a/src/gateway/payload.rs +++ b/src/gateway/payload.rs @@ -26,8 +26,6 @@ pub enum Payload { ChannelCreate(Channel), ChannelDelete(Empty), ChannelUpdate(Channel), - GroupUserJoin(User), - GroupUserLeave(User), MessageCreate(Message), MessageDelete(Empty), MessageUpdate(Message), diff --git a/src/gateway/upgrade.rs b/src/gateway/upgrade.rs index ed01909..b6bf3e4 100644 --- a/src/gateway/upgrade.rs +++ b/src/gateway/upgrade.rs @@ -115,12 +115,6 @@ async fn handle(ws: WebSocket) { } } - Payload::GroupUserLeave(data) => { - if data.id == user.id { - client.subscriptions = Subscription::Remove(vec![target_id]); - } - } - Payload::ServerDelete(_) => { client.subscriptions = Subscription::Remove(vec![target_id]); } diff --git a/src/routes/invites/join.rs b/src/routes/invites/join.rs index 9e8bc3d..966eb57 100644 --- a/src/routes/invites/join.rs +++ b/src/routes/invites/join.rs @@ -50,7 +50,7 @@ pub async fn join(Extension(user): Extension, Path(code): Path) -> group.update().await; - publish(group.id, Payload::GroupUserJoin(user.clone())).await; + publish(group.id, Payload::ChannelUpdate(group.clone())).await; publish(user.id, Payload::ChannelCreate(group)).await; Ok(())