-
-
Notifications
You must be signed in to change notification settings - Fork 122
Describe behaviour when the topic key is falsey in a m.room.topic event.
#2068
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…vent. We seem to have [updated this for m.room.name](matrix-org#1639) some years back but omitted it for topic.
topic key is falsey in a m.room.topic e…topic key is falsey in a m.room.topic event.
topic key is falsey in a m.room.topic event.topic key is falsey in a m.room.topic event.
| The room topic can also be set when creating a room using `/createRoom` with the `topic` key.' | ||
| If a room has an `m.room.topic` event with an absent, null, or empty `topic` | ||
| field, it should be treated the same as a room with no `m.room.topic` event. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While it's a great clarification in itself, it would be even greater to further clarify what happens when an event with an absent/null/empty topic comes upon a previous event with non-falsey topic. I guess the room topic should be reset to the as-if-no-topic state?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, I suppose I thought that was the implication as with the m.room.name description => clients should use the latest state to render the room, and this description tells clients to assume the topic isn't set.
I'm struggling to find words that doesn't sound a bit repetitive?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"In other words, an empty topic property effectively resets the room to having no topic."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prefer the word "property" to "field", "member", or various other alternatives
| field, it should be treated the same as a room with no `m.room.topic` event. | |
| property, it should be treated the same as a room with no `m.room.topic` event. | |
| In other words, sending an `m.room.topic` event with an empty `topic` effectively | |
| resets the room to having no topic. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better?
| The room topic can also be set when creating a room using `/createRoom` with the `topic` key.' | ||
| If a room has an `m.room.topic` event with an absent, null, or empty `topic` | ||
| field, it should be treated the same as a room with no `m.room.topic` event. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"In other words, an empty topic property effectively resets the room to having no topic."
| The room topic can also be set when creating a room using `/createRoom` with the `topic` key.' | ||
| If a room has an `m.room.topic` event with an absent, null, or empty `topic` | ||
| field, it should be treated the same as a room with no `m.room.topic` event. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
prefer the word "property" to "field", "member", or various other alternatives
| field, it should be treated the same as a room with no `m.room.topic` event. | |
| property, it should be treated the same as a room with no `m.room.topic` event. | |
| In other words, sending an `m.room.topic` event with an empty `topic` effectively | |
| resets the room to having no topic. |
richvdh
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
… event. (matrix-org#2068) We seem to have [updated this for m.room.name](matrix-org#1639) some years back but omitted it for topic.
| If the `topic` property is absent, null, or empty then the topic is unset. In other words, | ||
| an empty `topic` property effectively resets the room to having no topic. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm slightly confused about the absent / null part of this. topic is labeled as required. So I think it could at most be an empty string?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could have been redacted. Or received over federation from a server that doesn't enforce the presence of the "required" properties.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh right. I hadn't thought about redactions.
We seem to have updated this for m.room.name some years back but omitted it for topic.
Signed-off-by: Half-Shot [email protected]
Pull Request Checklist
Preview: https://pr2068--matrix-spec-previews.netlify.app