aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/hannibal2/skyhanni/data/PartyAPI.kt
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/hannibal2/skyhanni/data/PartyAPI.kt')
-rw-r--r--src/main/java/at/hannibal2/skyhanni/data/PartyAPI.kt14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/main/java/at/hannibal2/skyhanni/data/PartyAPI.kt b/src/main/java/at/hannibal2/skyhanni/data/PartyAPI.kt
index 3bd3967be..10739720a 100644
--- a/src/main/java/at/hannibal2/skyhanni/data/PartyAPI.kt
+++ b/src/main/java/at/hannibal2/skyhanni/data/PartyAPI.kt
@@ -168,19 +168,16 @@ object PartyAPI {
// party disbanded
disbandedPattern.matchMatcher(message) {
- partyMembers.clear()
- partyLeader = null
+ partyLeft()
}
kickedPattern.matchMatcher(message) {
- partyMembers.clear()
- partyLeader = null
+ partyLeft()
}
if (message == "§eYou left the party." ||
message == "§cThe party was disbanded because all invites expired and the party was empty." ||
message == "§cYou are not currently in a party."
) {
- partyMembers.clear()
- partyLeader = null
+ partyLeft()
}
// party list
@@ -206,4 +203,9 @@ object PartyAPI {
if (playerName == LorenzUtils.getPlayerName()) return
partyMembers.add(playerName)
}
+
+ private fun partyLeft() {
+ partyMembers.clear()
+ partyLeader = null
+ }
}