mirror of
https://github.com/processone/ejabberd.git
synced 2024-09-25 14:24:55 +02:00
Don't require a full JID as argument, instead set a dummy resource (#2710)
This commit is contained in:
parent
f2bd2f6e37
commit
446ff9257c
@ -263,9 +263,9 @@ get_commands_spec() ->
|
|||||||
#ejabberd_commands{name = subscribe_room, tags = [muc_room],
|
#ejabberd_commands{name = subscribe_room, tags = [muc_room],
|
||||||
desc = "Subscribe to a MUC conference",
|
desc = "Subscribe to a MUC conference",
|
||||||
module = ?MODULE, function = subscribe_room,
|
module = ?MODULE, function = subscribe_room,
|
||||||
args_desc = ["Full JID, including some resource", "a user's nick",
|
args_desc = ["User JID", "a user's nick",
|
||||||
"the room to subscribe", "nodes separated by commas: ,"],
|
"the room to subscribe", "nodes separated by commas: ,"],
|
||||||
args_example = ["tom@localhost/dummy", "Tom", "room1@conference.localhost",
|
args_example = ["tom@localhost", "Tom", "room1@conference.localhost",
|
||||||
"urn:xmpp:mucsub:nodes:messages,urn:xmpp:mucsub:nodes:affiliations"],
|
"urn:xmpp:mucsub:nodes:messages,urn:xmpp:mucsub:nodes:affiliations"],
|
||||||
result_desc = "The list of nodes that has subscribed",
|
result_desc = "The list of nodes that has subscribed",
|
||||||
result_example = ["urn:xmpp:mucsub:nodes:messages",
|
result_example = ["urn:xmpp:mucsub:nodes:messages",
|
||||||
@ -1104,9 +1104,8 @@ subscribe_room(User, Nick, Room, Nodes) ->
|
|||||||
try jid:decode(Room) of
|
try jid:decode(Room) of
|
||||||
#jid{luser = Name, lserver = Host} when Name /= <<"">> ->
|
#jid{luser = Name, lserver = Host} when Name /= <<"">> ->
|
||||||
try jid:decode(User) of
|
try jid:decode(User) of
|
||||||
#jid{lresource = <<"">>} ->
|
UserJID1 ->
|
||||||
throw({error, "User's JID should have a resource"});
|
UserJID = jid:replace_resource(UserJID1, <<"modmucadmin">>),
|
||||||
UserJID ->
|
|
||||||
case get_room_pid(Name, Host) of
|
case get_room_pid(Name, Host) of
|
||||||
Pid when is_pid(Pid) ->
|
Pid when is_pid(Pid) ->
|
||||||
case p1_fsm:sync_send_all_state_event(
|
case p1_fsm:sync_send_all_state_event(
|
||||||
|
Loading…
Reference in New Issue
Block a user