From ffb8101bf1ebc7a5f8ec0b4a365053c7736f3c01 Mon Sep 17 00:00:00 2001 From: Mariotaku Lee Date: Sun, 20 Mar 2016 21:21:46 +0800 Subject: [PATCH 1/2] fixed friendship displaying on fanfou --- .../java/org/mariotaku/twidere/model/ParcelableUser.java | 6 +++++- .../java/org/mariotaku/twidere/fragment/UserFragment.java | 8 ++++++-- .../mariotaku/twidere/model/util/ParcelableUserUtils.java | 1 + 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/twidere.component.common/src/main/java/org/mariotaku/twidere/model/ParcelableUser.java b/twidere.component.common/src/main/java/org/mariotaku/twidere/model/ParcelableUser.java index 1374a9147..4dcb2fb9f 100644 --- a/twidere.component.common/src/main/java/org/mariotaku/twidere/model/ParcelableUser.java +++ b/twidere.component.common/src/main/java/org/mariotaku/twidere/model/ParcelableUser.java @@ -31,9 +31,9 @@ import com.hannesdorfmann.parcelableplease.annotation.ParcelableThisPlease; import org.mariotaku.library.objectcursor.annotation.AfterCursorObjectCreated; import org.mariotaku.library.objectcursor.annotation.CursorField; import org.mariotaku.library.objectcursor.annotation.CursorObject; +import org.mariotaku.twidere.model.util.LoganSquareCursorFieldConverter; import org.mariotaku.twidere.model.util.UserKeyConverter; import org.mariotaku.twidere.model.util.UserKeyCursorFieldConverter; -import org.mariotaku.twidere.model.util.LoganSquareCursorFieldConverter; import org.mariotaku.twidere.provider.TwidereDataStore.CachedUsers; @@ -318,6 +318,10 @@ public class ParcelableUser implements Parcelable, Comparable { @JsonField(name = "groups_count") @ParcelableThisPlease public long groups_count = -1; + @JsonField(name = "unique_id") + @ParcelableThisPlease + public String unique_id; + @Override public int describeContents() { diff --git a/twidere/src/main/java/org/mariotaku/twidere/fragment/UserFragment.java b/twidere/src/main/java/org/mariotaku/twidere/fragment/UserFragment.java index 55b84a8c2..3b32720aa 100644 --- a/twidere/src/main/java/org/mariotaku/twidere/fragment/UserFragment.java +++ b/twidere/src/main/java/org/mariotaku/twidere/fragment/UserFragment.java @@ -1863,8 +1863,12 @@ public class UserFragment extends BaseSupportFragment implements OnClickListener } public boolean check(@NonNull ParcelableUser user) { - return TextUtils.equals(relationship.getSourceUserId(), user.account_key.getId()) - && user.key.check(relationship.getTargetUserId(), null); + if (!TextUtils.equals(relationship.getSourceUserId(), user.account_key.getId())) { + return false; + } + final String targetUserId = relationship.getTargetUserId(); + return (user.extras != null && TextUtils.equals(targetUserId, user.extras.unique_id)) + || TextUtils.equals(targetUserId, user.key.getId()); } } diff --git a/twidere/src/main/java/org/mariotaku/twidere/model/util/ParcelableUserUtils.java b/twidere/src/main/java/org/mariotaku/twidere/model/util/ParcelableUserUtils.java index 2ee200d84..82cc97b3b 100644 --- a/twidere/src/main/java/org/mariotaku/twidere/model/util/ParcelableUserUtils.java +++ b/twidere/src/main/java/org/mariotaku/twidere/model/util/ParcelableUserUtils.java @@ -76,6 +76,7 @@ public class ParcelableUserUtils implements TwidereConstants { extras.profile_image_url_profile_size = user.getProfileImageUrlLarge(); } extras.groups_count = user.getGroupsCount(); + extras.unique_id = user.getUniqueId(); obj.extras = extras; return obj; } From ee10a5953c7469c2586474adf9a4f7d571149f8b Mon Sep 17 00:00:00 2001 From: Mariotaku Lee Date: Sun, 20 Mar 2016 21:22:08 +0800 Subject: [PATCH 2/2] updated version --- twidere/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/twidere/build.gradle b/twidere/build.gradle index 88c5023e1..27fb67a3d 100644 --- a/twidere/build.gradle +++ b/twidere/build.gradle @@ -21,8 +21,8 @@ android { applicationId "org.mariotaku.twidere" minSdkVersion 14 targetSdkVersion 23 - versionCode 160 - versionName "3.1.0.3" + versionCode 161 + versionName "3.1.0.4" multiDexEnabled true generatedDensities = []