hiscore plugin: add Lookup to ignore list

This commit is contained in:
Rami
2019-12-23 19:34:20 -05:00
committed by Adam
parent 6d9aaaf838
commit f3b8bace72

View File

@@ -66,7 +66,7 @@ public class HiscorePlugin extends Plugin
{
private static final String LOOKUP = "Lookup";
private static final String KICK_OPTION = "Kick";
private static final ImmutableList<String> AFTER_OPTIONS = ImmutableList.of("Message", "Add ignore", "Remove friend", KICK_OPTION);
private static final ImmutableList<String> AFTER_OPTIONS = ImmutableList.of("Message", "Add ignore", "Remove friend", "Delete", KICK_OPTION);
private static final Pattern BOUNTY_PATTERN = Pattern.compile("<col=ff0000>You've been assigned a target: (.*)</col>");
@Inject
@@ -177,11 +177,10 @@ public class HiscorePlugin extends Plugin
if (groupId == WidgetInfo.FRIENDS_LIST.getGroupId() || groupId == WidgetInfo.CLAN_CHAT.getGroupId() ||
groupId == WidgetInfo.CHATBOX.getGroupId() && !KICK_OPTION.equals(option) || //prevent from adding for Kick option (interferes with the raiding party one)
groupId == WidgetInfo.RAIDING_PARTY.getGroupId() || groupId == WidgetInfo.PRIVATE_CHAT_MESSAGE.getGroupId())
groupId == WidgetInfo.RAIDING_PARTY.getGroupId() || groupId == WidgetInfo.PRIVATE_CHAT_MESSAGE.getGroupId() ||
groupId == WidgetInfo.IGNORE_LIST.getGroupId())
{
boolean after;
if (!AFTER_OPTIONS.contains(option))
if (!AFTER_OPTIONS.contains(option) || (option.equals("Delete") && groupId != WidgetInfo.IGNORE_LIST.getGroupId()))
{
return;
}