【问题标题】:Ejabberd: Get myself message on one - one chatEjabberd:在一对一聊天中给自己发消息
【发布时间】:2014-02-03 10:07:23
【问题描述】:

我有一个网络聊天应用程序,当用户 1 使用不同资源的多个浏览器中的一个帐户登录并向用户 2 发送消息时。

例如: 用户 1 使用 jid 登录 chrome:user1@localhost/chrome 用户 1 登录 chrome whit jid: user1@localhost/firefox

Chrome 中的用户 1 向用户 2 发送内容为“hello”的聊天消息。

我在这里遇到了一个问题,ejabberd 服务器只是向 user2 发送“hello”,但我希望服务器还为所有用户 1 在 chrome 和 firefox 中发送“hello”的副本。

我该怎么做?

【问题讨论】:

标签: xmpp ejabberd


【解决方案1】:

是的,ejabberd 支持碳消息。我的解决方案是:发送消息后,我通过将“to”设置为我的 barejid 并将“type”替换为“copy”(我的自定义类型)来为自己发送消息副本:

<message to='me@192.168.2.90' type='copy' id='5ea1f7d8-1961-c9dc-b599-55a89438491b' xmlns='jabber:client'>

<body>hello</body>

<x >
   <to>other@192.168.2.90</to>
</x>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-06-20
    • 1970-01-01
    • 2017-02-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多