Skip to content

Commit

Permalink
fix(instance-info): use normalized Uri instead of parsing the uri
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasGGamerM committed Oct 4, 2023
1 parent a849ced commit 391a44c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,18 +153,14 @@ public boolean onOptionsItemSelected(MenuItem item){
if(id==R.id.share){
Intent intent = new Intent(Intent.ACTION_SEND);
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()));
} else if (id==R.id.open_timeline) {
Bundle args=new Bundle();
args.putString("account", accountID);
args.putString("domain", Uri.parse(instance.uri).getHost());
args.putString("domain", instance.normalizedUri);
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;
}

Expand Down
2 changes: 0 additions & 2 deletions mastodon/src/main/res/menu/instance_info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,4 @@
<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/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>

0 comments on commit 391a44c

Please sign in to comment.