[ejabberd] Login to muc room with exmpp

kael ka-el at laposte.net
Thu May 19 23:26:32 MSD 2011


On 05/19/2011 07:06 PM, Alexander Kuleshov wrote:
> I try to use:
>
> create_move_room (Room, Username) ->
>      #xmlel {name=presence, attrs=[#xmlattr{name = to,
> 					   value = list_to_binary(Room ++ "@" ++ ?JABBER_MUC_HOST ++ "/"
> ++ Username)}],
> 	                                   children=[#xmlel{name=x,
> attrs=[#xmlattr{name=xmlns, value="?MUC"}]}]}.

Try :

create_move_room(Room, Username) ->
     #xmlel{
         ns = ?NS_JABBER_CLIENT,
         name = presence,
         attrs = [
             #xmlattr{
                 name = <<"to">>,
                 value = list_to_binary(Room ++ "@" ++
                     ?JABBER_MUC_HOST ++ "/" ++ Username)
             }
         ],
         children = [
             #xmlel{
                 ns = ?NS_MUC,
                 name = x
             }
         ]
     }.

Some doc : 
<https://www.process-one.net/docs/exmpp/devdoc/trunk/exmpp_xml.html> and 
<https://www.process-one.net/docs/exmpp/devdoc/trunk/>.

-- 
kael



More information about the ejabberd mailing list