Permalink
Browse files

For ReadItLater send the inner URL and not the link to the twitter page.

  • Loading branch information...
1 parent ae81cb2 commit af0ad251e91bb083db48b4384dbcfdec890f0efe @pilhuhn committed Aug 31, 2012
Showing with 16 additions and 4 deletions.
  1. +16 −4 src/de/bsd/zwitscher/OneTweetActivity.java
@@ -482,11 +482,21 @@ public void readItLater(View v) {
return;
}
- String url;
+ String url = null;
if (account.isStatusNet())
url = "https://identi.ca/notice/" + status.getId();
- else
- url = "https://twitter.com/#!/" + status.getUser().getScreenName() + "/status/" + status.getId();
+ else {
+ // do not link to the status here, but to the link(s) inside
+ if (status.getURLEntities()!=null && status.getURLEntities().length>0) {
+ URLEntity ue = status.getURLEntities()[0]; // TODO grab all urls
+ if (ue.getExpandedURL()!=null)
+ url = ue.getExpandedURL().toString();
+ else if (ue.getURL()!=null)
+ url = ue.getURL().toString();
+ }
+ if (url==null) // Fallback
+ url = "https://twitter.com/#!/" + status.getUser().getScreenName() + "/status/" + status.getId();
+ }
UpdateRequest request = new UpdateRequest(UpdateType.LATER_READING);
request.status = status;
@@ -818,6 +828,7 @@ public boolean onOptionsItemSelected(MenuItem item) {
reply(null);
break;
case R.id.retweet:
+ item.setEnabled(false); // TODO show busy spinner?
retweet(null);
break;
case R.id.direct:
@@ -855,7 +866,8 @@ public boolean onOptionsItemSelected(MenuItem item) {
Log.e(getClass().getName(),"Unknown menu item: " + item.toString());
}
- return super.onOptionsItemSelected(item);
+ return true;
+// return super.onOptionsItemSelected(item);
}

0 comments on commit af0ad25

Please sign in to comment.