-
Notifications
You must be signed in to change notification settings - Fork 426
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
GraphQL - Implement more commands for MUC #3627
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
Codecov Report
@@ Coverage Diff @@
## feature/graphql #3627 +/- ##
===================================================
+ Coverage 81.64% 81.74% +0.09%
===================================================
Files 478 478
Lines 33126 33248 +122
===================================================
+ Hits 27047 27177 +130
+ Misses 6079 6071 -8
Continue to review full report at Codecov.
|
d95e0c9
to
f5727d4
Compare
This comment was marked as outdated.
This comment was marked as outdated.
f5727d4
to
3c2357d
Compare
This comment was marked as outdated.
This comment was marked as outdated.
small_tests_24 / small_tests / 8427ad6 small_tests_23 / small_tests / 8427ad6 dynamic_domains_mysql_redis_24 / mysql_redis / 8427ad6 dynamic_domains_pgsql_mnesia_23 / pgsql_mnesia / 8427ad6 dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 8427ad6 dynamic_domains_mssql_mnesia_24 / odbc_mssql_mnesia / 8427ad6 ldap_mnesia_24 / ldap_mnesia / 8427ad6 ldap_mnesia_23 / ldap_mnesia / 8427ad6 internal_mnesia_24 / internal_mnesia / 8427ad6 pgsql_mnesia_24 / pgsql_mnesia / 8427ad6 pgsql_mnesia_23 / pgsql_mnesia / 8427ad6 mysql_redis_24 / mysql_redis / 8427ad6 mssql_mnesia_24 / odbc_mssql_mnesia / 8427ad6 riak_mnesia_24 / riak_mnesia / 8427ad6 |
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.
It looks good in general, I added a few comments.
- Add a function to list room affiliation in order to return it from the GraphQL API. - Add a sync normal_state handler that allows seting the user role or affiliance and receiving the result.
c856e06
to
8ccabcd
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Bugs: - The user role was not verified, so each user has moderator privileges. - Moderator not in the room error was not caught
5e93558
to
4141d2a
Compare
This comment was marked as outdated.
This comment was marked as outdated.
4141d2a
to
105162b
Compare
This comment was marked as outdated.
This comment was marked as outdated.
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.
Looks good 👍
admin_try_invite_user_to_nonexistent_room, | ||
admin_kick_user, | ||
admin_try_kick_user_from_nonexistent_room, | ||
admin_try_kick_user_in_room_without_moderators, |
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.
admin_try_kick_user_in_room_without_moderators, | |
admin_try_kick_user_from_room_without_moderators, |
priv/graphql/schemas/user/muc.gql
Outdated
@@ -24,8 +34,10 @@ type MUCUserQuery @protected{ | |||
listRooms(mucDomain: String!, limit: Int, index: Int): MUCRoomsPayload! | |||
"Get configuration of the MUC room" | |||
getRoomConfig(room: JID!): MUCRoomConfig | |||
"Get user list of a given MUC room" | |||
"Get users list of a given MUC room" |
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.
I think it should be "user list". Alternatively, "the list of users".
small_tests_24 / small_tests / 0d0e86d small_tests_23 / small_tests / 0d0e86d dynamic_domains_pgsql_mnesia_23 / pgsql_mnesia / 0d0e86d dynamic_domains_pgsql_mnesia_24 / pgsql_mnesia / 0d0e86d dynamic_domains_mysql_redis_24 / mysql_redis / 0d0e86d ldap_mnesia_23 / ldap_mnesia / 0d0e86d ldap_mnesia_24 / ldap_mnesia / 0d0e86d dynamic_domains_mssql_mnesia_24 / odbc_mssql_mnesia / 0d0e86d internal_mnesia_24 / internal_mnesia / 0d0e86d pgsql_mnesia_23 / pgsql_mnesia / 0d0e86d elasticsearch_and_cassandra_24 / elasticsearch_and_cassandra_mnesia / 0d0e86d mysql_redis_24 / mysql_redis / 0d0e86d pgsql_mnesia_24 / pgsql_mnesia / 0d0e86d mssql_mnesia_24 / odbc_mssql_mnesia / 0d0e86d riak_mnesia_24 / riak_mnesia / 0d0e86d |
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.
Looks good :)
This PR refers to MIM-1629 and extends the GraphQL MUC category about new commands.
Extended commands
Command
inviteUser
When the room is password secured, then this command attaches the password to the invitation.
The new commands
Command
setAffiliation
Command
setRole
Command
listUserAffiliations
Allows listing all users with given affiliation or list all room affiliations.
Commands
enterRoom
andexitRoom
Allows entering/exiting room per user session with the given nickname.
It is possible to enter the password-secured room.
Command
sendPrivateMesssage
The user can send a private message to the other room occupant. The message is sent to the given nickname.
Small GraphQL Bug
When working on this PR I found a bug in graphql_erlang causing a crash when the user passes the wrong type value, and that value is present in more than one enum. The PR with a fix Premwoik/graphql-erlang#1