mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-26 16:26:24 +01:00
Revert buggy previous commit (thanks to W. Andrew Loe III), and add better fix
This commit is contained in:
parent
9cbf08700d
commit
20c4919eda
@ -306,26 +306,26 @@ init([Host, Opts]) ->
|
||||
{odbc_host, Host},
|
||||
{attributes, record_info(fields, muc_room_opt)},
|
||||
{type, bag},
|
||||
{types, [{name_host, {text, text}},
|
||||
{types, [{name_host, {binary, binary}},
|
||||
{opt, atom}]}]),
|
||||
gen_storage:create_table(Backend, MyHost, muc_room_affiliation,
|
||||
[{disc_copies, [node()]},
|
||||
{odbc_host, Host},
|
||||
{attributes, record_info(fields, muc_room_affiliation)},
|
||||
{type, bag},
|
||||
{types, [{name_host, {text, text}},
|
||||
{types, [{name_host, {binary, binary}},
|
||||
{affiliation, atom},
|
||||
{jid, jid}]}]),
|
||||
gen_storage:create_table(Backend, MyHost, muc_registered,
|
||||
[{disc_copies, [node()]},
|
||||
{odbc_host, Host},
|
||||
{attributes, record_info(fields, muc_registered)},
|
||||
{types, [{user_host, {jid, text}}]}]),
|
||||
{types, [{user_host, {jid, text}}, {nick, binary}]}]),
|
||||
gen_storage:create_table(Backend, MyHost, muc_online_room,
|
||||
[{ram_copies, [node()]},
|
||||
{odbc_host, Host},
|
||||
{attributes, record_info(fields, muc_online_room)},
|
||||
{types, [{name_host, {text, text}},
|
||||
{types, [{name_host, {binary, binary}},
|
||||
{pid, pid}]}]),
|
||||
%% If ejabberd stops abruptly, ODBC table keeps obsolete data. Let's clean:
|
||||
gen_storage:dirty_delete_where(MyHost, muc_online_room,
|
||||
|
@ -745,7 +745,7 @@ terminate({migrated, Clone}, _StateName, StateData) ->
|
||||
?INFO_MSG("Migrating room ~s@~s to ~p on node ~p",
|
||||
[StateData#state.room, StateData#state.host,
|
||||
Clone, node(Clone)]),
|
||||
mod_muc:room_destroyed(StateData#state.host, list_to_binary(StateData#state.room),
|
||||
mod_muc:room_destroyed(StateData#state.host, StateData#state.room,
|
||||
self(), StateData#state.server_host),
|
||||
ok;
|
||||
terminate(Reason, _StateName, StateData) ->
|
||||
@ -784,7 +784,7 @@ terminate(Reason, _StateName, StateData) ->
|
||||
tab_remove_online_user(LJID, StateData)
|
||||
end, [], StateData#state.users),
|
||||
add_to_log(room_existence, stopped, StateData),
|
||||
mod_muc:room_destroyed(StateData#state.host, list_to_binary(StateData#state.room), self(),
|
||||
mod_muc:room_destroyed(StateData#state.host, StateData#state.room, self(),
|
||||
StateData#state.server_host),
|
||||
ok.
|
||||
|
||||
|
@ -60,7 +60,7 @@
|
||||
message,
|
||||
presence}).
|
||||
|
||||
-record(state, {room, % string()
|
||||
-record(state, {room, % binary()
|
||||
host, % binary()
|
||||
server_host, % string()
|
||||
access,
|
||||
|
Loading…
Reference in New Issue
Block a user