我正在为 OpenFire 编写一个插件。 在这个插件中,我想创建节点并将客户端订阅到这个节点。 我成功创建了节点,但我无法订阅客户端。 我正在使用此代码来订阅客户端,但没有使用。
Noderetreived = pubsub.getNode(nodeId); NodeSubscription subscription = new NodeSubscription(rerereived, 新 JID("dinga@exalanche"), 新 JID("dinga@exalanche"), State.subscribed, "sdfsdfdsds"); retreived.addSubscription(subscription); retreived.approveSubscription(subscription, true); retreived.saveToDB();
我终于找到了。 很简单
只有一行
retreived.createSubscription(null, new JID("dinga@exalanche"), new JID("dinga@exalanche"), false, null);