MUC、XMPP - 未读消息计数器,最后一条消息

MUC, XMPP - Unread messages counter, last message

是否可以不加入房间获得:

  1. 来自MUC的未读消息数?我在 7 年前看到过类似的问题,但仍然没有找到这样的解决方案。或者有未读消息是否可以获取信息?

  2. 在房间里写的最后一条消息?

谢谢

Is it possible without joining to the room to get:

如果MUC房间启用了存档,任何人都可以查询https://xmpp.org/extensions/xep-0313.html#example-5

例如:

<iq to='room1@conference.localhost' type='set' id='juliet1'>
  <query xmlns='urn:xmpp:mam:2' queryid='f28' />
</iq>

响应包括所有房间消息:

<message to='user1@localhost/tka1'
    from='room1@conference.localhost'>
  <result id='1652698091920538'
    queryid='f28'
    xmlns='urn:xmpp:mam:2'>
    <forwarded xmlns='urn:xmpp:forward:0'>
      <message xml:lang='es'
    from='room1@conference.localhost/admin'
    type='groupchat'
    id='44:501539'
    xmlns='jabber:client'>
        <archived by='room1@conference.localhost'
    id='1652698091920538'
    xmlns='urn:xmpp:mam:tmp'/>
        <stanza-id by='room1@conference.localhost'
    id='1652698091920538'
    xmlns='urn:xmpp:sid:0'/>
        <body>mensa 1</body>
      </message>
      <delay from='conference.localhost'
    stamp='2022-05-16T10:48:11.920538Z'
    xmlns='urn:xmpp:delay'/>
    </forwarded>
  </result>
</message>

the number of unread messages from MUC? I have seen similar questions ~7 years ago but still didn't find such solution. Or is it possible to get information if there is a unread message?

“未读”是一个只有客户端知道,服务端不知道的概念。客户端必须告诉服务器客户端读取的最后一条消息是什么。也许使用 https://xmpp.org/extensions/xep-0313.html#filter-time

the last message that was written in the room?

快速浏览一下,我没有在 XEP-0313 中找到任何相关内容。如果你仔细看看,也许你会找到一些解决办法。