mirror of
				https://codeberg.org/tom79/Fedilab.git
				synced 2025-10-20 11:20:16 +03:00 
			
		
		
		
	#1160 - Use of fedilinks (scheme web+ap) / Fix url scheme to support with and without //
This commit is contained in:
		
							parent
							
								
									aedfaaddbc
								
							
						
					
					
						commit
						19d64a778f
					
				
					 2 changed files with 12 additions and 5 deletions
				
			
		| 
						 | 
					@ -455,9 +455,7 @@
 | 
				
			||||||
                <action android:name="android.intent.action.VIEW" />
 | 
					                <action android:name="android.intent.action.VIEW" />
 | 
				
			||||||
                <category android:name="android.intent.category.DEFAULT" />
 | 
					                <category android:name="android.intent.category.DEFAULT" />
 | 
				
			||||||
                <category android:name="android.intent.category.BROWSABLE" />
 | 
					                <category android:name="android.intent.category.BROWSABLE" />
 | 
				
			||||||
                <data android:host="*" />
 | 
					                <data android:scheme="web+ap" />
 | 
				
			||||||
                <data android:pathPattern=".*" />
 | 
					 | 
				
			||||||
                <data android:scheme="web+activitypub" />
 | 
					 | 
				
			||||||
            </intent-filter>
 | 
					            </intent-filter>
 | 
				
			||||||
        </activity>
 | 
					        </activity>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -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,
 | 
					 * You should have received a copy of the GNU General Public License along with Fedilab; if not,
 | 
				
			||||||
 * see <http://www.gnu.org/licenses>. */
 | 
					 * see <http://www.gnu.org/licenses>. */
 | 
				
			||||||
import static app.fedilab.android.mastodon.helper.Helper.TAG;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
import android.content.Intent;
 | 
					import android.content.Intent;
 | 
				
			||||||
import android.net.Uri;
 | 
					import android.net.Uri;
 | 
				
			||||||
| 
						 | 
					@ -26,7 +25,6 @@ import java.util.regex.Matcher;
 | 
				
			||||||
import java.util.regex.Pattern;
 | 
					import java.util.regex.Pattern;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
import app.fedilab.android.mastodon.activities.ProfileActivity;
 | 
					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.client.entities.app.CachedBundle;
 | 
				
			||||||
import app.fedilab.android.mastodon.helper.Helper;
 | 
					import app.fedilab.android.mastodon.helper.Helper;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -48,6 +46,17 @@ public class WebActivityPub extends AppCompatActivity {
 | 
				
			||||||
            finish();
 | 
					            finish();
 | 
				
			||||||
            return;
 | 
					            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 host = uri.getHost();
 | 
				
			||||||
        String path = uri.getPath();
 | 
					        String path = uri.getPath();
 | 
				
			||||||
        String query = uri.getQuery();
 | 
					        String query = uri.getQuery();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue