-
Notifications
You must be signed in to change notification settings - Fork 53
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
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. |
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.
Overall looks OK!
federationtypes.go
Outdated
// 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
EventJSONs
the right type to use forknock_room_state
?The spec describes it as
[StrippedState]
.EventJSONs
seems to be an alias for an array ofRawJSON
, so sounds like it should be compatible at the very least.