Add a SendKnock method and RespSendKnock struct#329
Conversation
If you just plan to hold JSON and not do anything with it then yes, but if you want to turn them into actual |
I believe that's what I want then, but let me know if that's not what you expect. |
| // A RespSendKnock is the content of a response to PUT /_matrix/federation/v2/send_knock/{roomID}/{eventID} | ||
| type RespSendKnock struct { | ||
| // A list of stripped state events to help the initiator of the knock identify the room. | ||
| KnockRoomState EventJSONs `json:"knock_room_state"` |
There was a problem hiding this comment.
Thinking some more about this, the fields from the spec are content, state_key, sender and type which is the exact same shape as the InviteV2StrippedState type. If you want to be able to access those fields without having to run through the JSON unmarshaller in your tests, then it might be a better idea to define this as:
KnockRoomState []InviteV2StrippedState `json:"knock_room_state"`
I also need these for writing a Complement test.
Q: is
EventJSONsthe right type to use forknock_room_state?The spec describes it as
[StrippedState].EventJSONsseems to be an alias for an array ofRawJSON, so sounds like it should be compatible at the very least.