diff options
Diffstat (limited to 'main/src/cgeo/geocaching/Geocache.java')
| -rw-r--r-- | main/src/cgeo/geocaching/Geocache.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/main/src/cgeo/geocaching/Geocache.java b/main/src/cgeo/geocaching/Geocache.java index fa25576..1ed699e 100644 --- a/main/src/cgeo/geocaching/Geocache.java +++ b/main/src/cgeo/geocaching/Geocache.java @@ -25,6 +25,7 @@ import cgeo.geocaching.list.StoredList; import cgeo.geocaching.network.HtmlImage; import cgeo.geocaching.settings.Settings; import cgeo.geocaching.utils.CancellableHandler; +import cgeo.geocaching.utils.DateUtils; import cgeo.geocaching.utils.ImageUtils; import cgeo.geocaching.utils.LazyInitializedList; import cgeo.geocaching.utils.Log; @@ -1808,4 +1809,23 @@ public class Geocache implements ICache, IWaypoint { return (getType().applyDistanceRule() || hasUserModifiedCoords()) && getConnector() == GCConnector.getInstance(); } + public LogType getDefaultLogType() { + if (isEventCache()) { + final Date eventDate = getHiddenDate(); + boolean expired = DateUtils.isPastEvent(this); + + if (hasOwnLog(LogType.WILL_ATTEND) || expired || (eventDate != null && DateUtils.daysSince(eventDate.getTime()) == 0)) { + return hasOwnLog(LogType.ATTENDED) ? LogType.NOTE : LogType.ATTENDED; + } + return LogType.WILL_ATTEND; + } + if (isFound()) { + return LogType.NOTE; + } + if (getType() == CacheType.WEBCAM) { + return LogType.WEBCAM_PHOTO_TAKEN; + } + return LogType.FOUND_IT; + } + } |
