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

/unban and /kick don't work #341

Closed
Zenexer opened this issue Jan 28, 2017 · 7 comments
Closed

/unban and /kick don't work #341

Zenexer opened this issue Jan 28, 2017 · 7 comments

Comments

@Zenexer
Copy link

Zenexer commented Jan 28, 2017

/unban appears to be the same thing as /leave

Likely cause:

this, roomId, userId, "leave", undefined, callback

@Zenexer
Copy link
Author

Zenexer commented Jan 28, 2017

Looks like /kick has the same bug.

Zenexer added a commit to Zenexer/matrix-js-sdk that referenced this issue Jan 29, 2017
@Zenexer Zenexer changed the title /unban doesn't work /unban and /kick don't work Jan 29, 2017
@Zenexer
Copy link
Author

Zenexer commented Jan 29, 2017

My understanding, after a (very) brief read, is that each user has a state relative to a room. "leave" is the state that results from /unban, /kick, and /part, which I assume means there's another state akin to "banned". There's a leave API call to set this state on a user; if not passed a user ID, it defaults to self. Formerly, this handled all three commands that set the "leave" state, but more recently, they were split into separate API calls. The functions mapped to the slash commands were never updated accordingly.

This would also explain why element-hq/element-web#1961 occurred: at one point in time, /unban and /kick were essentially the same command: leave plus an optional user ID. It's probably worth checking to ensure users can't call leave without a user ID to unban themselves.

@Zenexer
Copy link
Author

Zenexer commented Jan 29, 2017

Moved to matrix-org/synapse#1860

@Zenexer Zenexer closed this as completed Jan 29, 2017
@fred-wang
Copy link
Contributor

@Zenexer So shouldn't we also update

this, roomId, userId, "leave", undefined, callback
to to send "unban" instead of "leave"?

@Zenexer
Copy link
Author

Zenexer commented Feb 14, 2017

@fred-wang I believe so. Also, I think

this, roomId, userId, "leave", reason, callback
should be kick. Both changes worked when I tested them, and are correct according to the current spec.

@Zenexer
Copy link
Author

Zenexer commented Feb 14, 2017

Actually, here are the exact changes that need to be made: https://github.com/matrix-org/matrix-js-sdk/pull/342/files You can reopen that if you want. I forget where I was told it wouldn't be accepted; I think it was in one of the development rooms.

@fred-wang
Copy link
Contributor

I don't think I have the permission to reopen this, maybe we should ask to one matrix dev.

My guess is that it breaks compatibility with server using the old API but at some point it should really be taken.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants