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
fix moderator commands that change affiliation #1413
fix moderator commands that change affiliation #1413
Conversation
1be5087
to
dd166e7
Compare
dd166e7
to
ad94201
Compare
ad94201
to
cdc3b27
Compare
c147378
to
83fbffb
Compare
This will only work if you provide a valid JID instead of just a nickname right? I think you'll need to do some validation that it's really a JID being passed in. |
83fbffb
to
1c9ed79
Compare
@jcbrand Ok. Added the check. |
src/converse-muc-views.js
Outdated
@@ -841,7 +841,8 @@ converse.plugins.add('converse-muc-views', { | |||
); | |||
return false; | |||
} | |||
if (!this.model.occupants.findWhere({'nick': args[0]}) && !this.model.occupants.findWhere({'jid': args[0]})) { | |||
if (!(_.includes(['admin', 'ban', 'owner', 'member', 'revoke'], command) && u.isValidJID(args[0])) && |
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.
Please create a const AFFILIATION_CHANGE_COMANDS
at the top of the file which is set to these commands and then use that here.
Would be nice if you also wrapped the line (below).
And then please rebase again, so that I can merge from github.
Thanks.
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.
@jcbrand Done.
a18db46
to
9b3f36d
Compare
@jcbrand Friendlly reminder: Do you still plan to merge this PR? |
Yes, but I first need to figure out why the tests on Travis are failing. They're all green on my own machine. |
9b3f36d
to
9a0daaf
Compare
Thanks for fixing the tests. This PR now passes the checks on travis. |
I believe it should be possible to change affiliation of non-occupants. Currently converse rejects this. This tries to fix it.