25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-12-22 17:28:25 +01:00

Pass room state to muc_{un}subscribed hook

This commit is contained in:
Paweł Chmielowski 2022-05-09 17:32:34 +02:00
parent ed7fc956d5
commit a916d94000

View File

@ -1967,7 +1967,7 @@ set_subscriber(JID, Nick, Nodes,
id = p1_rand:get_string(), id = p1_rand:get_string(),
sub_els = [#muc_subscribe{nick = Nick}]}]}}]}, sub_els = [#muc_subscribe{nick = Nick}]}]}}]},
{Packet2a, Packet2b} = ejabberd_hooks:run_fold(muc_subscribed, ServerHost, {Packet1a, Packet1b}, {Packet2a, Packet2b} = ejabberd_hooks:run_fold(muc_subscribed, ServerHost, {Packet1a, Packet1b},
[ServerHost, Room, Host, BareJID]), [ServerHost, Room, Host, BareJID, StateData]),
send_subscriptions_change_notifications(Packet2a, Packet2b, NewStateData); send_subscriptions_change_notifications(Packet2a, Packet2b, NewStateData);
_ -> _ ->
ok ok
@ -4556,7 +4556,7 @@ process_iq_mucsub(From, #iq{type = set, sub_els = [#muc_unsubscribe{}]},
id = p1_rand:get_string(), id = p1_rand:get_string(),
sub_els = [#muc_subscribe{nick = Nick}]}]}}]}, sub_els = [#muc_subscribe{nick = Nick}]}]}}]},
{Packet2a, Packet2b} = ejabberd_hooks:run_fold(muc_unsubscribed, ServerHost, {Packet1a, Packet1b}, {Packet2a, Packet2b} = ejabberd_hooks:run_fold(muc_unsubscribed, ServerHost, {Packet1a, Packet1b},
[ServerHost, Room, Host, BareJID]), [ServerHost, Room, Host, BareJID, StateData]),
send_subscriptions_change_notifications(Packet2a, Packet2b, StateData), send_subscriptions_change_notifications(Packet2a, Packet2b, StateData),
NewStateData2 = case close_room_if_temporary_and_empty(NewStateData) of NewStateData2 = case close_room_if_temporary_and_empty(NewStateData) of
{stop, normal, _} -> stop; {stop, normal, _} -> stop;