-
Notifications
You must be signed in to change notification settings - Fork 428
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
Allow JIDs from all MUC light domains in HTTP room API #1622
base: master
Are you sure you want to change the base?
Conversation
f771724
to
7b0267d
Compare
src/mongoose_client_api_rooms.erl
Outdated
|
||
-spec validate_room_host(binary()) -> ok | error. | ||
validate_room_host(RoomHost) -> | ||
MucLightDomains = ejabberd_router:dirty_get_routes_to_module(mod_muc_light), |
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.
Feels a bit hackish. Instead of adding this API, can we reuse mongoose_subhosts:get_host/1
?
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.
Still, we're not sure if that subhost is a MUC light domain. IMO router is a more appropriate place to look for that information, because it is exactly the place where that information is registered (I mean the host <-> module mapping).
src/mongoose_client_api_rooms.erl
Outdated
-spec validate_room_host(binary()) -> ok | error. | ||
validate_room_host(RoomHost) -> | ||
MucLightDomains = ejabberd_router:dirty_get_routes_to_module(mod_muc_light), | ||
case lists:member(RoomHost, MucLightDomains) of |
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.
this would not work well in case of a lot of domains.
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 agree, I need to come up with better solution.
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.
Can we have a test for this one?
Log message: Lager fatally failed to install handler lager_console_backend into lager_event, NOT retrying: {bad_console_config, info}
Fix broken lager_console_backend backend
@arcusfelis @fenek in hope to address concerns of both of you, I propose to replace |
@arkgil dirty_check_route_exists/2 makes sense. |
OK, sounds good. :) Also I think that |
7b0267d
to
1d40acd
Compare
@fenek @arcusfelis I've added negative test cases and one test to ensure that rooms can be actually created at different domain. However I noticed that if we'd like to fully support running multiple MUC light services on a single host, couple of changes would need to be made, e.g.:
|
This PR allows passing room JID from all configured MUC light domains in HTTP room API routes. Previously the JID needed to be in a "primary" MUC light domain on host (started via
mod_muc_light:start/2
). If only username part of JID is given, still "primary" domain is assumed.