Some last fixes to pinwatcher

captchafix
Florens Douwes 11 years ago
parent 4daeefdaff
commit ee239f3a02
  1. 6
      Chan/src/org/floens/chan/core/model/Pin.java
  2. 8
      Chan/src/org/floens/chan/core/watch/PinWatcher.java

@ -36,10 +36,10 @@ public class Pin {
public int watchNewCount = -1; public int watchNewCount = -1;
@DatabaseField @DatabaseField
public int quoteLastCount = -1; public int quoteLastCount = 0;
@DatabaseField @DatabaseField
public int quoteNewCount = -1; public int quoteNewCount = 0;
public boolean isError = false; public boolean isError = false;
@ -85,7 +85,7 @@ public class Pin {
pinWatcher = null; pinWatcher = null;
} }
} }
public void toggleWatch() { public void toggleWatch() {
watching = !watching; watching = !watching;
ChanApplication.getPinnedManager().onPinsChanged(); ChanApplication.getPinnedManager().onPinsChanged();

@ -98,9 +98,6 @@ public class PinWatcher implements Loader.LoaderListener {
if (pin.watchLastCount < 0) if (pin.watchLastCount < 0)
pin.watchLastCount = pin.watchNewCount; pin.watchLastCount = pin.watchNewCount;
if (pin.quoteLastCount < 0)
pin.quoteLastCount = pin.quoteNewCount;
pin.watchNewCount = result.size(); pin.watchNewCount = result.size();
// Get list of saved posts // 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 // Find posts quoting these saved posts
pin.quoteNewCount = 0; pin.quoteNewCount = 0;
@ -124,7 +122,7 @@ public class PinWatcher implements Loader.LoaderListener {
} }
} }
if (pin.quoteNewCount > lastCount) { if (pin.quoteNewCount > lastCounterForSoundNotification) {
wereNewQuotes = true; wereNewQuotes = true;
} }

Loading…
Cancel
Save