aboutsummaryrefslogtreecommitdiff
path: root/src/mod_muc
diff options
context:
space:
mode:
authorMickaël Rémond <mickael.remond@process-one.net>2007-09-14 14:16:36 +0000
committerMickaël Rémond <mickael.remond@process-one.net>2007-09-14 14:16:36 +0000
commitafec054544b2ac2945fd0576a30f48f1567471c7 (patch)
tree729bf997420e70caf6f862dde0eebabc50b6d49c /src/mod_muc
parent* src/ejabberd_s2s_out.erl: Moved s2s connexion information from INFO level t... (diff)
* src/ejabberd_c2s.erl: Option to prevent the use of Erlang OTP supervisor for transient processes (EJAB-354).
* src/ejabberd_s2s_in.erl: Likewise. * src/ejabberd_s2s_out.erl: Likewise. * src/mod_muc/mod_muc_room.erl: Likewise. * src/configure.ac: Likewise. * src/configure: Likewise. * src/Makefile.in: Likewise. * src/mod_muc/Makefile.in: Likewise. SVN Revision: 931
Diffstat (limited to 'src/mod_muc')
-rw-r--r--src/mod_muc/Makefile.in5
-rw-r--r--src/mod_muc/mod_muc_room.erl18
2 files changed, 19 insertions, 4 deletions
diff --git a/src/mod_muc/Makefile.in b/src/mod_muc/Makefile.in
index 6b303d702..4e5d728ea 100644
--- a/src/mod_muc/Makefile.in
+++ b/src/mod_muc/Makefile.in
@@ -15,6 +15,11 @@ ifdef debug
EFLAGS+=+debug_info
endif
+ifeq (@transient_supervisors@, false)
+ EFLAGS+=-DNO_TRANSIENT_SUPERVISORS
+endif
+
+
OBJS = \
$(OUTDIR)/mod_muc.beam \
$(OUTDIR)/mod_muc_log.beam \
diff --git a/src/mod_muc/mod_muc_room.erl b/src/mod_muc/mod_muc_room.erl
index fccd09cbd..7fbaf555a 100644
--- a/src/mod_muc/mod_muc_room.erl
+++ b/src/mod_muc/mod_muc_room.erl
@@ -94,16 +94,26 @@
-define(FSMOPTS, []).
-endif.
+%% Module start with or without supervisor:
+-ifdef(NO_TRANSIENT_SUPERVISORS).
+-define(SUPERVISOR_START,
+ gen_fsm:start(?MODULE, [Host, ServerHost, Access, Room, HistorySize,
+ RoomShaper, Creator, Nick, DefRoomOpts],
+ ?FSMOPTS)).
+-else.
+-define(SUPERVISOR_START,
+ Supervisor = gen_mod:get_module_proc(ServerHost, ejabberd_mod_muc_sup),
+ supervisor:start_child(
+ Supervisor, [Host, ServerHost, Access, Room, HistorySize, RoomShaper,
+ Creator, Nick, DefRoomOpts])).
+-endif.
%%%----------------------------------------------------------------------
%%% API
%%%----------------------------------------------------------------------
start(Host, ServerHost, Access, Room, HistorySize, RoomShaper,
Creator, Nick, DefRoomOpts) ->
- Supervisor = gen_mod:get_module_proc(ServerHost, ejabberd_mod_muc_sup),
- supervisor:start_child(
- Supervisor, [Host, ServerHost, Access, Room, HistorySize, RoomShaper,
- Creator, Nick, DefRoomOpts]).
+ ?SUPERVISOR_START.
start(Host, ServerHost, Access, Room, HistorySize, RoomShaper, Opts) ->
Supervisor = gen_mod:get_module_proc(ServerHost, ejabberd_mod_muc_sup),