25
1
mirror of https://github.com/processone/ejabberd.git synced 2024-11-22 16:20:52 +01:00

pubsub database upgrade bugfix

SVN Revision: 1058
This commit is contained in:
Christophe Romain 2007-12-10 09:33:30 +00:00
parent 4ab25a3c0c
commit d4ff7eeb4a
2 changed files with 8 additions and 4 deletions

View File

@ -1,3 +1,7 @@
2007-12-10 Christophe Romain <christophe.romain@process-one.net>
* src/mod_pubsub/mod_pubsub.erl: database upgrade bugfix
2007-12-09 Mickael Remond <mremond@process-one.net>
* src/web/ejabberd_http.erl: Fixed URL decoding code (EJAB-450)

View File

@ -135,12 +135,13 @@ stop(Host) ->
%%--------------------------------------------------------------------
init([ServerHost, Opts]) ->
?INFO_MSG("pubsub init ~p ~p",[ServerHost,Opts]),
mnesia:create_table(pubsub_presence,
[{disc_copies, [node()]},
{attributes, record_info(fields, pubsub_presence)}]),
Host = gen_mod:get_opt_host(ServerHost, Opts, "pubsub.@HOST@"),
ServedHosts = gen_mod:get_opt(served_hosts, Opts, []),
Access = gen_mod:get_opt(access_createnode, Opts, all),
update_database(Host),
mnesia:create_table(pubsub_presence,
[{disc_copies, [node()]},
{attributes, record_info(fields, pubsub_presence)}]),
mod_disco:register_feature(ServerHost, ?NS_PUBSUB),
ejabberd_hooks:add(disco_local_identity, ServerHost,
?MODULE, disco_local_identity, 75),
@ -166,7 +167,6 @@ init([ServerHost, Opts]) ->
{?NS_PUBSUB_OWNER, ejabberd_sm, iq_sm}]),
ejabberd_router:register_route(Host),
{Plugins, NodeTree} = init_plugins(Host, ServerHost, Opts),
update_database(Host),
ets:new(gen_mod:get_module_proc(Host, pubsub_state), [set, named_table]),
ets:insert(gen_mod:get_module_proc(Host, pubsub_state), {nodetree, NodeTree}),
ets:insert(gen_mod:get_module_proc(Host, pubsub_state), {plugins, Plugins}),