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; }