Skip to content
This repository has been archived by the owner on Apr 8, 2023. It is now read-only.

Commit

Permalink
Merge pull request #2444 from ThatGamerBlue/discord-is-shit
Browse files Browse the repository at this point in the history
party: fix websocket events not being posted
  • Loading branch information
ThatGamerBlue authored Mar 20, 2020
2 parents f063b84 + f4887eb commit 796e8f2
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,14 +177,16 @@ public void onMessage(@NotNull WebSocket webSocket, @NotNull String text)
}
message.text = text;

if (message instanceof PartyMemberMessage)
for (Class<? extends WebsocketMessage> clazz : messages)
{
eventBus.post(PartyMemberMessage.class, message);
}
else
{
eventBus.post(WebsocketMessage.class, message);
if (clazz.isInstance(message))
{
eventBus.post(clazz, message);
return;
}
}

eventBus.post(message instanceof PartyMemberMessage ? PartyMemberMessage.class : WebsocketMessage.class, message);
}

@Override
Expand Down

0 comments on commit 796e8f2

Please sign in to comment.