improved retweet/fav count update

This commit is contained in:
Mariotaku Lee 2016-04-03 13:26:29 +08:00
parent 139daf4ffc
commit 3064ec6e8b
3 changed files with 21 additions and 15 deletions

View File

@ -324,11 +324,13 @@ public abstract class CursorActivitiesFragment extends AbsActivitiesFragment {
for (ParcelableStatus[] statusesArray : statusesMatrix) {
if (statusesArray == null) continue;
for (ParcelableStatus status : statusesArray) {
if (!result.id.equals(status.id)) continue;
status.is_favorite = result.is_favorite;
status.reply_count = result.reply_count;
status.retweet_count = result.retweet_count;
status.favorite_count = result.favorite_count;
if (result.id.equals(status.id) || result.id.equals(status.retweet_id)
|| result.id.equals(status.my_retweet_id)) {
status.is_favorite = result.is_favorite;
status.reply_count = result.reply_count;
status.retweet_count = result.retweet_count;
status.favorite_count = result.favorite_count;
}
}
}
}

View File

@ -1580,11 +1580,13 @@ public class AsyncTwitterWrapper extends TwitterWrapper {
for (ParcelableStatus[] statusesArray : statusesMatrix) {
if (statusesArray == null) continue;
for (ParcelableStatus status : statusesArray) {
if (!result.id.equals(status.id)) continue;
status.my_retweet_id = result.id;
status.reply_count = result.reply_count;
status.retweet_count = result.retweet_count;
status.favorite_count = result.favorite_count;
if (mStatusId.equals(status.id) || mStatusId.equals(status.retweet_id)
|| mStatusId.equals(status.my_retweet_id)) {
status.my_retweet_id = result.id;
status.reply_count = result.reply_count;
status.retweet_count = result.retweet_count;
status.favorite_count = result.favorite_count;
}
}
}
}

View File

@ -992,11 +992,13 @@ public class DataStoreUtils implements Constants {
for (ParcelableStatus[] statusesArray : statusesMatrix) {
if (statusesArray == null) continue;
for (ParcelableStatus status : statusesArray) {
if (!statusId.equals(status.id)) continue;
status.my_retweet_id = null;
status.reply_count = result.reply_count;
status.retweet_count = result.retweet_count - 1;
status.favorite_count = result.favorite_count;
if (statusId.equals(status.id) || statusId.equals(status.retweet_id)
|| statusId.equals(status.my_retweet_id)) {
status.my_retweet_id = null;
status.reply_count = result.reply_count;
status.retweet_count = result.retweet_count - 1;
status.favorite_count = result.favorite_count;
}
}
}
}