mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-20 01:28:03 +01:00
Drop the legacy message and relay fields from message entities
This commit is contained in:
committed by
Jon Chambers
parent
06a57ef811
commit
53f17c2baa
@@ -21,15 +21,9 @@ public class IncomingMessage {
|
||||
@JsonProperty
|
||||
private final int destinationRegistrationId;
|
||||
|
||||
@JsonProperty
|
||||
private final String body;
|
||||
|
||||
@JsonProperty
|
||||
private final String content;
|
||||
|
||||
@JsonProperty
|
||||
private final String relay;
|
||||
|
||||
@JsonProperty
|
||||
private long timestamp; // deprecated
|
||||
|
||||
@@ -39,34 +33,22 @@ public class IncomingMessage {
|
||||
@JsonProperty("destination") final String destination,
|
||||
@JsonProperty("destinationDeviceId") final long destinationDeviceId,
|
||||
@JsonProperty("destinationRegistrationId") final int destinationRegistrationId,
|
||||
@JsonProperty("body") final String body,
|
||||
@JsonProperty("content") final String content,
|
||||
@JsonProperty("relay") final String relay) {
|
||||
@JsonProperty("content") final String content) {
|
||||
this.type = type;
|
||||
this.destination = destination;
|
||||
this.destinationDeviceId = destinationDeviceId;
|
||||
this.destinationRegistrationId = destinationRegistrationId;
|
||||
this.body = body;
|
||||
this.content = content;
|
||||
this.relay = relay;
|
||||
}
|
||||
|
||||
public String getDestination() {
|
||||
return destination;
|
||||
}
|
||||
|
||||
public String getBody() {
|
||||
return body;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public String getRelay() {
|
||||
return relay;
|
||||
}
|
||||
|
||||
public long getDestinationDeviceId() {
|
||||
return destinationDeviceId;
|
||||
}
|
||||
|
||||
@@ -15,38 +15,32 @@ public class OutgoingMessageEntity {
|
||||
|
||||
private final UUID guid;
|
||||
private final int type;
|
||||
private final String relay;
|
||||
private final long timestamp;
|
||||
private final String source;
|
||||
private final UUID sourceUuid;
|
||||
private final int sourceDevice;
|
||||
private final UUID destinationUuid;
|
||||
private final byte[] message;
|
||||
private final byte[] content;
|
||||
private final long serverTimestamp;
|
||||
|
||||
@JsonCreator
|
||||
public OutgoingMessageEntity(@JsonProperty("guid") final UUID guid,
|
||||
@JsonProperty("type") final int type,
|
||||
@JsonProperty("relay") final String relay,
|
||||
@JsonProperty("timestamp") final long timestamp,
|
||||
@JsonProperty("source") final String source,
|
||||
@JsonProperty("sourceUuid") final UUID sourceUuid,
|
||||
@JsonProperty("sourceDevice") final int sourceDevice,
|
||||
@JsonProperty("destinationUuid") final UUID destinationUuid,
|
||||
@JsonProperty("message") final byte[] message,
|
||||
@JsonProperty("content") final byte[] content,
|
||||
@JsonProperty("serverTimestamp") final long serverTimestamp)
|
||||
{
|
||||
this.guid = guid;
|
||||
this.type = type;
|
||||
this.relay = relay;
|
||||
this.timestamp = timestamp;
|
||||
this.source = source;
|
||||
this.sourceUuid = sourceUuid;
|
||||
this.sourceDevice = sourceDevice;
|
||||
this.destinationUuid = destinationUuid;
|
||||
this.message = message;
|
||||
this.content = content;
|
||||
this.serverTimestamp = serverTimestamp;
|
||||
}
|
||||
@@ -59,10 +53,6 @@ public class OutgoingMessageEntity {
|
||||
return type;
|
||||
}
|
||||
|
||||
public String getRelay() {
|
||||
return relay;
|
||||
}
|
||||
|
||||
public long getTimestamp() {
|
||||
return timestamp;
|
||||
}
|
||||
@@ -83,10 +73,6 @@ public class OutgoingMessageEntity {
|
||||
return destinationUuid;
|
||||
}
|
||||
|
||||
public byte[] getMessage() {
|
||||
return message;
|
||||
}
|
||||
|
||||
public byte[] getContent() {
|
||||
return content;
|
||||
}
|
||||
@@ -105,18 +91,15 @@ public class OutgoingMessageEntity {
|
||||
sourceDevice == that.sourceDevice &&
|
||||
serverTimestamp == that.serverTimestamp &&
|
||||
guid.equals(that.guid) &&
|
||||
Objects.equals(relay, that.relay) &&
|
||||
Objects.equals(source, that.source) &&
|
||||
Objects.equals(sourceUuid, that.sourceUuid) &&
|
||||
destinationUuid.equals(that.destinationUuid) &&
|
||||
Arrays.equals(message, that.message) &&
|
||||
Arrays.equals(content, that.content);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = Objects.hash(guid, type, relay, timestamp, source, sourceUuid, sourceDevice, destinationUuid, serverTimestamp);
|
||||
result = 31 * result + Arrays.hashCode(message);
|
||||
int result = Objects.hash(guid, type, timestamp, source, sourceUuid, sourceDevice, destinationUuid, serverTimestamp);
|
||||
result = 31 * result + Arrays.hashCode(content);
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user