|
9 | 9 | import org.apache.log4j.Logger; |
10 | 10 | import org.buddycloud.channelserver.channel.ChannelManager; |
11 | 11 | import org.buddycloud.channelserver.channel.Conf; |
12 | | -import org.buddycloud.channelserver.db.NodeStore.Transaction; |
13 | 12 | import org.buddycloud.channelserver.db.exception.NodeStoreException; |
14 | 13 | import org.buddycloud.channelserver.packetprocessor.iq.namespace.pubsub.JabberPubsub; |
15 | 14 | import org.buddycloud.channelserver.packetprocessor.iq.namespace.pubsub.PubSubElementProcessorAbstract; |
@@ -130,16 +129,18 @@ public void process(Element elm, JID actorJID, IQ reqIQ, Element rsm) |
130 | 129 | Affiliations defaultAffiliation = null; |
131 | 130 | Subscriptions defaultSubscription = null; |
132 | 131 |
|
133 | | - if (!possibleExistingSubscription.in(Subscriptions.none)) { |
| 132 | + if (!possibleExistingSubscription.in(Subscriptions.none) && |
| 133 | + !possibleExistingAffiliation.in(Affiliations.none)) { |
134 | 134 | LOGGER.debug("User already has a '" |
135 | 135 | + possibleExistingSubscription.toString() |
136 | 136 | + "' subscription"); |
137 | 137 | defaultAffiliation = possibleExistingAffiliation; |
138 | 138 | defaultSubscription = possibleExistingSubscription; |
139 | 139 | } else { |
140 | 140 | try { |
141 | | - defaultAffiliation = Affiliations.createFromString(nodeConf |
142 | | - .get(Conf.DEFAULT_AFFILIATION)); |
| 141 | + String nodeDefAffiliation = nodeConf.get(Conf.DEFAULT_AFFILIATION); |
| 142 | + LOGGER.debug("Node default affiliation: '" + nodeDefAffiliation + "'"); |
| 143 | + defaultAffiliation = Affiliations.createFromString(nodeDefAffiliation); |
143 | 144 | } catch (NullPointerException e) { |
144 | 145 | LOGGER.error("Could not create affiliation.", e); |
145 | 146 | defaultAffiliation = Affiliations.member; |
|
0 commit comments