Skip to content

Commit

Permalink
Include device source and destination
Browse files Browse the repository at this point in the history
  • Loading branch information
moxie0 committed Feb 2, 2014
1 parent 8e763f6 commit a088913
Show file tree
Hide file tree
Showing 4 changed files with 248 additions and 602 deletions.
3 changes: 2 additions & 1 deletion protobuf/OutgoingMessageSignal.proto
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ option java_outer_classname = "MessageProtos";
message OutgoingMessageSignal {
optional uint32 type = 1;
optional string source = 2;
optional uint32 sourceDevice = 7;
optional string relay = 3;
repeated string destinations = 4;
// repeated string destinations = 4;
optional uint64 timestamp = 5;
optional bytes message = 6;
}
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ private void sendLocalMessage(Account source,

messageBuilder.setType(incomingMessage.getType())
.setSource(source.getNumber())
.setTimestamp(System.currentTimeMillis());
.setTimestamp(System.currentTimeMillis())
.setSourceDevice((int)source.getAuthenticatedDevice().get().getId());

if (messageBody.isPresent()) {
messageBuilder.setMessage(ByteString.copyFrom(messageBody.get()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ public class IncomingMessage {
@NotEmpty
private String destination;

@JsonProperty
private long destinationDeviceId = 1;

@JsonProperty
@NotEmpty
private String body;
Expand All @@ -38,9 +41,6 @@ public class IncomingMessage {
@JsonProperty
private long timestamp;

@JsonProperty
private long destinationDeviceId = 1;

public String getDestination() {
return destination;
}
Expand Down
Loading

0 comments on commit a088913

Please sign in to comment.