Add missing isAvailable flag

This commit is contained in:
Manfred Karrer 2016-06-16 20:38:34 +02:00
parent 5336bfb8f6
commit 230e2540c4
2 changed files with 5 additions and 1 deletions

View File

@ -26,6 +26,9 @@ public final class OfferAvailabilityResponse extends OfferMessage {
public final AvailabilityResult availabilityResult;
// TODO keep for backward compatibility. Can be removed once everyone is on v0.4.9
public boolean isAvailable;
public OfferAvailabilityResponse(String offerId, AvailabilityResult availabilityResult) {
super(offerId);
this.availabilityResult = availabilityResult;

View File

@ -40,7 +40,8 @@ public class ProcessOfferAvailabilityResponse extends Task<OfferAvailabilityMode
OfferAvailabilityResponse offerAvailabilityResponse = model.getMessage();
if (model.offer.getState() != Offer.State.REMOVED) {
if (offerAvailabilityResponse.availabilityResult == AvailabilityResult.AVAILABLE) {
// TODO: isAvailable is kept for backward compatibility. Can be removed once everyone is on v0.4.9
if (offerAvailabilityResponse.isAvailable || offerAvailabilityResponse.availabilityResult == AvailabilityResult.AVAILABLE) {
model.offer.setState(Offer.State.AVAILABLE);
} else {
log.warn("Offer rejected because of: " + offerAvailabilityResponse.availabilityResult);