XMPP聊天发送/接收的消息同步 [英] XMPP chat sent/received message synchronization

查看:187
本文介绍了XMPP聊天发送/接收的消息同步的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

场景:我正在尝试开发一个带有聊天小部件的网站.我正在使用ASP.NET,C#,agsXMPP库作为实现此目的的工具.我将Openfire jabber服务器用于XMPP服务器.

Scenario: I am trying to develop a web site which features a chat widget. I am using ASP.NET, C#, agsXMPP library as my tools in achieving this purpose. I use Openfire jabber server for XMPP server.

问题:当我访问网站上的小部件并开始聊天时,我发送的消息类型为聊天"和线程消息放.在这种情况下,我会在客户端上收到此消息.当我回复此消息时,我看到 thread 值与我发送的值不同吗?根据 RFC 3921第2.1.2.3节元素的值由发送者生成,并应在任何回复中复制回去. 但是,我看不到这种情况.这意味着,我无法将响应与我发送的消息链接起来.

Problem: When I access the widget on the website and start chatting, I send a message with message type "chat" and thread set. I receive this message on the client in this case Spark. When I reply to this message, I see that the thread value is not the same as the one I sent? According to RFC 3921 section 2.1.2.3, The value of the element is generated by the sender and SHOULD be copied back in any replies. However, I don't see this happening.This means, I cannot link the response with the message I sent.

有人可以帮我解决我所缺少的吗?以下是发送和接收的消息.

Can anyone help me with what I am missing? The following is the message sent and received.

已发送消息:<message type="chat" to="saurabh@127.0.0.1/spark" id="agsXMPP_6" from="gantir@127.0.0.1/CPWebchat"><thread>d6ddeebe-f23f-4854-a315-2a9de32906b8</thread><subject>Ramjee Ganti</subject><body>An Anonymous user via the web is attempting to contact you. Name: Ramjee Ganti Email: xxx@example.com Issue: Sample Test</body></message>

收到的消息:<message id="BTqN4-34" to="gantir@127.0.0.1/CPWebchat" from="saurabh@127.0.0.1/spark" type="chat"><body>Hello</body> <thread>42MtKq</thread><x xmlns="jabber:x:event"><offline/> <composing/></x></message>

推荐答案

RFC应该说"thread"元素(请参见

The RFC says the "thread" element SHOULD (see http://tools.ietf.org/html/rfc2119) be returned in replies. It may be that this client just didn't implement it.

这篇关于XMPP聊天发送/接收的消息同步的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆