mirror of
https://github.com/oxen-io/session-android.git
synced 2025-04-21 01:51:30 +00:00
clean
This commit is contained in:
parent
133706e1d6
commit
2ff23e9e41
@ -33,7 +33,7 @@ class DatabaseAttachmentDTO {
|
|||||||
val isUploaded: Boolean = false
|
val isUploaded: Boolean = false
|
||||||
|
|
||||||
fun toProto(): SignalServiceProtos.AttachmentPointer? {
|
fun toProto(): SignalServiceProtos.AttachmentPointer? {
|
||||||
val builder = org.session.libsignal.service.internal.push.SignalServiceProtos.AttachmentPointer.newBuilder()
|
val builder = SignalServiceProtos.AttachmentPointer.newBuilder()
|
||||||
builder.contentType = this.contentType
|
builder.contentType = this.contentType
|
||||||
|
|
||||||
if (!this.fileName.isNullOrEmpty()) {
|
if (!this.fileName.isNullOrEmpty()) {
|
||||||
@ -46,12 +46,12 @@ class DatabaseAttachmentDTO {
|
|||||||
builder.size = this.size
|
builder.size = this.size
|
||||||
builder.key = this.key
|
builder.key = this.key
|
||||||
builder.digest = this.digest
|
builder.digest = this.digest
|
||||||
builder.flags = if (this.isVoiceNote) org.session.libsignal.service.internal.push.SignalServiceProtos.AttachmentPointer.Flags.VOICE_MESSAGE.number else 0
|
builder.flags = if (this.isVoiceNote) SignalServiceProtos.AttachmentPointer.Flags.VOICE_MESSAGE.number else 0
|
||||||
|
|
||||||
//TODO I did copy the behavior of iOS below, not sure if that's relevant here...
|
//TODO I did copy the behavior of iOS below, not sure if that's relevant here...
|
||||||
if (this.shouldHaveImageSize) {
|
if (this.shouldHaveImageSize) {
|
||||||
if (this.width < kotlin.Int.MAX_VALUE && this.height < kotlin.Int.MAX_VALUE) {
|
if (this.width < Int.MAX_VALUE && this.height < Int.MAX_VALUE) {
|
||||||
val imageSize: Size = Size(this.width, this.height)
|
val imageSize= Size(this.width, this.height)
|
||||||
val imageWidth = round(imageSize.width.toDouble())
|
val imageWidth = round(imageSize.width.toDouble())
|
||||||
val imageHeight = round(imageSize.height.toDouble())
|
val imageHeight = round(imageSize.height.toDouble())
|
||||||
if (imageWidth > 0 && imageHeight > 0) {
|
if (imageWidth > 0 && imageHeight > 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user