diff --git a/libsession/src/main/java/org/session/libsession/snode/OnionRequestEncryption.kt b/libsession/src/main/java/org/session/libsession/snode/OnionRequestEncryption.kt index c462e8f94f..d4f19a678b 100644 --- a/libsession/src/main/java/org/session/libsession/snode/OnionRequestEncryption.kt +++ b/libsession/src/main/java/org/session/libsession/snode/OnionRequestEncryption.kt @@ -71,11 +71,11 @@ object OnionRequestEncryption { } is OnionRequestAPI.Destination.Server -> { payload = mutableMapOf( - "host" to rhs.host, - "target" to rhs.target, - "method" to "POST", - "protocol" to rhs.scheme, - "port" to rhs.port + "host" to rhs.host, + "target" to rhs.target, + "method" to "POST", + "protocol" to rhs.scheme, + "port" to rhs.port ) } } diff --git a/libsession/src/main/java/org/session/libsession/snode/SnodeMessage.kt b/libsession/src/main/java/org/session/libsession/snode/SnodeMessage.kt index aa7fd4f6bb..b508cf0ef9 100644 --- a/libsession/src/main/java/org/session/libsession/snode/SnodeMessage.kt +++ b/libsession/src/main/java/org/session/libsession/snode/SnodeMessage.kt @@ -3,23 +3,33 @@ package org.session.libsession.snode import org.session.libsignal.service.loki.utilities.removing05PrefixIfNeeded data class SnodeMessage( - // The hex encoded public key of the recipient. + /** + * The hex encoded public key of the recipient. + */ val recipient: String, - // The content of the message. + /** + * The content of the message. + */ val data: String, - // The time to live for the message in milliseconds. + /** + * The time to live for the message in milliseconds. + */ val ttl: Long, - // When the proof of work was calculated. + /** + * When the proof of work was calculated. + * + * **Note:** Expressed as milliseconds since 00:00:00 UTC on 1 January 1970. + */ val timestamp: Long ) { internal fun toJSON(): Map { return mapOf( "pubKey" to if (SnodeAPI.useTestnet) recipient.removing05PrefixIfNeeded() else recipient, - "data" to data, - "ttl" to ttl.toString(), - "timestamp" to timestamp.toString(), - "nonce" to "" + "data" to data, + "ttl" to ttl.toString(), + "timestamp" to timestamp.toString(), + "nonce" to "" ) } }