party service: prioritize user join handler over plugins

The Discord invites requires the party size to be >0 for invites to work.
Previously this was not updating the presence with the 1 (local) member
after joining due to the plugin event handler running prior to the
service adding the member to the party.

This also changes the party id to always be null when not in a party instead of
set to the special local party id. This simplifies the checks in the
plugins trying to differentiate being in your own party vs not being in
a party.
This commit is contained in:
Adam
2020-08-22 20:32:43 -04:00
parent 9dc757b089
commit a89202e230
4 changed files with 23 additions and 15 deletions

View File

@@ -28,6 +28,7 @@ import com.google.inject.Guice;
import com.google.inject.testing.fieldbinder.Bind;
import com.google.inject.testing.fieldbinder.BoundFieldModule;
import java.util.List;
import java.util.UUID;
import javax.inject.Inject;
import net.runelite.api.Client;
import net.runelite.client.discord.DiscordPresence;
@@ -71,6 +72,7 @@ public class DiscordStateTest
public void before()
{
Guice.createInjector(BoundFieldModule.of(this)).injectMembers(this);
when(partyService.getLocalPartyId()).thenReturn(UUID.nameUUIDFromBytes("test".getBytes()));
}
@Test