mirror of
https://github.com/oxen-io/session-android.git
synced 2024-12-24 16:57:50 +00:00
few little fixes
This commit is contained in:
parent
c0e7f05d91
commit
e378d11692
@ -38,7 +38,7 @@ class ClosedGroupControlMessage() : ControlMessage() {
|
||||
object MemberLeft : Kind()
|
||||
object EncryptionKeyPairRequest: Kind()
|
||||
|
||||
val description: String = run {
|
||||
val description: String =
|
||||
when(this) {
|
||||
is New -> "new"
|
||||
is Update -> "update"
|
||||
@ -49,7 +49,6 @@ class ClosedGroupControlMessage() : ControlMessage() {
|
||||
MemberLeft -> "memberLeft"
|
||||
EncryptionKeyPairRequest -> "encryptionKeyPairRequest"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
|
@ -14,12 +14,11 @@ class DataExtractionNotification(): ControlMessage() {
|
||||
class Screenshot() : Kind()
|
||||
class MediaSaved(val timestanp: Long) : Kind()
|
||||
|
||||
val description: String = run {
|
||||
val description: String =
|
||||
when(this) {
|
||||
is Screenshot -> "screenshot"
|
||||
is MediaSaved -> "mediaSaved"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
companion object {
|
||||
@ -27,12 +26,11 @@ class DataExtractionNotification(): ControlMessage() {
|
||||
|
||||
fun fromProto(proto: SignalServiceProtos.Content): DataExtractionNotification? {
|
||||
val dataExtractionNotification = proto.dataExtractionNotification ?: return null
|
||||
val kind: Kind
|
||||
when(dataExtractionNotification.type) {
|
||||
SignalServiceProtos.DataExtractionNotification.Type.SCREENSHOT -> kind = Kind.Screenshot()
|
||||
val kind: Kind = when(dataExtractionNotification.type) {
|
||||
SignalServiceProtos.DataExtractionNotification.Type.SCREENSHOT -> Kind.Screenshot()
|
||||
SignalServiceProtos.DataExtractionNotification.Type.MEDIA_SAVED -> {
|
||||
val timestamp = if (dataExtractionNotification.hasTimestamp()) dataExtractionNotification.timestamp else 0
|
||||
kind = Kind.MediaSaved(timestamp)
|
||||
val timestamp = if (dataExtractionNotification.hasTimestamp()) dataExtractionNotification.timestamp else return null
|
||||
Kind.MediaSaved(timestamp)
|
||||
}
|
||||
}
|
||||
return DataExtractionNotification(kind)
|
||||
|
@ -35,7 +35,7 @@ class ReadReceipt() : ControlMessage() {
|
||||
override fun toProto(): SignalServiceProtos.Content? {
|
||||
val timestamps = timestamps
|
||||
if (timestamps == null) {
|
||||
Log.w(ExpirationTimerUpdate.TAG, "Couldn't construct read receipt proto from: $this")
|
||||
Log.w(TAG, "Couldn't construct read receipt proto from: $this")
|
||||
return null
|
||||
}
|
||||
val receiptProto = SignalServiceProtos.ReceiptMessage.newBuilder()
|
||||
@ -46,7 +46,7 @@ class ReadReceipt() : ControlMessage() {
|
||||
contentProto.receiptMessage = receiptProto.build()
|
||||
return contentProto.build()
|
||||
} catch (e: Exception) {
|
||||
Log.w(ExpirationTimerUpdate.TAG, "Couldn't construct read receipt proto from: $this")
|
||||
Log.w(TAG, "Couldn't construct read receipt proto from: $this")
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user