Commit aabb2bf5 authored by GregDThomas's avatar GregDThomas Committed by daryl herzmann

OF-1314 Add the ability to disabled delayed delivery (XEP-203) (#725)

* Add option to disable delayed delivery (XEP-0203)
parent d45d5b57
......@@ -24,6 +24,7 @@ import java.util.Date;
import java.util.List;
import org.dom4j.Element;
import org.jivesoftware.util.JiveGlobals;
import org.jivesoftware.util.LocaleUtils;
import org.jivesoftware.util.XMPPDateTimeFormat;
import org.slf4j.Logger;
......@@ -785,9 +786,17 @@ public class NodeSubscription {
* Depending on the subscription configuration the event notification may or may not have
* a payload, may not be sent if a keyword (i.e. filter) was defined and it was not matched.
*
* <p>Sending the last published item can also be entirely disabled by setting
* <tt>xmpp.pubsub.disable-delayed-delivery</tt> to <tt><true</tt>.</p>
*
* @param publishedItem the last item that was published to the node.
*/
void sendLastPublishedItem(PublishedItem publishedItem) {
// Check to see if we've been disabled
if (JiveGlobals.getBooleanProperty("xmpp.pubsub.disable-delayed-delivery", false)) {
return;
}
// Check if the published item can be sent to the subscriber
if (!canSendPublicationEvent(publishedItem.getNode(), publishedItem)) {
return;
......
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