Commit 74203ec8 authored by Christian Schudt's avatar Christian Schudt

Openfire should return "msgoffline" in disco requests (as per XEP-0160)

parent 8df2958e
...@@ -20,10 +20,13 @@ ...@@ -20,10 +20,13 @@
package org.jivesoftware.openfire; package org.jivesoftware.openfire;
import java.util.Collections;
import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.CopyOnWriteArrayList;
import org.jivesoftware.openfire.container.BasicModule; import org.jivesoftware.openfire.container.BasicModule;
import org.jivesoftware.openfire.disco.ServerFeaturesProvider;
import org.jivesoftware.openfire.privacy.PrivacyList; import org.jivesoftware.openfire.privacy.PrivacyList;
import org.jivesoftware.openfire.privacy.PrivacyListManager; import org.jivesoftware.openfire.privacy.PrivacyListManager;
import org.jivesoftware.openfire.user.UserManager; import org.jivesoftware.openfire.user.UserManager;
...@@ -40,7 +43,7 @@ import org.xmpp.packet.PacketExtension; ...@@ -40,7 +43,7 @@ import org.xmpp.packet.PacketExtension;
* *
* @author Iain Shigeoka * @author Iain Shigeoka
*/ */
public class OfflineMessageStrategy extends BasicModule { public class OfflineMessageStrategy extends BasicModule implements ServerFeaturesProvider {
private static final Logger Log = LoggerFactory.getLogger(OfflineMessageStrategy.class); private static final Logger Log = LoggerFactory.getLogger(OfflineMessageStrategy.class);
...@@ -241,6 +244,18 @@ public class OfflineMessageStrategy extends BasicModule { ...@@ -241,6 +244,18 @@ public class OfflineMessageStrategy extends BasicModule {
} }
} }
@Override
public Iterator<String> getFeatures() {
switch (type) {
case store:
case store_and_bounce:
case store_and_drop:
// http://xmpp.org/extensions/xep-0160.html#disco
return Collections.singleton("msgoffline").iterator();
}
return Collections.<String>emptyList().iterator();
}
/** /**
* Strategy types. * Strategy types.
*/ */
......
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