Skip to content
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

Added wrapper with pagination support for room hierarchy endpoint #100

Merged
merged 2 commits into from
Nov 5, 2022

Conversation

mgcm
Copy link
Contributor

@mgcm mgcm commented Oct 31, 2022

This addresses issue #91

Copy link

@jacks0n9 jacks0n9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a nice pr I sure hope tulir will add it...

// when it encounters another space as a child it recurses into that space before returning non-space children.
//
// NOTE: Only the roomID is required, the rest of the fields are optional and ignored if left to default values.
func (cli *Client) Hierarchy(roomID id.RoomID, from string, max_depth int, suggested_only bool, limit int) (resp *RespHierarchy, err error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Go variables should be camelCase.

Suggested change
func (cli *Client) Hierarchy(roomID id.RoomID, from string, max_depth int, suggested_only bool, limit int) (resp *RespHierarchy, err error) {
func (cli *Client) Hierarchy(roomID id.RoomID, from string, maxDepth int, suggestedOnly bool, limit int) (resp *RespHierarchy, err error) {


type StrippedChildStateEvent struct {
Content json.RawMessage `json:"content"`
OriginServerTs int64 `json:"origin_server_ts"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally this has been aliased to Timestamp elsewhere in mautrix-go.

Suggested change
OriginServerTs int64 `json:"origin_server_ts"`
Timestamp int64 `json:"origin_server_ts"`

OriginServerTs int64 `json:"origin_server_ts"`
Sender id.UserID `json:"sender"`
StateKey string `json:"state_key"`
Type string `json:"type"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this needs to be

Suggested change
Type string `json:"type"`
Type event.Type `json:"type"`

but I am not quite sure.

@tulir tulir merged commit b77c964 into mautrix:master Nov 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants