[ejabberd] x-tension tags in ejabberd-muc <presence/>

Heiner Wolf wolf at bluehands.de
Thu Mar 30 13:25:17 MSD 2006


Hi,

>> could it be, that ejabberd's MUX component eats sub-tags of the
>> presence stanze, which it does not know?
>
>Yes, it does.  Look at filter_presence/1 in mod_muc_room.erl.  It
>removes all cdata, and all child elements except for <show/> and
><status/>.

interesting. Is there something I can do about it? What I (and
probably others would need is that it passes unknown tags/namespace
but still blocks muc#user.

This is my filter_presence function. Does not tell me too much though
:-) I suppose somewhere around "case XMLNS of". But I can not yet
interpret "++ _ ->".

filter_presence({xmlelement, "presence", Attrs, Els}) ->
    FEls = lists:filter(
       fun(El) ->
         case El of
       {xmlcdata, _} ->
           false;
       {xmlelement, _Name1, Attrs1, _Els1} ->
           XMLNS = xml:get_attr_s("xmlns", Attrs1),
           case XMLNS of
         ?NS_MUC ++ _ ->
             false;
         _ ->
             true
           end
         end
       end, Els),
    {xmlelement, "presence", Attrs, FEls}.

Seems to be time for an erlang lesson. But before I start a question
to the developer: Is it possible to pass unknown tags in the presence
stanza without rewriting too much code? And will the server store the
entire stanza for new participants?

BTW: what does the "/1" mean in your hint "Look at filter_presence/1"

Regards
hw
--
Dr. Heiner Wolf
bluehands GmbH & Co.mmunication KG
http://www.bluehands.de/people/hw
+49 (0721) 16108 75
--
Jabber enabled Virtual Presence on the Web: www.lluna.de
Open Source Future History: www.galactic-developments.de


More information about the ejabberd mailing list