diff --git a/Chan/src/org/floens/chan/core/model/Pin.java b/Chan/src/org/floens/chan/core/model/Pin.java index fabbd0e8..a8b1bbf5 100644 --- a/Chan/src/org/floens/chan/core/model/Pin.java +++ b/Chan/src/org/floens/chan/core/model/Pin.java @@ -36,10 +36,10 @@ public class Pin { public int watchNewCount = -1; @DatabaseField - public int quoteLastCount = -1; + public int quoteLastCount = 0; @DatabaseField - public int quoteNewCount = -1; + public int quoteNewCount = 0; public boolean isError = false; @@ -85,7 +85,7 @@ public class Pin { pinWatcher = null; } } - + public void toggleWatch() { watching = !watching; ChanApplication.getPinnedManager().onPinsChanged(); diff --git a/Chan/src/org/floens/chan/core/watch/PinWatcher.java b/Chan/src/org/floens/chan/core/watch/PinWatcher.java index 11f831e5..4a51fb1b 100644 --- a/Chan/src/org/floens/chan/core/watch/PinWatcher.java +++ b/Chan/src/org/floens/chan/core/watch/PinWatcher.java @@ -98,9 +98,6 @@ public class PinWatcher implements Loader.LoaderListener { if (pin.watchLastCount < 0) pin.watchLastCount = pin.watchNewCount; - if (pin.quoteLastCount < 0) - pin.quoteLastCount = pin.quoteNewCount; - pin.watchNewCount = result.size(); // Get list of saved posts @@ -111,7 +108,8 @@ public class PinWatcher implements Loader.LoaderListener { } } - int lastCount = pin.quoteNewCount; + // If there are more replies than last time, let the notification make a sound + int lastCounterForSoundNotification = pin.quoteNewCount; // Find posts quoting these saved posts pin.quoteNewCount = 0; @@ -124,7 +122,7 @@ public class PinWatcher implements Loader.LoaderListener { } } - if (pin.quoteNewCount > lastCount) { + if (pin.quoteNewCount > lastCounterForSoundNotification) { wereNewQuotes = true; }