From 8d1ccf533de92fba10bbbda8ea8bebede0828ff3 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Wed, 29 May 2024 02:46:58 +0200 Subject: [PATCH] Change Matrix types to use the subdomain `meta.steffo.eu` --- CONTRIBUTING.md | 19 +++++++++++++++++++ .../eu/steffo/twom/matrix/utils/TwoMMatrix.kt | 8 ++++---- 2 files changed, 23 insertions(+), 4 deletions(-) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..ca6734f --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,19 @@ +# Random information that may be useful to contributors + +## Custom Matrix types + +- `eu.steffo.meta.twom.party`: room type used to distinguish TwoM parties from regular rooms, which are hidden. +- `eu.steffo.meta.twom.rsvp`: state event type used for the user's response to a party invitation; uses the replying user's mxid as state key, and has an object with the following keys as payload: + - `eu.steffo.meta.twom.answer`: a string containing one of these values, indicating the user's presence at the party: + - `"SURE"` + - `"LATER"` + - `"MAYBE"` + - `"NOWAY"` + - `""` + - `eu.steffo.meta.twom.comment`: a string containing an user's freeform comment provided in addition to the answer. + +## Known issues + +- Avatar URLs are sometimes fetched before they're available on the homeserver, causing them not to be loaded correctly on party creation. +- Due to API limitations, the app does not check if the user has permissions to perform certain actions, such as changing the name of a party, and instead returns a `MatrixError` when the action is attempted. +- Due to Matrix protocol limitations, any user can change other users' party replies by sending custom state events, even though this app itself does not allow it. diff --git a/app/src/main/java/eu/steffo/twom/matrix/utils/TwoMMatrix.kt b/app/src/main/java/eu/steffo/twom/matrix/utils/TwoMMatrix.kt index 59fae2a..a3cda84 100644 --- a/app/src/main/java/eu/steffo/twom/matrix/utils/TwoMMatrix.kt +++ b/app/src/main/java/eu/steffo/twom/matrix/utils/TwoMMatrix.kt @@ -78,11 +78,11 @@ object TwoMMatrix { session.close() } - const val ROOM_TYPE = "eu.steffo.twom.happening" + const val ROOM_TYPE = "eu.steffo.meta.twom.party" - const val RSVP_STATE_TYPE = "eu.steffo.twom.rsvp" + const val RSVP_STATE_TYPE = "eu.steffo.meta.twom.rsvp" - const val RSVP_STATE_ANSWER_FIELD = "answer" + const val RSVP_STATE_ANSWER_FIELD = "eu.steffo.meta.twom.answer" - const val RSVP_STATE_COMMENT_FIELD = "comment" + const val RSVP_STATE_COMMENT_FIELD = "eu.steffo.meta.twom.comment" } \ No newline at end of file