Commit 8e78cae3 authored by Christian Schudt's avatar Christian Schudt

OF-397 Do not deliver offline messages to clients with negative priority

As per RFC 6121 8.5.2.1.1. Message and XEP-0160
parent 8e86f0b8
......@@ -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
* 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() {
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;
}
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