Some last fixes to pinwatcher

captchafix
Florens Douwes 11 years ago
parent 4daeefdaff
commit ee239f3a02
  1. 4
      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;
@DatabaseField
public int quoteLastCount = -1;
public int quoteLastCount = 0;
@DatabaseField
public int quoteNewCount = -1;
public int quoteNewCount = 0;
public boolean isError = false;

@ -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;
}

Loading…
Cancel
Save