diff --git a/src/mod_muc_room.erl b/src/mod_muc_room.erl index bdcb808a1..6280d75ad 100644 --- a/src/mod_muc_room.erl +++ b/src/mod_muc_room.erl @@ -1217,6 +1217,7 @@ subscriber_becomes_available(From, Nick, Packet, StateData) -> Role = get_default_role(Aff, State1), State2 = set_role(From, Role, State1), State3 = set_nick(From, Nick, State2), + tab_add_online_user(From, StateData), send_existing_presences(From, State3), send_initial_presence(From, State3, StateData), State3. @@ -1752,7 +1753,6 @@ update_online_user(JID, #user{nick = Nick, subscriptions = Nodes, NewStateData. add_online_user(JID, Nick, Role, IsSubscriber, Nodes, StateData) -> - tab_add_online_user(JID, StateData), User = #user{jid = JID, nick = Nick, role = Role, is_subscriber = IsSubscriber, subscriptions = Nodes}, StateData1 = update_online_user(JID, User, StateData), @@ -1775,6 +1775,7 @@ remove_online_user(JID, StateData, _IsSubscriber = true, _Reason) -> error -> StateData#state.users end, + tab_remove_online_user(JID, StateData), StateData#state{users = Users}; remove_online_user(JID, StateData, _IsSubscriber, Reason) -> LJID = jid:tolower(JID), @@ -2033,6 +2034,7 @@ add_new_user(From, Nick, add_online_user(From, Nick, Role, IsSubscribeRequest, Nodes, StateData)), + tab_add_online_user(From, NewState), send_existing_presences(From, NewState), send_initial_presence(From, NewState, StateData), Shift = count_stanza_shift(Nick, Els, NewState),