From d4ff7eeb4a34579205dfb4016ebc390e4eaa4896 Mon Sep 17 00:00:00 2001 From: Christophe Romain Date: Mon, 10 Dec 2007 09:33:30 +0000 Subject: [PATCH] pubsub database upgrade bugfix SVN Revision: 1058 --- ChangeLog | 4 ++++ src/mod_pubsub/mod_pubsub.erl | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8e6d84baf..576701528 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2007-12-10 Christophe Romain + + * src/mod_pubsub/mod_pubsub.erl: database upgrade bugfix + 2007-12-09 Mickael Remond * src/web/ejabberd_http.erl: Fixed URL decoding code (EJAB-450) diff --git a/src/mod_pubsub/mod_pubsub.erl b/src/mod_pubsub/mod_pubsub.erl index 88ccc8d3d..4a8bb178b 100644 --- a/src/mod_pubsub/mod_pubsub.erl +++ b/src/mod_pubsub/mod_pubsub.erl @@ -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}),