1
0
Fork 0
mirror of https://github.com/processone/ejabberd synced 2025-10-05 19:42:11 +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),