From 608ec68ae65978988dc12301ece6d37ae7e33907 Mon Sep 17 00:00:00 2001 From: Adam Date: Wed, 18 Dec 2019 17:41:59 -0500 Subject: [PATCH] api: modify RemoveFriend to accept a nameable Also update javadoc to reflect that it now also includes ignores --- .../main/java/net/runelite/api/events/RemovedFriend.java | 7 ++++--- .../client/plugins/friendnotes/FriendNotesPlugin.java | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/runelite-api/src/main/java/net/runelite/api/events/RemovedFriend.java b/runelite-api/src/main/java/net/runelite/api/events/RemovedFriend.java index c60cd13c33..a4bed3e95f 100644 --- a/runelite-api/src/main/java/net/runelite/api/events/RemovedFriend.java +++ b/runelite-api/src/main/java/net/runelite/api/events/RemovedFriend.java @@ -25,15 +25,16 @@ package net.runelite.api.events; import lombok.Value; +import net.runelite.api.Nameable; /** - * An event where a request to remove a friend is sent to the server. + * An event trigger when a player is removed from the friend or ignore list. */ @Value public class RemovedFriend { /** - * The name of the removed friend. + * The removed friend or ignore entry */ - private final String name; + private final Nameable nameable; } diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/friendnotes/FriendNotesPlugin.java b/runelite-client/src/main/java/net/runelite/client/plugins/friendnotes/FriendNotesPlugin.java index 75cc26163c..33371ec41f 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/friendnotes/FriendNotesPlugin.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/friendnotes/FriendNotesPlugin.java @@ -251,7 +251,7 @@ public class FriendNotesPlugin extends Plugin public void onRemovedFriend(RemovedFriend event) { // Delete a friend's note if they are removed - final String displayName = Text.toJagexName(event.getName()); + final String displayName = Text.toJagexName(event.getNameable().getName()); log.debug("Remove friend: '{}'", displayName); setFriendNote(displayName, null); }