24
1
mirror of https://github.com/processone/ejabberd.git synced 2024-06-08 21:43:07 +02:00

Clean muc_online_room when mod_muc starts (EJAB-1365)

This commit is contained in:
Badlop 2010-12-23 02:10:14 +01:00
parent 8c4e4e5f91
commit 7ca1c0387c

View File

@ -328,6 +328,9 @@ init([Host, Opts]) ->
{attributes, record_info(fields, muc_online_room)},
{types, [{name_host, {text, text}},
{pid, pid}]}]),
%% If ejabberd stops abruptly, ODBC table keeps obsolete data. Let's clean:
gen_storage:dirty_delete_where(MyHost, muc_online_room,
[{'=', name_host, {'_', MyHost}}]),
gen_storage:add_table_copy(MyHost, muc_online_room, node(), ram_copies),
catch ets:new(muc_online_users, [bag, named_table, public, {keypos, 2}]),
gen_storage:add_table_index(MyHost, muc_registered, nick),