From 527966d3010b67723412b95d5c67ccdef03b89b1 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Wed, 29 May 2024 04:07:02 +0200 Subject: [PATCH] Fix some hardcoded matrix types --- .../eu/steffo/twom/viewroom/components/ViewRoomForm.kt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/eu/steffo/twom/viewroom/components/ViewRoomForm.kt b/app/src/main/java/eu/steffo/twom/viewroom/components/ViewRoomForm.kt index 8596ad8..90903d4 100644 --- a/app/src/main/java/eu/steffo/twom/viewroom/components/ViewRoomForm.kt +++ b/app/src/main/java/eu/steffo/twom/viewroom/components/ViewRoomForm.kt @@ -19,6 +19,7 @@ import eu.steffo.twom.errorhandling.components.LoadingText import eu.steffo.twom.errorhandling.utils.Display import eu.steffo.twom.errorhandling.utils.LocalizableError import eu.steffo.twom.matrix.complocals.LocalSession +import eu.steffo.twom.matrix.utils.TwoMMatrix import eu.steffo.twom.theme.utils.basePadding import eu.steffo.twom.viewroom.complocals.LocalRoom import eu.steffo.twom.viewroom.effects.observeRSVP @@ -94,15 +95,15 @@ fun ViewRoomForm() { ) try { room.stateService().sendStateEvent( - eventType = "eu.steffo.twom.rsvp", + eventType = TwoMMatrix.RSVP_STATE_TYPE, stateKey = session.myUserId, body = mapOf( - "answer" to answer.value, - "comment" to comment, + TwoMMatrix.RSVP_STATE_ANSWER_FIELD to answer.value, + TwoMMatrix.RSVP_STATE_COMMENT_FIELD to comment, ), ) } catch (e: Throwable) { - Log.e("Room", "Failed to update eu.steffo.twom.rsvp: $publishError") + Log.e("Room", "Failed to update ${TwoMMatrix.RSVP_STATE_TYPE}: $publishError") publishError = LocalizableError(R.string.room_error_publish_generic, e) isPublishRunning = false return@Publish