Commit 19d64a77 authored by Thomas's avatar Thomas
Browse files

#1160 - Use of fedilinks (scheme web+ap) / Fix url scheme to support with and without //

parent aedfaadd
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -455,9 +455,7 @@
                <action android:name="android.intent.action.VIEW" />
                <category android:name="android.intent.category.DEFAULT" />
                <category android:name="android.intent.category.BROWSABLE" />
                <data android:host="*" />
                <data android:pathPattern=".*" />
                <data android:scheme="web+activitypub" />
                <data android:scheme="web+ap" />
            </intent-filter>
        </activity>

+11 −2
Original line number Diff line number Diff line
@@ -13,7 +13,6 @@ package app.fedilab.android.activities;
 *
 * You should have received a copy of the GNU General Public License along with Fedilab; if not,
 * see <http://www.gnu.org/licenses>. */
import static app.fedilab.android.mastodon.helper.Helper.TAG;

import android.content.Intent;
import android.net.Uri;
@@ -26,7 +25,6 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;

import app.fedilab.android.mastodon.activities.ProfileActivity;
import app.fedilab.android.mastodon.client.entities.api.Mention;
import app.fedilab.android.mastodon.client.entities.app.CachedBundle;
import app.fedilab.android.mastodon.helper.Helper;

@@ -48,6 +46,17 @@ public class WebActivityPub extends AppCompatActivity {
            finish();
            return;
        }
        String scheme = uri.getScheme();
        String uriString = uri.toString();
        if(!uriString.startsWith(scheme+"://")) {
            uriString = uri.toString().replace(scheme+":",scheme+"://");
            uri = Uri.parse(uriString);
            if(uri == null) {
                finish();
                return;
            }
        }

        String host = uri.getHost();
        String path = uri.getPath();
        String query = uri.getQuery();