|
19 | 19 | import java.net.UnknownHostException;
|
20 | 20 | import java.util.*;
|
21 | 21 |
|
| 22 | +import org.dom4j.Element; |
22 | 23 | import org.jivesoftware.openfire.Connection;
|
23 | 24 | import org.jivesoftware.openfire.SessionManager;
|
24 | 25 | import org.jivesoftware.openfire.StreamID;
|
25 | 26 | import org.jivesoftware.openfire.XMPPServer;
|
26 | 27 | import org.jivesoftware.openfire.auth.AuthToken;
|
27 | 28 | import org.jivesoftware.openfire.auth.UnauthorizedException;
|
| 29 | +import org.jivesoftware.openfire.carbons.Received; |
28 | 30 | import org.jivesoftware.openfire.cluster.ClusterManager;
|
29 | 31 | import org.jivesoftware.openfire.entitycaps.EntityCapabilitiesManager;
|
30 | 32 | import org.jivesoftware.openfire.net.SASLAuthentication;
|
@@ -969,6 +971,21 @@ public void setHasRequestedBlocklist(boolean hasRequestedBlocklist) {
|
969 | 971 | @Override
|
970 | 972 | public boolean canProcess(Packet packet) {
|
971 | 973 |
|
| 974 | + // If the packet is a forwarded stanza (eg: carbon copy), ensure that the forwarded message would have |
| 975 | + // passed the privacy lists that are active for _this_ session. Note that the active list could differ |
| 976 | + // for each session of a particular user! (OF-2189) |
| 977 | + // Implementation note: it might be tempting to implement this in org.jivesoftware.openfire.spi.RoutingTableImpl.ccMessage |
| 978 | + // There is, however, no way to check the active privacy list for sessions on remote cluster nodes there. |
| 979 | + final Received received = (Received) packet.getExtension(Received.NAME, Received.NAMESPACE); |
| 980 | + if (received != null) { |
| 981 | + final Packet forwardedStanza = received.getForwardedStanza(); |
| 982 | + if (forwardedStanza != null) { |
| 983 | + if (!canProcess(forwardedStanza)) { |
| 984 | + return false; |
| 985 | + } |
| 986 | + } |
| 987 | + } |
| 988 | + |
972 | 989 | PrivacyList list = getActiveList();
|
973 | 990 | if (list != null) {
|
974 | 991 | // If a privacy list is active then make sure that the packet is not blocked
|
|
0 commit comments