用户离线时消息传递

发布于 2024-07-08 06:27:29 字数 203 浏览 4 评论 0原文

我有一个 OpenFire 插件,它可以创建一条消息并将其传递给用户。

XMPPServer.getInstance().getMessageRouter().route(message)

我想知道的是,如果用户不在线,该消息会发生什么情况。

我的目标是仅在用户在线时才传递消息,否则会失败或路由到位桶。

I have a plugin for OpenFire that creates and delivers a message to a user using

XMPPServer.getInstance().getMessageRouter().route(message)

What I would like to know is what happens to that message if the user is not online.

My goal is to only have the message delivered if the user is online, and fail or be routed to the bit bucket otherwise.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

揽清风入怀 2024-07-15 06:27:29

这一切都取决于 Openfire 配置。 在 Openfire 管理控制台中,转到服务器 -> 服务器设置-> 离线消息。 有存储、弹回和丢弃选项。

  • Store:发送消息时
    用户重新上线。
  • Drop:丢弃该消息。
  • 退回:丢弃并通过返回消息通知发件人。

It's all down to Openfire config. In the Openfire admin console, go to Server -> Server Settings -> Offline Messages. There are options for store, bounce and drop.

  • Store: deliver the message when the
    user comes back online.
  • Drop: Just discard the message.
  • Bounce: Discard and notify the sender with a return message.
拧巴小姐 2024-07-15 06:27:29

另一种方法,如果您只是希望这些消息不离线而不影响其他消息的传递,则使用 type='headline'。 标题不是很明确,但是 RFC 3921bis 第 5.2.2 节 规定:

标题——该消息提供警报、通知或其他预计不会回复的信息(例如新闻标题、体育更新、近实时市场数据和联合内容)。 因为预计不会对消息进行回复,所以通常接收客户端将在界面中呈现“标题”类型的消息,该界面适当地将消息与独立消息、聊天消息或群聊消息区分开来(例如,通过不向接收者提供回复能力)。 接收服务器应该将消息传递到收件人的所有可用资源。

当今的大多数服务器只会默默地将标题传递给离线用户,并在用户在线时传递到最高优先级的资源。

Another approach, if you just want these messages to not go offline without affecting the delivery of other messages, is to use type='headline'. Headlines are not terribly well-specified, but RFC 3921bis Section 5.2.2 says:

headline -- The message provides an alert, a notification, or other information to which no reply is expected (e.g., news headlines, sports updates, near-real-time market data, and syndicated content). Because no reply to the message is expected, typically a receiving client will present a message of type "headline" in an interface that appropriately differentiates the message from standalone messages, chat messages, or groupchat messages (e.g., by not providing the recipient with the ability to reply). The receiving server SHOULD deliver the message to all of the recipient's available resources.

Most servers of today will just silently drop headlines to offline users, and deliver to the highest priority resource if the user is online.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文