Commit 40eb0f27 authored by dwd's avatar dwd

Merge pull request #39 from sco0ter/of397

OF-397 Do not deliver offline messages to clients with negative priority
parents 330f2531 8e78cae3
...@@ -674,9 +674,11 @@ public class LocalClientSession extends LocalSession implements ClientSession { ...@@ -674,9 +674,11 @@ public class LocalClientSession extends LocalSession implements ClientSession {
* *
* @return true if the offline messages of the user should be sent to the user when the user * @return true if the offline messages of the user should be sent to the user when the user
* becomes online. * becomes online.
* @see <a href="http://www.xmpp.org/extensions/xep-0160.html">XEP-0160: Best Practices for Handling Offline Messages</a>
*/ */
public boolean canFloodOfflineMessages() { public boolean canFloodOfflineMessages() {
if(offlineFloodStopped) { // XEP-0160: When the recipient next sends non-negative available presence to the server, the server delivers the message to the resource that has sent that presence.
if(offlineFloodStopped || presence.getPriority() < 0) {
return false; return false;
} }
String username = getAddress().getNode(); String username = getAddress().getNode();
......
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