Commit fd99960a authored by Gaston Dombiak's avatar Gaston Dombiak Committed by gato

Update implementation based on...

Update implementation based on http://www.jabber.org/jeps/tmp/jep-0060-1.8.html#owner-subscriptions and http://www.jabber.org/jeps/tmp/jep-0060-1.8.html#owner-affiliations. JM-672

git-svn-id: http://svn.igniterealtime.org/svn/repos/wildfire/trunk@3839 b35dd754-fafc-0310-a699-88a17e54d16e
parent 9d379819
......@@ -1861,29 +1861,45 @@ public abstract class Node {
}
/**
* Sends the list of affiliated entities with the node to the owner that sent the IQ
* Sends the list of affiliations with the node to the owner that sent the IQ
* request.
*
* @param iqRequest IQ request sent by an owner of the node.
*/
void sendAffiliatedEntities(IQ iqRequest) {
void sendAffiliations(IQ iqRequest) {
IQ reply = IQ.createResultIQ(iqRequest);
Element childElement = iqRequest.getChildElement().createCopy();
reply.setChildElement(childElement);
for (NodeAffiliate affiliate : affiliates) {
Collection<NodeSubscription> subscriptions = affiliate.getSubscriptions();
if (subscriptions.isEmpty()) {
Element entity = childElement.addElement("entity");
if (affiliate.getAffiliation() == NodeAffiliate.Affiliation.none) {
continue;
}
Element entity = childElement.addElement("affiliation");
entity.addAttribute("jid", affiliate.getJID().toString());
entity.addAttribute("affiliation", affiliate.getAffiliation().name());
entity.addAttribute("subscription", "none");
}
else {
for (NodeSubscription subscription : subscriptions) {
Element entity = childElement.addElement("entity");
}
/**
* Sends the list of subscriptions with the node to the owner that sent the IQ
* request.
*
* @param iqRequest IQ request sent by an owner of the node.
*/
void sendSubscriptions(IQ iqRequest) {
IQ reply = IQ.createResultIQ(iqRequest);
Element childElement = iqRequest.getChildElement().createCopy();
reply.setChildElement(childElement);
for (NodeAffiliate affiliate : affiliates) {
for (NodeSubscription subscription : affiliate.getSubscriptions()) {
if (subscription.isAuthorizationPending()) {
continue;
}
Element entity = childElement.addElement("subscription");
entity.addAttribute("jid", subscription.getJID().toString());
entity.addAttribute("affiliation", affiliate.getAffiliation().name());
//entity.addAttribute("affiliation", affiliate.getAffiliation().name());
entity.addAttribute("subscription", subscription.getState().name());
if (isMultipleSubscriptionsEnabled()) {
entity.addAttribute("subid", subscription.getID());
......@@ -1891,7 +1907,6 @@ public abstract class Node {
}
}
}
}
/**
* Broadcasts a node event to subscribers of the node.
......
......@@ -512,6 +512,8 @@ public class PubSubModule extends BasicModule implements ServerItemsProvider, Di
features.add("http://jabber.org/protocol/pubsub#meta-data");
// Node owners may modify affiliations
features.add("http://jabber.org/protocol/pubsub#modify-affiliations");
// Node owners may manage subscriptions.
features.add("http://jabber.org/protocol/pubsub#manage-subscriptions");
// A single entity may subscribe to a node multiple times
features.add("http://jabber.org/protocol/pubsub#multi-subscribe");
// The outcast affiliation is supported
......@@ -530,8 +532,12 @@ public class PubSubModule extends BasicModule implements ServerItemsProvider, Di
features.add("http://jabber.org/protocol/pubsub#retract-items");
// Retrieval of current affiliations is supported
features.add("http://jabber.org/protocol/pubsub#retrieve-affiliations");
// Retrieval of default node configuration is supported.
features.add("http://jabber.org/protocol/pubsub#retrieve-default");
// Item retrieval is supported
features.add("http://jabber.org/protocol/pubsub#retrieve-items");
// Retrieval of current subscriptions is supported.
features.add("http://jabber.org/protocol/pubsub#retrieve-subscriptions");
// Subscribing and unsubscribing are supported
features.add("http://jabber.org/protocol/pubsub#subscribe");
// Configuration of subscription options is supported
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment