diff --git a/twidere/src/main/java/org/mariotaku/twidere/util/AsyncTwitterWrapper.java b/twidere/src/main/java/org/mariotaku/twidere/util/AsyncTwitterWrapper.java index 758a7cdda..0d1666fb7 100644 --- a/twidere/src/main/java/org/mariotaku/twidere/util/AsyncTwitterWrapper.java +++ b/twidere/src/main/java/org/mariotaku/twidere/util/AsyncTwitterWrapper.java @@ -729,6 +729,8 @@ public class AsyncTwitterWrapper extends TwitterWrapper { mAccountKey, false); } } + ParcelableStatusUtils.updateExtraInformation(result, credentials, + mUserColorNameManager); Utils.setLastSeen(mContext, result.mentions, System.currentTimeMillis()); final ContentValues values = new ContentValues(); values.put(Statuses.IS_FAVORITE, true); @@ -1334,13 +1336,19 @@ public class AsyncTwitterWrapper extends TwitterWrapper { @Override protected SingleResponse doInBackground(final Object... params) { - final Twitter twitter = TwitterAPIFactory.getTwitterInstance(mContext, mAccountKey, false); + final ParcelableCredentials credentials = ParcelableCredentialsUtils.getCredentials(mContext, + mAccountKey); + if (credentials == null) return SingleResponse.getInstance(); + final Twitter twitter = TwitterAPIFactory.getTwitterInstance(mContext, credentials, true, + true); if (twitter == null) return SingleResponse.getInstance(); ParcelableStatus status = null; TwitterException exception = null; try { status = ParcelableStatusUtils.fromStatus(twitter.destroyStatus(mStatusId), mAccountKey, false); + ParcelableStatusUtils.updateExtraInformation(status, credentials, + mUserColorNameManager); } catch (final TwitterException e) { exception = e; } @@ -1550,13 +1558,18 @@ public class AsyncTwitterWrapper extends TwitterWrapper { @Override protected SingleResponse doInBackground(final Object... params) { - final Twitter twitter = TwitterAPIFactory.getTwitterInstance(mContext, mAccountKey, true); + final ParcelableCredentials credentials = ParcelableCredentialsUtils.getCredentials(mContext, + mAccountKey); + if (credentials == null) return SingleResponse.getInstance(); + final Twitter twitter = TwitterAPIFactory.getTwitterInstance(mContext, credentials, true, true); if (twitter == null) { return SingleResponse.getInstance(); } try { final ParcelableStatus result = ParcelableStatusUtils.fromStatus(twitter.retweetStatus(mStatusId), mAccountKey, false); + ParcelableStatusUtils.updateExtraInformation(result, credentials, + mUserColorNameManager); Utils.setLastSeen(mContext, result.mentions, System.currentTimeMillis()); final ContentValues values = new ContentValues(); values.put(Statuses.MY_RETWEET_ID, result.id); @@ -1571,7 +1584,6 @@ public class AsyncTwitterWrapper extends TwitterWrapper { for (final Uri uri : TwidereDataStore.STATUSES_URIS) { mResolver.update(uri, values, where.getSQL(), whereArgs); } - DataStoreUtils.updateActivityStatus(mResolver, mAccountKey, mStatusId, new DataStoreUtils.UpdateActivityAction() { @Override public void process(ParcelableActivity activity) { diff --git a/twidere/src/main/java/org/mariotaku/twidere/util/IntentUtils.java b/twidere/src/main/java/org/mariotaku/twidere/util/IntentUtils.java index 79d6d654f..58f9f2d0c 100644 --- a/twidere/src/main/java/org/mariotaku/twidere/util/IntentUtils.java +++ b/twidere/src/main/java/org/mariotaku/twidere/util/IntentUtils.java @@ -215,7 +215,7 @@ public class IntentUtils implements Constants { intent.setData(testBuilder.build()); final ComponentName componentName = intent.resolveActivity(context.getPackageManager()); - if (componentName == null) return null; + if (componentName == null || componentName.getClassName() == null) return null; return componentName.getPackageName(); }