本文介绍了通过PHP进行Openfire离线通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在Ubuntu 12.04上安装了Openfire 3.10.2.

聊天功能正常,对于脱机消息管理,我已经安装了 CallbackOnOffline 插件.收件人脱机时,将调用一个URL.

Chat is working fine and for offline message management I have installed the CallbackOnOffline plugin. When the recipient is offline, a url is called.

该插件从plugin.callback_on_offline.url属性加载url,添加'to'和'from'参数并执行异步GET请求. 示例链接.

The plugin loads the url from the plugin.callback_on_offline.url property, adds 'to' and 'from' parameters and executes an asynchronous GET request. Sample Link.

我检查了从中获得的信息,并得到了至"和来自",但是我还需要这些信息以及用于推送通知的消息.

I checked what information I get from that and I got a "to" and "from", but I also need those along with the message for the push notifications.

重要部分:-

我想自定义openfire的CallbackOnOffline插件,并且想添加一个参数"message".我该怎么办?

I want to customize CallbackOnOffline plugin of openfire and I want to add one more parameter "message". How can I do that?

您将在这里找到代码: https://github.com/igniterealtime/Openfire/blob/master/src/plugins/callbackOnOffline/src/java/com/fotsum/CallbackOnOffline.java

You will find the code here: https://github.com/igniterealtime/Openfire/blob/master/src/plugins/callbackOnOffline/src/java/com/fotsum/CallbackOnOffline.java

现在,如何创建.jar文件,这需要在openfire中制作可安装的插件?

Now, how to create .jar file, which require to make installable plugin in openfire ?

推荐答案

如果要向链接添加更多参数.您需要扩展CallbackOnOffline插件.您将在此处找到代码: https://github.com/igniterealtime/Openfire/blob/master/src/plugins/callbackOnOffline/src/java/com/fotsum/CallbackOnOffline.java

If you want to add more parameters to the link. You need to extend the CallbackOnOffline Plugin. You will find the code here: https://github.com/igniterealtime/Openfire/blob/master/src/plugins/callbackOnOffline/src/java/com/fotsum/CallbackOnOffline.java

如果您查看java类,则会在第109和110行找到"to"和"from"参数,这些参数将被发送回(回调).只需在其中添加您需要的参数即可.

If you look into the java class, you will find on line 109 and 110 the "to" and "from" parameter which will be send back (callback). Just add there your parameter with value you need.

更新:之后,您需要再次使用ANT构建插件.查看如何构建插件: https://www.igniterealtime.org/builds/openfire/docs/latest/documentation/plugin-dev-guide.html

Update:After that you need to build the plugin with ANT again. See a how to build a plugin: https://www.igniterealtime.org/builds/openfire/docs/latest/documentation/plugin-dev-guide.html

这篇关于通过PHP进行Openfire离线通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-15 09:58