diff --git a/CHANGELOG.md b/CHANGELOG.md index d79f0e79..1b18fd12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ## Unreleased +- Bugfix: Avoid duplicate grand exchange notifications for partial transactions at trade limit. + ## 1.6.1 - Minor: Include new pet names from Desert Treasure II bosses in notification metadata. (#279) diff --git a/src/main/java/dinkplugin/notifiers/GrandExchangeNotifier.java b/src/main/java/dinkplugin/notifiers/GrandExchangeNotifier.java index 32c8a22d..10c080ba 100644 --- a/src/main/java/dinkplugin/notifiers/GrandExchangeNotifier.java +++ b/src/main/java/dinkplugin/notifiers/GrandExchangeNotifier.java @@ -170,6 +170,9 @@ private boolean shouldNotify(int slot, GrandExchangeOffer offer) { if (spacing < 0) return false; // negative => no in-progress notifications allowed + if (getSavedOffer(slot).filter(saved -> saved.equals(offer)).isPresent()) + return false; // ignore since quantity already observed (relevant when trade limit is binding) + // convert minutes to seconds, but treat 0 minutes as 2 seconds to workaround duplicate RL events long spacingSeconds = spacing > 0 ? spacing * 60L : 2L;