Include device source and destination
This commit is contained in:
parent
8e763f62f5
commit
a0889130e5
|
@ -22,8 +22,9 @@ option java_outer_classname = "MessageProtos";
|
||||||
message OutgoingMessageSignal {
|
message OutgoingMessageSignal {
|
||||||
optional uint32 type = 1;
|
optional uint32 type = 1;
|
||||||
optional string source = 2;
|
optional string source = 2;
|
||||||
|
optional uint32 sourceDevice = 7;
|
||||||
optional string relay = 3;
|
optional string relay = 3;
|
||||||
repeated string destinations = 4;
|
// repeated string destinations = 4;
|
||||||
optional uint64 timestamp = 5;
|
optional uint64 timestamp = 5;
|
||||||
optional bytes message = 6;
|
optional bytes message = 6;
|
||||||
}
|
}
|
|
@ -150,7 +150,8 @@ public class MessageController {
|
||||||
|
|
||||||
messageBuilder.setType(incomingMessage.getType())
|
messageBuilder.setType(incomingMessage.getType())
|
||||||
.setSource(source.getNumber())
|
.setSource(source.getNumber())
|
||||||
.setTimestamp(System.currentTimeMillis());
|
.setTimestamp(System.currentTimeMillis())
|
||||||
|
.setSourceDevice((int)source.getAuthenticatedDevice().get().getId());
|
||||||
|
|
||||||
if (messageBody.isPresent()) {
|
if (messageBody.isPresent()) {
|
||||||
messageBuilder.setMessage(ByteString.copyFrom(messageBody.get()));
|
messageBuilder.setMessage(ByteString.copyFrom(messageBody.get()));
|
||||||
|
|
|
@ -28,6 +28,9 @@ public class IncomingMessage {
|
||||||
@NotEmpty
|
@NotEmpty
|
||||||
private String destination;
|
private String destination;
|
||||||
|
|
||||||
|
@JsonProperty
|
||||||
|
private long destinationDeviceId = 1;
|
||||||
|
|
||||||
@JsonProperty
|
@JsonProperty
|
||||||
@NotEmpty
|
@NotEmpty
|
||||||
private String body;
|
private String body;
|
||||||
|
@ -38,9 +41,6 @@ public class IncomingMessage {
|
||||||
@JsonProperty
|
@JsonProperty
|
||||||
private long timestamp;
|
private long timestamp;
|
||||||
|
|
||||||
@JsonProperty
|
|
||||||
private long destinationDeviceId = 1;
|
|
||||||
|
|
||||||
public String getDestination() {
|
public String getDestination() {
|
||||||
return destination;
|
return destination;
|
||||||
}
|
}
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue