fix(instance-info): use normalized Uri instead of parsing the uri

This commit is contained in:
LucasGGamerM 2023-10-04 07:37:00 -03:00
parent a849ced203
commit 391a44c0e5
2 changed files with 3 additions and 9 deletions

View File

@ -153,18 +153,14 @@ public class SettingsServerFragment extends AppKitFragment{
if(id==R.id.share){ if(id==R.id.share){
Intent intent = new Intent(Intent.ACTION_SEND); Intent intent = new Intent(Intent.ACTION_SEND);
intent.setType("text/plain"); intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_TEXT, Uri.parse(instance.uri).getHost()); intent.putExtra(Intent.EXTRA_TEXT, instance.normalizedUri);
startActivity(Intent.createChooser(intent, item.getTitle())); startActivity(Intent.createChooser(intent, item.getTitle()));
} else if (id==R.id.open_timeline) { } else if (id==R.id.open_timeline) {
Bundle args=new Bundle(); Bundle args=new Bundle();
args.putString("account", accountID); args.putString("account", accountID);
args.putString("domain", Uri.parse(instance.uri).getHost()); args.putString("domain", instance.normalizedUri);
Nav.go(getActivity(), CustomLocalTimelineFragment.class, args); Nav.go(getActivity(), CustomLocalTimelineFragment.class, args);
} /* else if (id==R.id.moderated_servers) { }
Bundle args=new Bundle();
args.putParcelable("instance", Parcels.wrap(instance));
Nav.go(getActivity(), InstanceBlockListFragment.class, args);
} */
return true; return true;
} }

View File

@ -2,6 +2,4 @@
<menu xmlns:android="http://schemas.android.com/apk/res/android"> <menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/share" android:title="@string/share_user" android:icon="@drawable/ic_fluent_share_24_regular"/> <item android:id="@+id/share" android:title="@string/share_user" android:icon="@drawable/ic_fluent_share_24_regular"/>
<item android:id="@+id/open_timeline" android:title="@string/mo_instance_info_open_timeline" android:icon="@drawable/ic_fluent_timeline_24_regular"/> <item android:id="@+id/open_timeline" android:title="@string/mo_instance_info_open_timeline" android:icon="@drawable/ic_fluent_timeline_24_regular"/>
<item android:id="@+id/rules" android:title="@string/instance_rules_title" android:icon="@drawable/ic_fluent_task_list_ltr_24_regular"/>
<item android:id="@+id/moderated_servers" android:title="@string/mo_instance_info_moderated_servers" android:icon="@drawable/ic_fluent_book_exclamation_mark_24_regular"/>
</menu> </menu>