|
@@ -22,21 +22,36 @@ package com.nextcloud.talk.models.json.participants;
|
|
|
|
|
|
import com.bluelinelabs.logansquare.annotation.JsonField;
|
|
|
import com.bluelinelabs.logansquare.annotation.JsonObject;
|
|
|
+import com.nextcloud.talk.models.json.converters.EnumActorTypeConverter;
|
|
|
import com.nextcloud.talk.models.json.converters.EnumParticipantTypeConverter;
|
|
|
+import com.nextcloud.talk.models.json.converters.EnumSystemMessageTypeConverter;
|
|
|
import com.nextcloud.talk.models.json.converters.ObjectParcelConverter;
|
|
|
|
|
|
import org.parceler.Parcel;
|
|
|
import org.parceler.ParcelPropertyConverter;
|
|
|
|
|
|
+import java.util.Arrays;
|
|
|
+
|
|
|
@Parcel
|
|
|
@JsonObject
|
|
|
public class Participant {
|
|
|
+ @JsonField(name = "attendeeId")
|
|
|
+ public Long attendeeId;
|
|
|
+
|
|
|
+ @JsonField(name = "actorType", typeConverter = EnumActorTypeConverter.class)
|
|
|
+ public ActorType actorType;
|
|
|
+
|
|
|
+ @JsonField(name = "actorId")
|
|
|
+ public String actorId;
|
|
|
+
|
|
|
+ @Deprecated
|
|
|
@JsonField(name = "userId")
|
|
|
public String userId;
|
|
|
|
|
|
@JsonField(name = {"type", "participantType"}, typeConverter = EnumParticipantTypeConverter.class)
|
|
|
public ParticipantType type;
|
|
|
|
|
|
+ @Deprecated
|
|
|
@JsonField(name = "name")
|
|
|
public String name;
|
|
|
|
|
@@ -46,15 +61,21 @@ public class Participant {
|
|
|
@JsonField(name = "lastPing")
|
|
|
public long lastPing;
|
|
|
|
|
|
+ @Deprecated
|
|
|
@JsonField(name = "sessionId")
|
|
|
public String sessionId;
|
|
|
|
|
|
+ @JsonField(name = "sessionIds")
|
|
|
+ public String[] sessionIds;
|
|
|
+
|
|
|
+ @Deprecated
|
|
|
@JsonField(name = "roomId")
|
|
|
public long roomId;
|
|
|
|
|
|
@ParcelPropertyConverter(ObjectParcelConverter.class)
|
|
|
@JsonField(name = "inCall")
|
|
|
public Object inCall;
|
|
|
+
|
|
|
public String source;
|
|
|
|
|
|
public boolean selected;
|
|
@@ -76,7 +97,30 @@ public class Participant {
|
|
|
return participantFlags;
|
|
|
}
|
|
|
|
|
|
+ public Long getAttendeeId() {
|
|
|
+ return attendeeId;
|
|
|
+ }
|
|
|
+
|
|
|
+ public ActorType getActorType() {
|
|
|
+ if (this.userId != null) {
|
|
|
+ return ActorType.USERS;
|
|
|
+ }
|
|
|
+ return actorType;
|
|
|
+ }
|
|
|
+
|
|
|
+ public String getActorId() {
|
|
|
+ if (this.userId != null) {
|
|
|
+ return this.userId;
|
|
|
+ }
|
|
|
+ return actorId;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ @Deprecated
|
|
|
public String getUserId() {
|
|
|
+ if (this.actorType != null && this.actorType == ActorType.USERS) {
|
|
|
+ return this.actorId;
|
|
|
+ }
|
|
|
return this.userId;
|
|
|
}
|
|
|
|
|
@@ -84,6 +128,7 @@ public class Participant {
|
|
|
return this.type;
|
|
|
}
|
|
|
|
|
|
+ @Deprecated
|
|
|
public String getName() {
|
|
|
return this.name;
|
|
|
}
|
|
@@ -96,10 +141,16 @@ public class Participant {
|
|
|
return this.lastPing;
|
|
|
}
|
|
|
|
|
|
+ @Deprecated
|
|
|
public String getSessionId() {
|
|
|
return this.sessionId;
|
|
|
}
|
|
|
|
|
|
+ public String[] getSessionIds() {
|
|
|
+ return sessionIds;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Deprecated
|
|
|
public long getRoomId() {
|
|
|
return this.roomId;
|
|
|
}
|
|
@@ -116,14 +167,28 @@ public class Participant {
|
|
|
return this.selected;
|
|
|
}
|
|
|
|
|
|
+ @Deprecated
|
|
|
public void setUserId(String userId) {
|
|
|
this.userId = userId;
|
|
|
}
|
|
|
|
|
|
+ public void setAttendeeId(Long attendeeId) {
|
|
|
+ this.attendeeId = attendeeId;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setActorType(ActorType actorType) {
|
|
|
+ this.actorType = actorType;
|
|
|
+ }
|
|
|
+
|
|
|
+ public void setActorId(String actorId) {
|
|
|
+ this.actorId = actorId;
|
|
|
+ }
|
|
|
+
|
|
|
public void setType(ParticipantType type) {
|
|
|
this.type = type;
|
|
|
}
|
|
|
|
|
|
+ @Deprecated
|
|
|
public void setName(String name) {
|
|
|
this.name = name;
|
|
|
}
|
|
@@ -136,10 +201,12 @@ public class Participant {
|
|
|
this.lastPing = lastPing;
|
|
|
}
|
|
|
|
|
|
+ @Deprecated
|
|
|
public void setSessionId(String sessionId) {
|
|
|
this.sessionId = sessionId;
|
|
|
}
|
|
|
|
|
|
+ @Deprecated
|
|
|
public void setRoomId(long roomId) {
|
|
|
this.roomId = roomId;
|
|
|
}
|
|
@@ -156,93 +223,113 @@ public class Participant {
|
|
|
this.selected = selected;
|
|
|
}
|
|
|
|
|
|
- public boolean equals(final Object o) {
|
|
|
- if (o == this) {
|
|
|
+ public void setSessionIds(String[] sessionIds) {
|
|
|
+ this.sessionIds = sessionIds;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public boolean equals(Object o) {
|
|
|
+ if (this == o) {
|
|
|
return true;
|
|
|
}
|
|
|
- if (!(o instanceof Participant)) {
|
|
|
+ if (o == null || getClass() != o.getClass()) {
|
|
|
return false;
|
|
|
}
|
|
|
- final Participant other = (Participant) o;
|
|
|
- if (!other.canEqual((Object) this)) {
|
|
|
+
|
|
|
+ Participant that = (Participant) o;
|
|
|
+
|
|
|
+ if (lastPing != that.lastPing) {
|
|
|
return false;
|
|
|
}
|
|
|
- final Object this$userId = this.getUserId();
|
|
|
- final Object other$userId = other.getUserId();
|
|
|
- if (this$userId == null ? other$userId != null : !this$userId.equals(other$userId)) {
|
|
|
+ if (roomId != that.roomId) {
|
|
|
return false;
|
|
|
}
|
|
|
- final Object this$type = this.getType();
|
|
|
- final Object other$type = other.getType();
|
|
|
- if (this$type == null ? other$type != null : !this$type.equals(other$type)) {
|
|
|
+ if (selected != that.selected) {
|
|
|
return false;
|
|
|
}
|
|
|
- final Object this$name = this.getName();
|
|
|
- final Object other$name = other.getName();
|
|
|
- if (this$name == null ? other$name != null : !this$name.equals(other$name)) {
|
|
|
+ if (!attendeeId.equals(that.attendeeId)) {
|
|
|
return false;
|
|
|
}
|
|
|
- final Object this$displayName = this.getDisplayName();
|
|
|
- final Object other$displayName = other.getDisplayName();
|
|
|
- if (this$displayName == null ? other$displayName != null : !this$displayName.equals(other$displayName)) {
|
|
|
+ if (!actorType.equals(that.actorType)) {
|
|
|
return false;
|
|
|
}
|
|
|
- if (this.getLastPing() != other.getLastPing()) {
|
|
|
+ if (!actorId.equals(that.actorId)) {
|
|
|
return false;
|
|
|
}
|
|
|
- final Object this$sessionId = this.getSessionId();
|
|
|
- final Object other$sessionId = other.getSessionId();
|
|
|
- if (this$sessionId == null ? other$sessionId != null : !this$sessionId.equals(other$sessionId)) {
|
|
|
+ if (!userId.equals(that.userId)) {
|
|
|
return false;
|
|
|
}
|
|
|
- if (this.getRoomId() != other.getRoomId()) {
|
|
|
+ if (type != that.type) {
|
|
|
return false;
|
|
|
}
|
|
|
- final Object this$inCall = this.getInCall();
|
|
|
- final Object other$inCall = other.getInCall();
|
|
|
- if (this$inCall == null ? other$inCall != null : !this$inCall.equals(other$inCall)) {
|
|
|
+ if (!name.equals(that.name)) {
|
|
|
return false;
|
|
|
}
|
|
|
- final Object this$source = this.getSource();
|
|
|
- final Object other$source = other.getSource();
|
|
|
- if (this$source == null ? other$source != null : !this$source.equals(other$source)) {
|
|
|
+ if (displayName != null ? !displayName.equals(that.displayName) : that.displayName != null) {
|
|
|
return false;
|
|
|
}
|
|
|
-
|
|
|
- return this.isSelected() == other.isSelected();
|
|
|
+ if (!sessionId.equals(that.sessionId)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ // Probably incorrect - comparing Object[] arrays with Arrays.equals
|
|
|
+ if (!Arrays.equals(sessionIds, that.sessionIds)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ if (inCall != null ? !inCall.equals(that.inCall) : that.inCall != null) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ return source != null ? source.equals(that.source) : that.source == null;
|
|
|
}
|
|
|
|
|
|
protected boolean canEqual(final Object other) {
|
|
|
return other instanceof Participant;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
public int hashCode() {
|
|
|
- final int PRIME = 59;
|
|
|
- int result = 1;
|
|
|
- final Object $userId = this.getUserId();
|
|
|
- result = result * PRIME + ($userId == null ? 43 : $userId.hashCode());
|
|
|
- final Object $type = this.getType();
|
|
|
- result = result * PRIME + ($type == null ? 43 : $type.hashCode());
|
|
|
- final Object $name = this.getName();
|
|
|
- result = result * PRIME + ($name == null ? 43 : $name.hashCode());
|
|
|
- final Object $displayName = this.getDisplayName();
|
|
|
- result = result * PRIME + ($displayName == null ? 43 : $displayName.hashCode());
|
|
|
- final long $lastPing = this.getLastPing();
|
|
|
- result = result * PRIME + (int) ($lastPing >>> 32 ^ $lastPing);
|
|
|
- final Object $sessionId = this.getSessionId();
|
|
|
- result = result * PRIME + ($sessionId == null ? 43 : $sessionId.hashCode());
|
|
|
- final long $roomId = this.getRoomId();
|
|
|
- result = result * PRIME + (int) ($roomId >>> 32 ^ $roomId);
|
|
|
- final Object $inCall = this.getInCall();
|
|
|
- result = result * PRIME + ($inCall == null ? 43 : $inCall.hashCode());
|
|
|
- final Object $source = this.getSource();
|
|
|
- result = result * PRIME + ($source == null ? 43 : $source.hashCode());
|
|
|
- result = result * PRIME + (this.isSelected() ? 79 : 97);
|
|
|
+ int result = attendeeId.hashCode();
|
|
|
+ result = 31 * result + actorType.hashCode();
|
|
|
+ result = 31 * result + actorId.hashCode();
|
|
|
+ result = 31 * result + (userId != null ? userId.hashCode() : 0);
|
|
|
+ result = 31 * result + (type != null ? type.hashCode() : 0);
|
|
|
+ result = 31 * result + (name != null ? name.hashCode() : 0);
|
|
|
+ result = 31 * result + (displayName != null ? displayName.hashCode() : 0);
|
|
|
+ result = 31 * result + (int) (lastPing ^ (lastPing >>> 32));
|
|
|
+ result = 31 * result + (sessionId != null ? sessionId.hashCode() : 0);
|
|
|
+ result = 31 * result + Arrays.hashCode(sessionIds);
|
|
|
+ result = 31 * result + (int) (roomId ^ (roomId >>> 32));
|
|
|
+ result = 31 * result + (inCall != null ? inCall.hashCode() : 0);
|
|
|
+ result = 31 * result + (source != null ? source.hashCode() : 0);
|
|
|
+ result = 31 * result + (selected ? 1 : 0);
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
public String toString() {
|
|
|
- return "Participant(userId=" + this.getUserId() + ", type=" + this.getType() + ", name=" + this.getName() + ", displayName=" + this.getDisplayName() + ", lastPing=" + this.getLastPing() + ", sessionId=" + this.getSessionId() + ", roomId=" + this.getRoomId() + ", inCall=" + this.getInCall() + ", source=" + this.getSource() + ", selected=" + this.isSelected() + ")";
|
|
|
+ return "Participant{" +
|
|
|
+ "attendeeId=" + attendeeId +
|
|
|
+ ", actorType='" + actorType + '\'' +
|
|
|
+ ", actorId='" + actorId + '\'' +
|
|
|
+ ", userId='" + userId + '\'' +
|
|
|
+ ", type=" + type +
|
|
|
+ ", name='" + name + '\'' +
|
|
|
+ ", displayName='" + displayName + '\'' +
|
|
|
+ ", lastPing=" + lastPing +
|
|
|
+ ", sessionId='" + sessionId + '\'' +
|
|
|
+ ", sessionIds=" + Arrays.toString(sessionIds) +
|
|
|
+ ", roomId=" + roomId +
|
|
|
+ ", inCall=" + inCall +
|
|
|
+ ", source='" + source + '\'' +
|
|
|
+ ", selected=" + selected +
|
|
|
+ '}';
|
|
|
+ }
|
|
|
+
|
|
|
+ public enum ActorType {
|
|
|
+ DUMMY,
|
|
|
+ EMAILS,
|
|
|
+ GROUPS,
|
|
|
+ GUESTS,
|
|
|
+ USERS,
|
|
|
}
|
|
|
|
|
|
public enum ParticipantType {
|