通过 IM 客户端接收 PubSub 通知
我是 Openfire 和 XMPP 的新手,有一些事情我不太清楚。
当网站上发布新博客文章时,我想使用 pubsub 通知所有订阅者。订阅者应该能够通过他们选择的 IM 应用程序(例如 Adium)接收这些通知。问题是收到的通知是这样的:
<message from='pubsub.shakespeare.lit' to='[email protected]' id='foo'>
<event xmlns='http://jabber.org/protocol/pubsub#event'>
<items node='princely_musings'>
<item id='ae890ac52d0df67ed7cfdf51b644e901'>
[ ... ENTRY ... ]
</item>
</items>
</event>
</message>
常规客户端无法解释。我应该将这种类型的消息传输为 IM 客户端可以理解的内容,最好是聊天消息?是否应该将其添加为服务器插件的额外功能,还是有其他方法?有类似这样的示例实现吗?
提前致谢
I am new to Openfire and XMPP and there are a few things that are a bit unclear to me.
I would like to use pubsub to notify all the subscribers when new blog post is published on the website. Subscribers should be able to receive these notifications through their IM applications of choice (Adium for example). The problem is that the received notification is something like this:
<message from='pubsub.shakespeare.lit' to='[email protected]' id='foo'>
<event xmlns='http://jabber.org/protocol/pubsub#event'>
<items node='princely_musings'>
<item id='ae890ac52d0df67ed7cfdf51b644e901'>
[ ... ENTRY ... ]
</item>
</items>
</event>
</message>
which regular clients can not interpret. Im I supposed to transfer this type of message to something an IM client can understand, preferably a chat message? Should this be added as an extra functionality as a server plugin, or is there some other way? Are there any example implementations of something like this?
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的 [ENTRY] 将包含 XML 标记,在将其显示给用户之前您需要对其执行某些操作。您需要为目标客户端编写一个插件,该插件知道该节点期望什么模式以及如何呈现它。
如果您只需要纯文本,请考虑使用 MUC。
Your [ENTRY] is going to consist of XML markup that you'll want to do something with before you show it to a user. You'll need to write a plugin for the target client that knows what schema to expect for that node and how to render it.
If you just want plain text, consider using MUC.