【问题标题】:Does subscribed stanza trigger a callback?订阅的节会触发回调吗?
【发布时间】:2014-01-13 21:08:38
【问题描述】:

有没有办法从订阅的类型节中获取回调?有来自服务器的 XML 响应,但 Strophe 没有触发任何回调。

这是我要发送的:

<body rid='576795248' xmlns='http://jabber.org/protocol/httpbind' sid='e3552b8d'><presence to='user2@localhost' type='subscribed' xmlns='jabber:client' id='2:sendIQ'/></body>

我得到:

<body xmlns='http://jabber.org/protocol/httpbind'><iq xmlns="jabber:client" type="set" id="842-543" to="user1@localhost"><query xmlns="jabber:iq:roster"><item jid="test2@localhost" subscription="both"/></query></iq></body>

如您所见,服务器正在正确发送响应,但 Strophe 没有触发任何回调。

谢谢。

【问题讨论】:

    标签: strophe


    【解决方案1】:

    添加处理程序:addHandler(func, Strophe.NS.ROSTER, 'iq')

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-12-30
      • 2018-06-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-03-12
      相关资源
      最近更新 更多