Joining MUC Room without "from" attribute?

Hi,

During debugging we have found out that our Smack-based client does not send the “from” attribute when joining a chatroom:

<presence xmlns="jabber:client" id="oFLI8-4"    to="test@conference.localhost/admin">
  <x xmlns="http://jabber.org/protocol/muc"/>
</presence>

It works fine with OF. However, this seems to be not compliant with xep-0045 ( 7.1.2 Basic MUC Protocol)

<presence
    from='hag66@shakespeare.lit/pda'
    to='darkcave@chat.shakespeare.lit/thirdwitch'>
  <x xmlns='http://jabber.org/protocol/muc'/>
</presence>

Is this a bug in OF and Smack that could eventually cause issues when connecting to non-Openfire servers?

An explanation of why the “from” field is not supported can be found in the following two threads:

“Hi Trung,

I expect (without checking the source) that spoofing the from address is not allowed within Smack. Even if it is possible Wildfire should drop such messages.

It could help to write a Wildfire Plugin instead of using Smack.

LG”

“Hey Dmitry,

*AFAIK, what you are trying to do is not allowed by the XMPP spec. The XMPP is very strict in the security area and does not allow to spoof the sender of a message. Otherwise, XMPP servers would be nice targets for spamming. *

So even if you manage to change the sender of the message from Smack you will depend on the server that you are using to not rectify that information.

Regards,

  • – Gato”*

A possible fix has been found here: http://community.igniterealtime.org/message/191907#191907

MUCRoom room = mucService.getChatRoom(roomName);
JID userjid = new JID(userName, server, "Server");
MultiUserChatService mucService = mucManager.getMultiUserChatServices().get(0);
               Message cheat = new Message();
cheat.setTo(room.getJID());
cheat.setFrom(userjid);
mucService.processPacket(cheat);

Could one of the developers shed some light on this?

Thanks