Skip to content

Commit 3c39e60

Browse files
committed
Make the user to pass imageType and imageId
1 parent 3284d80 commit 3c39e60

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

  • library/src/main/java/com/proxerme/library/connection/messenger/entity

library/src/main/java/com/proxerme/library/connection/messenger/entity/Conference.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public Conference[] newArray(int size) {
3939
@Body(name = "count")
4040
private int participantAmount;
4141
@Body(name = "image")
42-
private String imageId;
42+
private String image;
4343
@Body(name = "group")
4444
private boolean isGroup;
4545
@Body(name = "read")
@@ -55,15 +55,15 @@ public Conference[] newArray(int size) {
5555
}
5656

5757
public Conference(@NonNull String id, @NonNull String topic, @NonNull String customTopic,
58-
@IntRange(from = 2) int participantAmount, @NonNull String imageId,
59-
boolean isGroup, boolean isRead, long time,
58+
@IntRange(from = 2) int participantAmount, @NonNull String imageType,
59+
@NonNull String imageId, boolean isGroup, boolean isRead, long time,
6060
@IntRange(from = 0) int unreadMessageAmount,
6161
@NonNull String lastReadMessageId) {
6262
this.id = id;
6363
this.topic = topic;
6464
this.customTopic = customTopic;
6565
this.participantAmount = participantAmount;
66-
this.imageId = imageId;
66+
this.image = imageType + ":" + imageId;
6767
this.isGroup = isGroup;
6868
this.isRead = isRead;
6969
this.time = time;
@@ -73,7 +73,7 @@ public Conference(@NonNull String id, @NonNull String topic, @NonNull String cus
7373

7474
protected Conference(Parcel in) {
7575
this.lastReadMessageId = in.readString();
76-
this.imageId = in.readString();
76+
this.image = in.readString();
7777
this.isRead = in.readByte() != 0;
7878
this.customTopic = in.readString();
7979
this.participantAmount = in.readInt();
@@ -91,7 +91,7 @@ public String getLastReadMessageId() {
9191

9292
@NonNull
9393
public String getImageType() {
94-
String[] split = imageId.split(":");
94+
String[] split = image.split(":");
9595

9696
if (split.length == 2) {
9797
return split[0];
@@ -103,7 +103,7 @@ public String getImageType() {
103103
@Override
104104
@NonNull
105105
public String getImageId() {
106-
String[] split = imageId.split(":");
106+
String[] split = image.split(":");
107107

108108
if (split.length == 2) {
109109
return split[1];
@@ -164,7 +164,7 @@ public boolean equals(Object o) {
164164
if (isGroup != that.isGroup) return false;
165165
if (unreadMessageAmount != that.unreadMessageAmount) return false;
166166
if (!lastReadMessageId.equals(that.lastReadMessageId)) return false;
167-
if (!imageId.equals(that.imageId)) return false;
167+
if (!image.equals(that.image)) return false;
168168
if (!customTopic.equals(that.customTopic)) return false;
169169
if (!topic.equals(that.topic)) return false;
170170
return id.equals(that.id);
@@ -174,7 +174,7 @@ public boolean equals(Object o) {
174174
@Override
175175
public int hashCode() {
176176
int result = lastReadMessageId.hashCode();
177-
result = 31 * result + imageId.hashCode();
177+
result = 31 * result + image.hashCode();
178178
result = 31 * result + (isRead ? 1 : 0);
179179
result = 31 * result + customTopic.hashCode();
180180
result = 31 * result + participantAmount;
@@ -194,7 +194,7 @@ public int describeContents() {
194194
@Override
195195
public void writeToParcel(Parcel dest, int flags) {
196196
dest.writeString(this.lastReadMessageId);
197-
dest.writeString(this.imageId);
197+
dest.writeString(this.image);
198198
dest.writeByte(this.isRead ? (byte) 1 : (byte) 0);
199199
dest.writeString(this.customTopic);
200200
dest.writeInt(this.participantAmount);

0 commit comments

Comments
 (0)