[ejabberd] config file options in ejabberd module

Stephan Maihöfer sma at turtle-entertainment.de
Thu Sep 17 14:14:27 MSD 2009


hi,

i have a question regarding the accessing of module options
that are set in ejabberd config-file. i have serveral hosts
configured on my server, like this:

{hosts, ["server1.example.com",
         "server2.example.com"]}.

and then i have the muc_module configured for each host.

now I have made some adjustements to mod_muc_log that would
require defferent behaviour depending on what muc-service
it is running at. for this, i want to access some kind of config
file variable of the module, per host. say "room_type".

i do not quite see how this is possible. there seems to be
the "Opts" variable that gets all the options on module_init,
some other functions also get "Opts" but add_message_to_log
for example get's the room options.

all the functions to retrieve config file variables need either
a global module or a hostname. ?MYHOST always points to the
first hostname a server is serving. 

i seem to be missing some ?CURRENTHOST or something. Or some way
to access the "current" "Opts" that were set on module init.

can anyone enlighten me on this?

thanks,
stephan


More information about the ejabberd mailing list