mirror of
https://github.com/oxen-io/session-android.git
synced 2025-01-11 23:23:39 +00:00
add sync target to visible message
This commit is contained in:
parent
e8d007dce4
commit
c2836cc654
@ -10,6 +10,7 @@ import org.session.libsignal.service.internal.push.SignalServiceProtos
|
|||||||
|
|
||||||
class VisibleMessage : Message() {
|
class VisibleMessage : Message() {
|
||||||
|
|
||||||
|
var syncTarget: String? = null
|
||||||
var text: String? = null
|
var text: String? = null
|
||||||
var attachmentIDs = ArrayList<Long>()
|
var attachmentIDs = ArrayList<Long>()
|
||||||
var quote: Quote? = null
|
var quote: Quote? = null
|
||||||
@ -17,12 +18,15 @@ class VisibleMessage : Message() {
|
|||||||
var contact: Contact? = null
|
var contact: Contact? = null
|
||||||
var profile: Profile? = null
|
var profile: Profile? = null
|
||||||
|
|
||||||
|
override val isSelfSendValid: Boolean = true
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
const val TAG = "VisibleMessage"
|
const val TAG = "VisibleMessage"
|
||||||
|
|
||||||
fun fromProto(proto: SignalServiceProtos.Content): VisibleMessage? {
|
fun fromProto(proto: SignalServiceProtos.Content): VisibleMessage? {
|
||||||
val dataMessage = proto.dataMessage ?: return null
|
val dataMessage = proto.dataMessage ?: return null
|
||||||
val result = VisibleMessage()
|
val result = VisibleMessage()
|
||||||
|
result.syncTarget = dataMessage.syncTarget
|
||||||
result.text = dataMessage.body
|
result.text = dataMessage.body
|
||||||
// Attachments are handled in MessageReceiver
|
// Attachments are handled in MessageReceiver
|
||||||
val quoteProto = dataMessage.quote
|
val quoteProto = dataMessage.quote
|
||||||
@ -103,6 +107,10 @@ class VisibleMessage : Message() {
|
|||||||
}
|
}
|
||||||
val attachmentProtos = attachments.mapNotNull { it.toProto() }
|
val attachmentProtos = attachments.mapNotNull { it.toProto() }
|
||||||
dataMessage.addAllAttachments(attachmentProtos)
|
dataMessage.addAllAttachments(attachmentProtos)
|
||||||
|
// Sync target
|
||||||
|
if (syncTarget != null) {
|
||||||
|
dataMessage.syncTarget = syncTarget
|
||||||
|
}
|
||||||
// TODO Contact
|
// TODO Contact
|
||||||
// Build
|
// Build
|
||||||
try {
|
try {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user