mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-22 01:15:54 +03:00
stable name for withheld
This commit is contained in:
parent
6b0f8318b7
commit
7a3f2bb240
6 changed files with 7 additions and 6 deletions
1
changelog.d/5115.bugfix
Normal file
1
changelog.d/5115.bugfix
Normal file
|
@ -0,0 +1 @@
|
|||
Stop using unstable names for withheld codes
|
|
@ -87,7 +87,7 @@ object EventType {
|
|||
// Key share events
|
||||
const val ROOM_KEY_REQUEST = "m.room_key_request"
|
||||
const val FORWARDED_ROOM_KEY = "m.forwarded_room_key"
|
||||
const val ROOM_KEY_WITHHELD = "org.matrix.room_key.withheld"
|
||||
val ROOM_KEY_WITHHELD = listOf("m.room_key.withheld", "org.matrix.room_key.withheld")
|
||||
|
||||
const val REQUEST_SECRET = "m.secret.request"
|
||||
const val SEND_SECRET = "m.secret.send"
|
||||
|
|
|
@ -820,7 +820,7 @@ internal class DefaultCryptoService @Inject constructor(
|
|||
EventType.SEND_SECRET -> {
|
||||
onSecretSendReceived(event)
|
||||
}
|
||||
EventType.ROOM_KEY_WITHHELD -> {
|
||||
in EventType.ROOM_KEY_WITHHELD -> {
|
||||
onKeyWithHeldReceived(event)
|
||||
}
|
||||
else -> {
|
||||
|
@ -869,7 +869,7 @@ internal class DefaultCryptoService @Inject constructor(
|
|||
senderKey = withHeldContent.senderKey,
|
||||
fromDevice = withHeldContent.fromDevice,
|
||||
event = Event(
|
||||
type = EventType.ROOM_KEY_WITHHELD,
|
||||
type = EventType.ROOM_KEY_WITHHELD.first(),
|
||||
senderId = senderId,
|
||||
content = event.getClearContent()
|
||||
)
|
||||
|
|
|
@ -315,7 +315,7 @@ internal class IncomingKeyRequestManager @Inject constructor(
|
|||
)
|
||||
|
||||
val params = SendToDeviceTask.Params(
|
||||
EventType.ROOM_KEY_WITHHELD,
|
||||
EventType.ROOM_KEY_WITHHELD.first(),
|
||||
MXUsersDevicesMap<Any>().apply {
|
||||
setObject(request.requestingUserId, request.requestingDeviceId, withHeldContent)
|
||||
}
|
||||
|
|
|
@ -365,7 +365,7 @@ internal class MXMegolmEncryption(
|
|||
fromDevice = myDeviceId
|
||||
)
|
||||
val params = SendToDeviceTask.Params(
|
||||
EventType.ROOM_KEY_WITHHELD,
|
||||
EventType.ROOM_KEY_WITHHELD.first(),
|
||||
MXUsersDevicesMap<Any>().apply {
|
||||
targets.forEach {
|
||||
setObject(it.userId, it.deviceId, withHeldContent)
|
||||
|
|
|
@ -117,7 +117,7 @@ internal open class OutgoingKeyRequestEntity(
|
|||
|
||||
private fun eventToResult(event: Event): RequestResult? {
|
||||
return when (event.getClearType()) {
|
||||
EventType.ROOM_KEY_WITHHELD -> {
|
||||
in EventType.ROOM_KEY_WITHHELD -> {
|
||||
event.content.toModel<RoomKeyWithHeldContent>()?.code?.let {
|
||||
RequestResult.Failure(it)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue