mirror of
https://github.com/processone/ejabberd.git
synced 2025-01-01 17:53:00 +01:00
* src/mod_muc/mod_muc.erl: Clean online room table on cluster node
restart SVN Revision: 724
This commit is contained in:
parent
1e03821f39
commit
3c44f24aad
@ -1,3 +1,8 @@
|
||||
2007-02-13 Alexey Shchepin <alexey@sevcom.net>
|
||||
|
||||
* src/mod_muc/mod_muc.erl: Clean online room table on cluster node
|
||||
restart
|
||||
|
||||
2007-02-13 Mickael Remond <mickael.remond@process-one.net>
|
||||
|
||||
* src/ejabberd_auth_ldap.erl: Added ldap_local_filter option. This
|
||||
|
@ -149,6 +149,7 @@ init([Host, Opts]) ->
|
||||
MyHost = gen_mod:get_opt(host, Opts, "conference." ++ Host),
|
||||
update_tables(MyHost),
|
||||
mnesia:add_table_index(muc_registered, nick),
|
||||
mnesia:subscribe(system),
|
||||
Access = gen_mod:get_opt(access, Opts, all),
|
||||
AccessCreate = gen_mod:get_opt(access_create, Opts, all),
|
||||
AccessAdmin = gen_mod:get_opt(access_admin, Opts, none),
|
||||
@ -207,6 +208,9 @@ handle_info({room_destroyed, RoomHost, Pid}, State) ->
|
||||
end,
|
||||
mnesia:transaction(F),
|
||||
{noreply, State};
|
||||
handle_info({mnesia_system_event, {mnesia_down, Node}}, State) ->
|
||||
clean_table_from_bad_node(Node),
|
||||
{noreply, State};
|
||||
handle_info(_Info, State) ->
|
||||
{noreply, State}.
|
||||
|
||||
@ -616,6 +620,19 @@ get_vh_rooms(Host) ->
|
||||
['$_']}]).
|
||||
|
||||
|
||||
clean_table_from_bad_node(Node) ->
|
||||
F = fun() ->
|
||||
Es = mnesia:select(
|
||||
muc_online_room,
|
||||
[{#muc_online_room{pid = '$1', _ = '_'},
|
||||
[{'==', {node, '$1'}, Node}],
|
||||
['$_']}]),
|
||||
lists:foreach(fun(E) ->
|
||||
mnesia:delete_object(E)
|
||||
end, Es)
|
||||
end,
|
||||
mnesia:transaction(F).
|
||||
|
||||
|
||||
update_tables(Host) ->
|
||||
update_muc_room_table(Host),
|
||||
|
Loading…
Reference in New Issue
Block a user