Commit 0979bfa1 authored by Guus der Kinderen's avatar Guus der Kinderen

OF-1046: Improve offline-storage usage

Existing code already tried to prevent message bounces when a stanza was
sent by the server itself. This commit builds on that solution.
Also, debug logging was added for the store-and-* strategies when storage
was no longer possible as a result of quota limitations (we had a hard time
debugging this)
parent df47742b
...@@ -148,12 +148,15 @@ public class OfflineMessageStrategy extends BasicModule implements ServerFeature ...@@ -148,12 +148,15 @@ public class OfflineMessageStrategy extends BasicModule implements ServerFeature
store(message); store(message);
} }
else { else {
Log.debug( "Unable to store, as user is over storage quota. Bouncing message instead: " + message.toXML() );
bounce(message); bounce(message);
} }
break; break;
case store_and_drop: case store_and_drop:
if (underQuota(message)) { if (underQuota(message)) {
store(message); store(message);
} else {
Log.debug( "Unable to store, as user is over storage quota. Silently dropping message: " + message.toXML() );
} }
break; break;
case drop: case drop:
...@@ -200,7 +203,7 @@ public class OfflineMessageStrategy extends BasicModule implements ServerFeature ...@@ -200,7 +203,7 @@ public class OfflineMessageStrategy extends BasicModule implements ServerFeature
private void bounce(Message message) { private void bounce(Message message) {
// Do nothing if the sender was the server itself // Do nothing if the sender was the server itself
if (message.getFrom() == null) { if (message.getFrom() == null || message.getFrom().equals( serverAddress )) {
return; return;
} }
try { try {
......
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