mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-25 02:55:23 +00:00
Remove erroneous expiration on SharedConfigurationMessage
This commit is contained in:
parent
a1fadcfa91
commit
f5121770ec
@ -1,7 +1,6 @@
|
|||||||
package org.session.libsession.messaging.messages.control
|
package org.session.libsession.messaging.messages.control
|
||||||
|
|
||||||
import com.google.protobuf.ByteString
|
import com.google.protobuf.ByteString
|
||||||
import org.session.libsession.messaging.messages.copyExpiration
|
|
||||||
import org.session.libsignal.protos.SignalServiceProtos
|
import org.session.libsignal.protos.SignalServiceProtos
|
||||||
import org.session.libsignal.protos.SignalServiceProtos.SharedConfigMessage
|
import org.session.libsignal.protos.SignalServiceProtos.SharedConfigMessage
|
||||||
|
|
||||||
@ -11,13 +10,10 @@ class SharedConfigurationMessage(val kind: SharedConfigMessage.Kind, val data: B
|
|||||||
override val isSelfSendValid: Boolean = true
|
override val isSelfSendValid: Boolean = true
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun fromProto(proto: SignalServiceProtos.Content): SharedConfigurationMessage? {
|
fun fromProto(proto: SignalServiceProtos.Content): SharedConfigurationMessage? =
|
||||||
if (!proto.hasSharedConfigMessage()) return null
|
proto.takeIf { it.hasSharedConfigMessage() }?.sharedConfigMessage
|
||||||
val sharedConfig = proto.sharedConfigMessage
|
?.takeIf { it.hasKind() && it.hasData() }
|
||||||
if (!sharedConfig.hasKind() || !sharedConfig.hasData()) return null
|
?.run { SharedConfigurationMessage(kind, data.toByteArray(), seqno) }
|
||||||
return SharedConfigurationMessage(sharedConfig.kind, sharedConfig.data.toByteArray(), sharedConfig.seqno)
|
|
||||||
.copyExpiration(proto)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun isValid(): Boolean {
|
override fun isValid(): Boolean {
|
||||||
|
Loading…
Reference in New Issue
Block a user