本文介绍了Ejabberd MucSub:当成员发送的状态不可用时,该服务不响应的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在与Ejabberd 19.09和mucsub进行持久的小组对话.

I'm working on persistent group conversations with Ejabberd 19.09 and mucsub.

当组的成员发送不可用的状态时,有时服务器根本不响应.如果我们在存在状态不可用之前发送了存在状态后重复了相同的测试,则服务器会做出响应.显然,无论如何,我们的房间入住率没有变化.

When a member of a group sends a presence unavailable, sometimes the server does not respond at all. If we repeat the same test after sending a presence available just before the presence unavailable, the server responds.In any case, apparently, we have no changes in the room occupancy.

这是预期的行为吗?

再现第一个测试的步骤:

  1. 管理员test1创建会议室roomX(仅限会员)
  1. admin test1 creates a room roomX (members-only)
    <!-- [CREATE ROOM] | test1 -->
    <iq from='test1@x.com' to='roomX@conference.x.com' type='set' id='1111111'>
      <subscribe xmlns='urn:xmpp:mucsub:0' nick='test1'>
        <event node='urn:xmpp:mucsub:nodes:messages' /><event node='urn:xmpp:mucsub:nodes:affiliations' /><event node='urn:xmpp:mucsub:nodes:subject' /><event node='urn:xmpp:mucsub:nodes:config' /><event node='urn:xmpp:mucsub:nodes:subscribers' /><event node='urn:xmpp:mucsub:nodes:presence' />
      </subscribe>
    </iq>
  1. 管理员test1邀请和订阅用户test2
  1. admin test1 invites and subscribes the user test2
<!-- [INVITE test2] | test1 -->
<message from='test1@x.com' id='33333' to='roomX@conference.x.com'>
  <x xmlns='http://jabber.org/protocol/muc#user'>
    <invite to='test2@x.com'><reason>REASON</reason></invite>
  </x>
</message>
<!-- [SUBSCRIBE test2 TO ROOM] | test1 -->
<iq from='test1@x.com' to='roomX@conference.x.com' type='set' id='222222'>
  <subscribe xmlns='urn:xmpp:mucsub:0' jid='test2@x.com' nick='test2'>
    <event node='urn:xmpp:mucsub:nodes:messages' /><event node='urn:xmpp:mucsub:nodes:presence' /><event node='urn:xmpp:mucsub:nodes:subject' /><event node='urn:xmpp:mucsub:nodes:config' /><event node='urn:xmpp:mucsub:nodes:subscribers' /><event node='urn:xmpp:mucsub:nodes:presence' />
  </subscribe>
</iq>
  1. 邀请被自动接受,用户test2现在是会议室成员,他可以发送消息,并且已预订所有活动
  2. 成员test2想要放弃会议室,并发送状态为不可用"的
  1. the invitation is automatically accepted, user test2 is now a room member, he can send messages and he is subscribed to all events
  2. member test2 wants to abandon the room, and sends a presence type=unavailable
<!-- [test2 leaves the room] | test2 -->
<presence to='roomX@conference.x.com/test2' from='test2@x.com' type='unavailable'>
  <status>leave</status>
</presence>

结果:

  • 服务未响应会员
  • 房间入住率没有变化:会员的隶属关系仍然成员",角色仍为成员",订阅仍处于活动状态
  • service does not respond to member
  • no changes to the room occupancy: member’s affiliation is still"member", role is still "member", subscription is still active

重现第二项测试的步骤:

  1. 管理员test1创建会议室roomX(仅限会员)
  2. 管理员test1邀请和订阅用户test2
  3. 邀请被自动接受,用户test2现在是会议室成员,他可以发送消息,并且已预订所有活动
  4. 成员test2发送一个在线状态type = available(从理论上讲这是多余的,但这是在此测试中故意创建的)
  1. admin test1 creates a room roomX (members-only)
  2. admin test1 invites and subscribes the user test2
  3. the invitation is automatically accepted, user test2 is now a room member, he can send messages and he is subscribed to all events
  4. member test2 sends a presence type=available (in theory this is redundant, but it's made on purpose as part of this test)
<!-- [test2 JOINS THE ROOM] | test2 -->
<presence from='test2@x.com' id='n13mt3l' to='room@conference.x.com/test2'>
  <x xmlns='http://jabber.org/protocol/muc'/>
</presence>
  1. 成员test2想要放弃会议室,并发送状态为不可用"的
  1. member test2 wants to abandon the room, and sends a presence type=unavailable

结果

  • 服务回应会员
  • 房间入住率没有变化:会员的隶属关系仍然成员",角色仍为成员",订阅仍处于活动状态
  • service responds to member
  • no changes to the room occupancy: member’s affiliation is still"member", role is still "member", subscription is still active

推荐答案

我认为您缺少第一步:

<presence to='test2-157@conference.x.com/test1'  id='s6MLD-390'><x xmlns='http://jabber.org/protocol/muc'></x></presence>

这篇关于Ejabberd MucSub:当成员发送的状态不可用时,该服务不响应的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 22:00