mirror of
https://github.com/signalapp/Signal-Android.git
synced 2026-04-20 16:49:40 +01:00
Add kotlin/proto level message processing.
This commit is contained in:
committed by
Alex Hart
parent
28f27915c5
commit
2e45bd719a
@@ -5,6 +5,7 @@ import org.thoughtcrime.securesms.database.model.Mention
|
||||
import org.thoughtcrime.securesms.database.model.databaseprotos.BodyRangeList
|
||||
import org.thoughtcrime.securesms.recipients.RecipientId
|
||||
import org.whispersystems.signalservice.api.messages.SignalServiceDataMessage
|
||||
import org.whispersystems.signalservice.internal.push.SignalServiceProtos
|
||||
|
||||
class QuoteModel(
|
||||
val id: Long,
|
||||
@@ -47,6 +48,14 @@ class QuoteModel(
|
||||
}
|
||||
return NORMAL
|
||||
}
|
||||
|
||||
fun fromProto(type: SignalServiceProtos.DataMessage.Quote.Type): Type {
|
||||
return if (type == SignalServiceProtos.DataMessage.Quote.Type.GIFT_BADGE) {
|
||||
GIFT_BADGE
|
||||
} else {
|
||||
NORMAL
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user