+2007-05-09 Alexey Shchepin <alexey@sevcom.net>
+
+ * src/mod_muc/mod_muc.erl: Bugfix
+
2007-05-07 Alexey Shchepin <alexey@sevcom.net>
* src/ejabberd_receiver.erl: Workaround for inet_drv bug
[{ram_copies, [node()]},
{attributes, record_info(fields, muc_online_room)}]),
mnesia:add_table_copy(muc_online_room, node(), ram_copies),
- clean_table_from_bad_node(node()),
MyHost = gen_mod:get_opt(host, Opts, "conference." ++ Host),
update_tables(MyHost),
+ clean_table_from_bad_node(node(), MyHost),
mnesia:add_table_index(muc_registered, nick),
mnesia:subscribe(system),
Access = gen_mod:get_opt(access, Opts, all),
end,
mnesia:transaction(F).
+clean_table_from_bad_node(Node, Host) ->
+ F = fun() ->
+ Es = mnesia:select(
+ muc_online_room,
+ [{#muc_online_room{pid = '$1',
+ name_host = {'_', Host},
+ _ = '_'},
+ [{'==', {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),