Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.

[federation] Add make_leave & send_leave #535

Merged
merged 7 commits into from
Jul 11, 2018

Conversation

APwhitehat
Copy link
Contributor

@APwhitehat APwhitehat commented Jul 3, 2018

Mostly the same as make_join & send_join.

// MakeLeave implements the /make_leave API
func MakeLeave(
ctx context.Context,
httpReq *http.Request,
Copy link
Member

Choose a reason for hiding this comment

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

Surely you can just pass httpReq and then take the Context from that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, didn't notice this redundancy.

I wonder if we can change LogThenError to take just the httpReq.Context() instead of the whole request.

Copy link
Contributor

Choose a reason for hiding this comment

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

IIRC this split was made by intention...

// SendLeave implements the /send_leave API
func SendLeave(
ctx context.Context,
httpReq *http.Request,
Copy link
Member

Choose a reason for hiding this comment

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

Same here.

Copy link
Member

@erikjohnston erikjohnston left a comment

Choose a reason for hiding this comment

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

We probably also want to double check that the membership is set to leave, otherwise LGTM

Signed-off-by: Anant Prakash <anantprakashjsr@gmail.com>
Signed-off-by: Anant Prakash <anantprakashjsr@gmail.com>
@erikjohnston
Copy link
Member

Oh, oops, you misunderstood what I meant, sorry. I meant that when we check that the various fields, like that event.EventID() == eventID, we should also check that event.content["membership"] is equal to leave

This reverts commit 227d53d.

Revert "Add internal API QueryMembershipForUser"

This reverts commit 1241cf6.
@erikjohnston
Copy link
Member

Thanks! :D

@APwhitehat APwhitehat removed their assignment Jul 11, 2018
@APwhitehat APwhitehat merged commit 74b319c into matrix-org:master Jul 11, 2018
@APwhitehat APwhitehat deleted the fed_leave branch July 11, 2018 10:07
anoadragon453 pushed a commit that referenced this pull request Jul 16, 2018
* [federation] Add make_leave & send_leave

* Remove redundant parameters

* Check membership is set to leave

Signed-off-by: Anant Prakash <anantprakashjsr@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants