ZeeRooo / MaterialFBook

A light alternative client for Facebook based on the web with a modern look (Material Design)
GNU General Public License v3.0
139 stars 44 forks source link

Sharing Event Links Creates Huge Ugly Links #196

Closed landry314 closed 4 years ago

landry314 commented 6 years ago

When I share an event link using the "Share Link" function in the floating button, it creates a really long link that is very ugly. I always find myself trimming it down to before the "?acontext=" in the link; i manually delete the query by deleting the '?' character and everything after it before sharing the link.

I would be so happy if MaterialFBook would do this for me. All the information in the query is totally unnecesary for sharing the link and it makes it look ugly... This might also be a privacy issue, I don't know what it all means but it could be revealing something about me.

Can the query be deleted before the link is shared? Does anyone agree this is a good idea?

If there is any argument, maybe a setting could be created, "make links ugly and have too much unnecesary info" hahaha.

catb0t commented 5 years ago

Facebook includes a bunch of arguably invasive and pointless tracking information (for the clicker, not so much the sharer) in that link query string, but MFB can't mess with it a lot because

  1. Facebook breaking things silently all the time

  2. un-parsing that link and making a Dictionary out of the query string keys and sifting them for the important ones and then re-generating the link string is a lot of memory and slowdown for such a simple and rewardless operation

creativetrendsapps commented 5 years ago

Probably a better way of doing this but...

if(webView.getUrl() != null && webView.getUrl().contains("/events/")) { try { Intent sharingIntent = new Intent(Intent.ACTION_SEND); sharingIntent.setType("text/plain"); sharingIntent.putExtra(Intent.EXTRA_TEXT, webView.getUrl().substring(0, webView.getUrl().indexOf("?")).replace("m.facebook.com", "www.facebook.com")); startActivity(Intent.createChooser(sharingIntent, getResources().getString(R.string.share_action))); Log.i("New event link", webView.getUrl().substring(0, webView.getUrl().indexOf("?")).replace("m.facebook.com", "www.facebook.com")); }catch (StringIndexOutOfBoundsException i){ i.printStackTrace(); Intent sharingIntent = new Intent(Intent.ACTION_SEND); sharingIntent.setType("text/plain"); sharingIntent.putExtra(Intent.EXTRA_TEXT, webView.getUrl()); startActivity(Intent.createChooser(sharingIntent, getResources().getString(R.string.share_action))); Log.e("Couldn't truncate link", webView.getUrl()); } }else{ Intent sharingIntent = new Intent(Intent.ACTION_SEND); sharingIntent.setType("text/plain"); sharingIntent.putExtra(Intent.EXTRA_TEXT, webView.getUrl()); startActivity(Intent.createChooser(sharingIntent, getResources().getString(R.string.share_action))); }