From f46849b17692c5b7d288fe6382695b0dba4381a9 Mon Sep 17 00:00:00 2001 From: Chris Blyth Date: Mon, 3 Mar 2014 13:22:05 +0000 Subject: [PATCH 1/2] Fix for #407 - Favorites getting persisted to social network --- .../android/TwitterModifyStatuses.java | 57 +++++++++---------- .../TweetLanesCore/res/xml/changelog.xml | 1 + 2 files changed, 29 insertions(+), 29 deletions(-) diff --git a/android/libraries/SocialNetLib/src/org/tweetalib/android/TwitterModifyStatuses.java b/android/libraries/SocialNetLib/src/org/tweetalib/android/TwitterModifyStatuses.java index 74b4eb21..4f79163e 100644 --- a/android/libraries/SocialNetLib/src/org/tweetalib/android/TwitterModifyStatuses.java +++ b/android/libraries/SocialNetLib/src/org/tweetalib/android/TwitterModifyStatuses.java @@ -123,7 +123,7 @@ public void setWorkerCallbacks(ModifyStatusesWorkerCallbacks callbacks) { */ /* - * + * */ FinishedCallback getModifyStatusesCallback(Integer callbackHandle) { return mFinishedCallbackMap.get(callbackHandle); @@ -258,14 +258,13 @@ protected ModifyStatusesTaskOutput doInBackground(ModifyStatusesTaskInput... inp if (input.mStatuses != null) { for (int i = 0; i < input.mStatuses.getStatusCount(); i++) { TwitterStatus twitterStatus = input.mStatuses.getStatus(i); - if (twitterStatus.mIsFavorited != favorite) { - AdnPost post = appdotnetApi.setAdnFavorite(twitterStatus.mId, favorite); - if (post != null) { - twitterStatus = new TwitterStatus(post); - twitterStatus.setFavorite(favorite); - contentFeed.add(twitterStatus); - } + AdnPost post = appdotnetApi.setAdnFavorite(twitterStatus.mId, favorite); + + if (post != null) { + twitterStatus = new TwitterStatus(post); + twitterStatus.setFavorite(favorite); + contentFeed.add(twitterStatus); } } } @@ -292,27 +291,27 @@ protected ModifyStatusesTaskOutput doInBackground(ModifyStatusesTaskInput... inp if (input.mStatuses != null) { for (int i = 0; i < input.mStatuses.getStatusCount(); i++) { TwitterStatus twitterStatus = input.mStatuses.getStatus(i); - if (twitterStatus.mIsFavorited != favorite) { - try { - twitter4j.Status status; - if (favorite) { - status = twitter.createFavorite(twitterStatus.mId); - } else { - status = twitter.destroyFavorite(twitterStatus.mId); - } - - // Yuck: See the comment for - // TwitterStatus.setFavorite() for - // reasons for this - twitterStatus = new TwitterStatus(status); - twitterStatus.setFavorite(favorite); - - contentFeed.add(twitterStatus); - } catch (TwitterException e) { - // we might get errors setting the favorite - // state to the same - // value again. - // Just ignore those ones... + try { + twitter4j.Status status; + if (favorite) { + status = twitter.createFavorite(twitterStatus.mId); + } else { + status = twitter.destroyFavorite(twitterStatus.mId); + } + + // Yuck: See the comment for + // TwitterStatus.setFavorite() for + // reasons for this + twitterStatus = new TwitterStatus(status); + twitterStatus.setFavorite(favorite); + + contentFeed.add(twitterStatus); + } catch (TwitterException e) { + e.printStackTrace(); + errorDescription = e.getErrorMessage(); + Log.e("api-call", errorDescription, e); + if (e.getRateLimitStatus() != null && e.getRateLimitStatus().getRemaining() <= 0) { + throw e; } } } diff --git a/android/libraries/TweetLanesCore/res/xml/changelog.xml b/android/libraries/TweetLanesCore/res/xml/changelog.xml index c0105afb..07b29dbf 100644 --- a/android/libraries/TweetLanesCore/res/xml/changelog.xml +++ b/android/libraries/TweetLanesCore/res/xml/changelog.xml @@ -10,6 +10,7 @@ Fix - Rotate flip on landscape refresh Fix - Prevent infinite refresh loop Fix - Correct issue with conversations appearing under the wrong statuses + Fix - Favorites now correctly get sent to twitter Fix - Various errors reported by fatal crashes From f75a8c2ade3bfd06711066c531ee20640b4a58ab Mon Sep 17 00:00:00 2001 From: Chris Blyth Date: Mon, 3 Mar 2014 13:23:40 +0000 Subject: [PATCH 2/2] Change to 1.4.0 beta 2 --- android/clientbeta/AndroidManifest.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/clientbeta/AndroidManifest.xml b/android/clientbeta/AndroidManifest.xml index 3136cdc2..1c4e73a9 100644 --- a/android/clientbeta/AndroidManifest.xml +++ b/android/clientbeta/AndroidManifest.xml @@ -2,7 +2,7 @@ + android:versionName="1.4.0_b2">