1
0
mirror of https://github.com/KokaKiwi/BarInsta synced 2024-11-22 22:57:29 +00:00

Revert liked variable to equal only user like

This commit is contained in:
Ammar Githam 2020-08-21 22:45:07 +09:00
parent 8e43519c5b
commit cbf5795a22

View File

@ -3,6 +3,7 @@ package awais.instagrabber.models.direct_messages;
import androidx.annotation.NonNull; import androidx.annotation.NonNull;
import java.io.Serializable; import java.io.Serializable;
import java.util.Arrays;
import java.util.Date; import java.util.Date;
import awais.instagrabber.models.ProfileModel; import awais.instagrabber.models.ProfileModel;
@ -12,6 +13,8 @@ import awais.instagrabber.models.enums.RavenExpiringMediaType;
import awais.instagrabber.models.enums.RavenMediaViewType; import awais.instagrabber.models.enums.RavenMediaViewType;
import awais.instagrabber.utils.Utils; import awais.instagrabber.utils.Utils;
import static awais.instagrabber.utils.Constants.COOKIE;
public final class DirectItemModel implements Serializable, Comparable<DirectItemModel> { public final class DirectItemModel implements Serializable, Comparable<DirectItemModel> {
private final long userId, timestamp; private final long userId, timestamp;
private final DirectItemType itemType; private final DirectItemType itemType;
@ -30,20 +33,19 @@ public final class DirectItemModel implements Serializable, Comparable<DirectIte
private final DirectItemVideoCallEventModel videoCallEventModel; private final DirectItemVideoCallEventModel videoCallEventModel;
private final Date date; private final Date date;
// private final String myId = Utils.getUserIdFromCookie(Utils.settingsHelper.getString(COOKIE));
public DirectItemModel(final long userId, final long timestamp, final String itemId, final String[] likes, public DirectItemModel(final long userId, final long timestamp, final String itemId, final String[] likes,
final DirectItemType itemType, final CharSequence text, final DirectItemLinkModel linkModel, final DirectItemType itemType, final CharSequence text, final DirectItemLinkModel linkModel,
final ProfileModel profileModel, final DirectItemReelShareModel reelShare, final DirectItemMediaModel mediaModel, final ProfileModel profileModel, final DirectItemReelShareModel reelShare, final DirectItemMediaModel mediaModel,
final DirectItemActionLogModel actionLogModel, final DirectItemVoiceMediaModel voiceMediaModel, final DirectItemActionLogModel actionLogModel, final DirectItemVoiceMediaModel voiceMediaModel,
final DirectItemRavenMediaModel ravenMediaModel, final DirectItemVideoCallEventModel videoCallEventModel, final DirectItemRavenMediaModel ravenMediaModel, final DirectItemVideoCallEventModel videoCallEventModel,
final DirectItemAnimatedMediaModel animatedMediaModel) { final DirectItemAnimatedMediaModel animatedMediaModel) {
final String myId = Utils.getUserIdFromCookie(Utils.settingsHelper.getString(COOKIE));
this.userId = userId; this.userId = userId;
this.timestamp = timestamp; this.timestamp = timestamp;
this.itemType = itemType; this.itemType = itemType;
this.itemId = itemId; this.itemId = itemId;
this.likes = likes; this.likes = likes;
this.liked = likes != null && likes.length != 0; this.liked = likes != null && Arrays.asList(likes).contains(myId);
this.text = text; this.text = text;
this.linkModel = linkModel; this.linkModel = linkModel;
this.profileModel = profileModel; this.profileModel = profileModel;