0
votes

I am developing chat application using ejabberd 18.01

Is there any way to find message owner jid, when retrieving MUC room messages?

<x xmlns="http://jabber.org/protocol/muc#user"><item jid="[email protected]/desktop"/></x>

Above xml is part of message xml when room admin retrieves messages, but messages which owner is room other participant, doesn't contain x tag.

1

1 Answers

0
votes

messages which owner is room other participant, doesn't contain x tag.

Read carefully this paragraph from https://xmpp.org/extensions/xep-0313.html#business-storeret-muc-archives

In the case of non-anonymous rooms or if the recipient of the MUC archive has the right to access the sender real JID at the time of the query, the archive message will use extended message information in an element qualified by the 'http://jabber.org/protocol/muc#user' namespace and containing an child with a 'jid' attribute specifying the occupant's full JID, as defined for non-anonymous room presence in Multi-User Chat (XEP-0045) [10].

In practice, this means that you must configure the room and set this option:

Present real Jabber IDs to: anyone

Or if you want this in all the new rooms, configure in ejabberd.yml

modules:
  mod_muc:
    default_room_options:
      anonymous: false