Florianschmidtwelzow has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/354483 )

Change subject: Do not use Restbase by default for non-wikipedia sites
......................................................................

Do not use Restbase by default for non-wikipedia sites

If the user has set the developer setting mediaWikiBaseUri, the App still
thinks it has to use Restbase, however, Restbase is a very very Wikimedia
specific thing, so we can't assume, that third-party sites provide support
for Restbase. Because of this, the app now does not assume to use Restbase
anymore, if the user set's the base URI manually, unless the user has also
enabled restbase in the developers ettings, too.

This fixes the problem, that the app responds with 404, if Restbase is not
installed for the third-party mediawiki site set in the dev-preferences.

Bug: T165495
Change-Id: Ib2c1776cba07e1e985fb24ed4c7e84eab3a4d624
---
M app/src/main/java/org/wikipedia/settings/RbSwitch.java
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia 
refs/changes/83/354483/1

diff --git a/app/src/main/java/org/wikipedia/settings/RbSwitch.java 
b/app/src/main/java/org/wikipedia/settings/RbSwitch.java
index 6d3733e..204519b 100644
--- a/app/src/main/java/org/wikipedia/settings/RbSwitch.java
+++ b/app/src/main/java/org/wikipedia/settings/RbSwitch.java
@@ -1,8 +1,10 @@
 package org.wikipedia.settings;
 
+import android.net.Uri;
 import android.support.annotation.IntRange;
 import android.support.annotation.Nullable;
 
+import org.wikipedia.Constants;
 import org.wikipedia.WikipediaApp;
 import org.wikipedia.dataclient.WikiSite;
 import org.wikipedia.dataclient.okhttp.HttpStatusException;
@@ -57,7 +59,7 @@
     }
 
     private static boolean shouldUseRestBase() {
-        return isSlatedForRestBase() && hasNotRecentlyFailed();
+        return 
Prefs.getMediaWikiBaseUri().equals(Uri.parse(Constants.WIKIPEDIA_URL)) && 
isSlatedForRestBase() && hasNotRecentlyFailed();
     }
 
     private static boolean isSlatedForRestBase() {

-- 
To view, visit https://gerrit.wikimedia.org/r/354483
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib2c1776cba07e1e985fb24ed4c7e84eab3a4d624
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow <florian.schmidt.stargatewis...@gmail.com>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to