XMPP 1对1聊天查询?
我正在使用 Openfire 开发一个聊天项目。
我已经完成了群聊。
但混乱在于一对一的聊天。
我正在使用:
<message from='user2@server/user2' to='user1@server/user1' type='chat'>
<body>TEST< /body>
</message>
但它不发送它。
提前致谢。
I am developing a chat project using Openfire.
I have done with group chatting.
But confusion is in 1 to 1 chat.
I am using:
<message from='user2@server/user2' to='user1@server/user1' type='chat'>
<body>TEST< /body>
</message>
but it does not send it.
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
假设
<
字符后面不应该有空格,它看起来是正确的。您甚至可以不使用
from
属性,因为它将由服务器添加。Assuming that the spaces after the
<
characters shouldn't be there, it looks correct.You can even do without the
from
attribute, since it'll be added by the server.当您单击发送按钮时,将调用此方法并将日志消息显示为
when you click on send button this method will be called and it shows log message as
修复语法问题、删除
from
地址并从to
地址中删除可疑正确的资源后,您将得到:上的资源
解决就像这个问题。请阅读 XEP-0296 了解在执行 XMPP IM 时如何正确处理资源。After fixing the syntax issues, removing the
from
address, and removing the doubtfully-correct resource from theto
address, you're left with:The resource on the
to
address is like the issue. Read XEP-0296 for how to deal with resources correctly when doing XMPP IM.