]> granicus.if.org Git - ejabberd/commitdiff
Don't send unavailable presence when leaving occupant has other nicks in the room...
authorBadlop <badlop@process-one.net>
Tue, 23 Aug 2011 19:53:19 +0000 (21:53 +0200)
committerBadlop <badlop@process-one.net>
Tue, 23 Aug 2011 19:53:19 +0000 (21:53 +0200)
src/mod_muc/mod_muc_room.erl

index f81611e1ab3ad2e6943393e643d7e924b4298a71..e7a9ba714976bf0ee3094f97f4f7b507e7beeaa8 100644 (file)
@@ -893,7 +893,10 @@ process_presence(From, Nick, {xmlelement, "presence", Attrs, _Els} = Packet,
                                    end,
                        NewState =
                            add_user_presence_un(From, NewPacket, StateData),
-                       send_new_presence(From, NewState),
+                       case ?DICT:find(Nick, StateData#state.nicks) of
+                           {ok, [_, _ | _]} -> ok;
+                           _ -> send_new_presence(From, NewState)
+                       end,
                        Reason = case xml:get_subtag(NewPacket, "status") of
                                false -> "";
                                Status_el -> xml:get_tag_cdata(Status_el)