25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-08 15:42:29 +01:00

Only use hash route-balancing when MUC is broadcasted

This commit is contained in:
Evgeniy Khramtsov 2011-09-15 08:52:22 +10:00
parent c9a712a16a
commit 8f27a697c0
2 changed files with 12 additions and 6 deletions

View File

@ -46,6 +46,7 @@
node_down/1, node_down/1,
migrate/3, migrate/3,
get_vh_rooms/1, get_vh_rooms/1,
is_broadcasted/1,
can_use_nick/3]). can_use_nick/3]).
%% gen_server callbacks %% gen_server callbacks

View File

@ -3879,10 +3879,15 @@ element_size(El) ->
size(xml:element_to_binary(El)). size(xml:element_to_binary(El)).
route_stanza(From, To, El) -> route_stanza(From, To, El) ->
#jid{luser = LUser, lserver = LServer} = To, case mod_muc:is_broadcasted(From#jid.lserver) of
case ejabberd_cluster:get_node({LUser, LServer}) of true ->
Node when Node == node() -> #jid{luser = LUser, lserver = LServer} = To,
ejabberd_router:route(From, To, El); case ejabberd_cluster:get_node({LUser, LServer}) of
_ -> Node when Node == node() ->
ok ejabberd_router:route(From, To, El);
_ ->
ok
end;
false ->
ejabberd_router:route(From, To, El)
end. end.