Skip to content

Commit

Permalink
fix: remove useless group events
Browse files Browse the repository at this point in the history
  • Loading branch information
abdulrahman1s committed Jun 26, 2022
1 parent a651d5f commit 665009d
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 9 deletions.
2 changes: 0 additions & 2 deletions src/gateway/payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ pub enum Payload {
ChannelCreate(Channel),
ChannelDelete(Empty),
ChannelUpdate(Channel),
GroupUserJoin(User),
GroupUserLeave(User),
MessageCreate(Message),
MessageDelete(Empty),
MessageUpdate(Message),
Expand Down
6 changes: 0 additions & 6 deletions src/gateway/upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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]);
}
Expand Down
2 changes: 1 addition & 1 deletion src/routes/invites/join.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pub async fn join(Extension(user): Extension<User>, Path(code): Path<String>) ->

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(())
Expand Down

0 comments on commit 665009d

Please sign in to comment.