Follow Matrix spec for MatrixClient.getRoomMembers arguments#254
Follow Matrix spec for MatrixClient.getRoomMembers arguments#254B4dM4n wants to merge 1 commit intoturt2live:mainfrom
Conversation
The /rooms/{roomId}/members API only allows to filter for at most one membership
kind and the same goes for not_membership.
This deprecates the function signature with arrays and adds a new
signature with single membership arguments.
Signed-off-by: Fabian Möller <fabianm88@gmail.com>
|
The spec allows the fields to be specified multiple times. If it's not working, it's a server bug. |
|
This is not how I would read the spec. Methods like POST /_matrix/client/v3/join/{roomIdOrAlias} and POST /_matrix/client/v3/knock/{roomIdOrAlias} explicitly specify the So either the spec is to loose in it's definition or the parameters are not repeatable. How do you know that the spec allows it? |
|
The spec was written here, which is suffering from the structure not supporting how to reference the same argument multiple times in a sane way. This was specifying matrix-org/matrix-spec-proposals#1227 which was meant to specify it as multiple. Though, having re-read all this history here I am struggling to see this actually happening. Will investigate further. |
|
I've ended up fixing this a different way which I think will be easier for consumers to use, though is functionally the same idea: #260 Thank you for the PR in any case :) |
The
MatrixClient.getRoomMembersarguments allow to specify multiple membership kind filters, wich are passed to the Matrix server as repeated query arguments to the/rooms/{roomId}/membersAPI.The spec defines the
membershipandnot_membershiparguments as an enum, which can not be repeated.This is also how Synapse implements this API, by only using the first occurrence of each parameter and ignoring the rest:
This PR uses function overloads to deprecate the original function signature and adds a new signature with single membership kind arguments.
Checklist