Copying received and read dates in Message#toCommonMessage()
This commit is contained in:
parent
1279a8cd4e
commit
ea6d76757e
@ -79,13 +79,21 @@ public class Message {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return a database {@link Message} converted into an
|
* Converts this message into an instance of {@link envoy.data.Message}.
|
||||||
* {@link envoy.data.Message}
|
*
|
||||||
|
* @return a {@link envoy.data.Message} containing the same values as this
|
||||||
|
* message
|
||||||
* @since Envoy Server Standalone v0.1-alpha
|
* @since Envoy Server Standalone v0.1-alpha
|
||||||
*/
|
*/
|
||||||
public envoy.data.Message toCommonMessage() {
|
public envoy.data.Message toCommonMessage() {
|
||||||
// TODO: Attachment, dates
|
// TODO: Attachment
|
||||||
return new MessageBuilder(sender.getId(), recipient.getId(), id).setText(text).setDate(creationDate).setStatus(status).build();
|
envoy.data.Message message = new MessageBuilder(sender.getId(), recipient.getId(), id).setText(text)
|
||||||
|
.setDate(creationDate)
|
||||||
|
.setStatus(status)
|
||||||
|
.build();
|
||||||
|
message.setReceivedDate(receivedDate);
|
||||||
|
message.setReadDate(readDate);
|
||||||
|
return message;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user