presence_broadcast

Hi
what's the meaning of

presence_broadcast ->
                                 fun(L) ->
                                         lists:map(
                                           fun(moderator) -> moderator;
                                              (participant) -> participant;
                                              (visitor) -> visitor
                                           end, L)
                                 end;

in mod_muc.erl ejabberd 16.01?

If you look at the other

If you look at the other lines before and after those ones, they are defining funs to check if configured values are valid or not. And the funs are defined depending in the value of Opt. When Opt is presence_broadcast, the fun accepts a list of atoms that can be either: moderator, participant, visitor. If an element different that those is configured, the fun will fail.

Those funs are defined here, but where are they used? They are passed to gen_mod:get_opt, which will verify one by one all the options defined in the configuration file, and return all of them, or will crash and stop ejabberd if any option does not satisfy the corresponding fun.

Syndicate content