Skip to content

Commit

Permalink
added creator field to the roomReducer
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasHalwax committed Oct 8, 2023
1 parent 4c62acc commit 22029eb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@syncpoint/matrix-client-api",
"version": "1.6.0",
"version": "1.6.1",
"description": "A minimal client API for [matrix]",
"main": "index.mjs",
"scripts": {
Expand Down
3 changes: 2 additions & 1 deletion src/convenience.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,11 @@ const roomStateReducer = (acc, event) => {
case 'm.room.create': {
acc.type = (event.content?.type) ? event.content.type : 'm.room'
acc.id = event.content['io.syncpoint.odin.id']
acc.creator = event.content.creator
break
}
case 'm.room.name': { acc.name = event.content.name; break }
case 'm.room.canonical_alias': { acc.canonical_alias = event.content.alias; break }
case 'm.room.canonical_alias': { acc.alias = event.content.canonical_alias; break }
case 'm.room.topic': { acc.topic = event.content.topic; break }
case 'm.room.member': { if (acc.members) { acc.members.push(event.state_key) } else { acc['members'] = [event.state_key] }; break }
case 'm.space.child': { if (acc.children) { acc.children.push(event.state_key) } else { acc['children'] = [event.state_key] }; break }
Expand Down

0 comments on commit 22029eb

Please sign in to comment.