From 7581617a575fcfde748704ef6265dfb02ed6fe08 Mon Sep 17 00:00:00 2001 From: Samuel Tardieu Date: Tue, 17 Sep 2013 21:09:32 +0200 Subject: Do not try to hide an unpublished cache to its owner The regular expression was not up-to-date anyway, and that may be a useful feature to ensure that the cache description works well with c:geo. --- .../cgeo/geocaching/connector/gc/GCConstants.java | 1 - .../src/cgeo/geocaching/connector/gc/GCParser.java | 2 +- tests/res/raw/gc433yc_owner_unpublished.html | 2188 -------------------- .../cgeo/geocaching/connector/gc/GCParserTest.java | 5 - 4 files changed, 1 insertion(+), 2195 deletions(-) delete mode 100644 tests/res/raw/gc433yc_owner_unpublished.html diff --git a/main/src/cgeo/geocaching/connector/gc/GCConstants.java b/main/src/cgeo/geocaching/connector/gc/GCConstants.java index 16aa967..cd43cfb 100644 --- a/main/src/cgeo/geocaching/connector/gc/GCConstants.java +++ b/main/src/cgeo/geocaching/connector/gc/GCConstants.java @@ -167,7 +167,6 @@ public final class GCConstants { public final static String STRING_PREMIUMONLY_2 = "Sorry, the owner of this listing has made it viewable to Premium Members only."; public final static String STRING_PREMIUMONLY_1 = "has chosen to make this cache listing visible to Premium Members only."; - public final static String STRING_UNPUBLISHED_OWNER = "cache has not been published yet"; public final static String STRING_UNPUBLISHED_OTHER = "you cannot view this cache listing until it has been published"; public final static String STRING_UNPUBLISHED_FROM_SEARCH = "UnpublishedCacheSearchWidget"; public final static String STRING_UNKNOWN_ERROR = "An Error Has Occurred"; diff --git a/main/src/cgeo/geocaching/connector/gc/GCParser.java b/main/src/cgeo/geocaching/connector/gc/GCParser.java index 71f8045..20dc156 100644 --- a/main/src/cgeo/geocaching/connector/gc/GCParser.java +++ b/main/src/cgeo/geocaching/connector/gc/GCParser.java @@ -374,7 +374,7 @@ public abstract class GCParser { final SearchResult searchResult = new SearchResult(); - if (pageIn.contains(GCConstants.STRING_UNPUBLISHED_OTHER) || pageIn.contains(GCConstants.STRING_UNPUBLISHED_OWNER) || pageIn.contains(GCConstants.STRING_UNPUBLISHED_FROM_SEARCH)) { + if (pageIn.contains(GCConstants.STRING_UNPUBLISHED_OTHER) || pageIn.contains(GCConstants.STRING_UNPUBLISHED_FROM_SEARCH)) { searchResult.setError(StatusCode.UNPUBLISHED_CACHE); return searchResult; } diff --git a/tests/res/raw/gc433yc_owner_unpublished.html b/tests/res/raw/gc433yc_owner_unpublished.html deleted file mode 100644 index aa144b0..0000000 --- a/tests/res/raw/gc433yc_owner_unpublished.html +++ /dev/null @@ -1,2188 +0,0 @@ - - - - - - GC433YC Stenarna (Earthcache) in Södermanland, Sweden created by ra_sch - - - - - - - - - - - - - - - - - - - - - - - - - -
-
- - - - - -
- - - - - - - - - - - - - - - - - - - - - -
- -

- Geocaching.com

-
- -
- -
- -
- -

- Geocaching

-
- - - -
- -

-

-

- - Hello, ra_sch (Sign Out)
- Premium Member - - - 957 Caches Found - -

- -
- - -
- - - - -
- - -
-
- - -
- - - -
- - - - - -
- - - x -
- - -
- -
-

- Earthcache -

- -

- Stenarna

-
-
- A cache by ra_sch
-
- Hidden: - 12/21/2012 - -
-
-
-
-
- - Difficulty: -
- Terrain: - -
- -
- - 1.5 out of 5 - 1.5 out of 5 - -
- -
- -

- Size: Size: not chosen (not chosen)

Durchschnitt (Mittel) 0.0 von 5 (0)

- -
- - - -
- - - - - -
- - -

-

- - - - -
-
-
-

- - N 58° 48.021 E 017° 48.603 - -
- - UTM: 33V E 662347 N 6521227 -
-
- Other Conversions - -

-
-
- In Södermanland, Sweden
- NE NE 1170.9 km from your home location -
-
-
-

- Print: -
- - - Print  - No Logs - -   - 5 Logs  - 10 Logs ·  - - Driving Directions  - Driving Directions - -

- -
-
-

- Download: - - Read about waypoint downloads - -

- -

- - | - - | - - | - - |

- -
-
GCTour
- -
- - Please note - -

- Use of geocaching.com services is subject to the terms and conditions in our disclaimer. -

-
- - -
- - Personal Cache Note - - -

Click to enter a note

-
- -
- - Test - - -
- -
-
- - Test - -
- -

- - -

-

- - Additional Hints - (No hints available.)

-
-
-
- -
-
-
- -
- - -
- - - - - - - - - - - - -
- -

- Attributes

- - -
- - -
- -
- -

- -

-

- Advertising with Us

- -
- -
- - - - -
-
- - - - -
- -

- Inventory -

- - - -
- - - - -
- - -
- -

- Additional Waypoints (Add / Edit waypoints) -
- No additional waypoints to display. - -

- -
- -
-
- -
-
- To print the map in Firefox and Opera, enable background images in the print dialog. - - Close - -
-
- -
- -

- Find... -
- -

- -

- For online maps... -

- - - - - -

- -

- -
-

- 1 Logged Visit

-
- Decrypt -
-

Post Reviewer Note 1     

-

- View Logbook -

-

- **Warning! Spoilers may be included in the descriptions or links. -

-
- -
- - - - - - - - -

ra_sch

Premium Member

957

Post Reviewer Note Post Reviewer Note
12/21/2012
-
- Loading - Loading Cache Logs... -
- -
-
-

- - Current Time:
Last Updated: on 12/21/2012 11:14:41 (UTC-08:00) Pacific Time (US & Canada) (19:14 GMT)
Last Found: Never
This cache has not been published yet.
Rendered From:Unknown
Coordinates are in the WGS84 datum -
-

- - -
- - - - - - - - - - -
- - - - -
- - -
- - - - - - - - -
- - - - - - - - - - - -
- - - -
- - - - - -
New TourLoad a tourDownload TourautoTourShow settingsSend a message to the author.
Tour 2 (0)
RenamePrintviewSend to GPSDownload GPXView on mapUpload tourAdd own waypointDelete this tour
    The list is empty.
\ No newline at end of file diff --git a/tests/src/cgeo/geocaching/connector/gc/GCParserTest.java b/tests/src/cgeo/geocaching/connector/gc/GCParserTest.java index 0ef0108..163cbe7 100644 --- a/tests/src/cgeo/geocaching/connector/gc/GCParserTest.java +++ b/tests/src/cgeo/geocaching/connector/gc/GCParserTest.java @@ -34,11 +34,6 @@ public class GCParserTest extends AbstractResourceInstrumentationTestCase { assertUnpublished(cache); } - public void testUnpublishedCacheOwner() { - final int cache = R.raw.gc433yc_owner_unpublished; - assertUnpublished(cache); - } - private void assertUnpublished(final int cache) { final String page = getFileContent(cache); final SearchResult result = GCParser.parseCacheFromText(page, null); -- cgit v1.1