Project

General

Profile

Privacy Lists: mutual blocking

Igor Khomenko
Added almost 3 years ago

Hi there,

I realised that Privacy Lists performs mutual blocking

for example, User1 blocked User2.

now User1 sends a message to User2 and receives an error

I didn't find any information regarding this case http://xmpp.org/extensions/xep-0016.html

There is only information regarding "Blocked Entity Attempts to Communicate with User" http://xmpp.org/extensions/xep-0016.html#protocol-error

did you intentionally add it?


Replies (5)

Added by Wojciech Kapcia TigaseTeam almost 3 years ago

Linked specification applies only to inbound stanzas:

If a blocked entity attempts to send a stanza to the user (i.e., an inbound stanza from the user's perspective), the user's server shall handle the stanza according to the following rules:

And Tigase follows it - if User1 blocks User2 only User2 will receive the error and User1 will still be able to send messages to User2 - the only exception is presence which defines both presence-in and @presence-out@.

I've just tested it and it works like described.

Added by Igor Khomenko almost 3 years ago

It doesn't work like that on my side

let me check again

Added by Wojciech Kapcia TigaseTeam almost 3 years ago

If I remember correctly you are using some custom code? Can you try running this use case against vanilla Tigase first just to rule this out?

Added by Igor Khomenko almost 3 years ago

Checked 7.0.3 and still have this issue

and I found one thing in code, why it works this way

class JabberIqPrivacy*, method *allow

you have the following code:

JID     jid           = packet.getStanzaFrom();
boolean packetIn      = true;

if ((jid == null) || sessionUserId.equals(jid.getBareJID())) {
    jid      = packet.getStanzaTo();
    packetIn = false;
}

so, for example, User1 has User2 in his privacy list

then User1 sends a message to User2.

so this messages comes to JabberIqPrivacy.filter method on the User1's side

and then above jid variable becomes packet.getStanzaTo() (User2).

And because a 'User2' record is in the User1's list, so this message will be removed inside JabberIqPrivacy.filter method.

That's my investigation

Added by Wojciech Kapcia TigaseTeam almost 3 years ago

Igor Khomenko wrote:

Checked 7.0.3 and still have this issue

and I found one thing in code, why it works this way

class JabberIqPrivacy*, method *allow

you have the following code:

[...]

so, for example, User1 has User2 in his privacy list

then User1 sends a message to User2.

so this messages comes to JabberIqPrivacy.filter method on the User1's side

and then above jid variable becomes packet.getStanzaTo() (User2).

And because a 'User2' record is in the User1's list, so this message will be removed inside JabberIqPrivacy.filter method.

But you've missed other part - setting @packetIn = false;@, which ten is taken into consideration in @tigase.xmpp.impl.JabberIqPrivacy.matchToPrivacyListElement(boolean, Packet, Element, ITEM_ACTION)@, which then doens't match to privacy list if the packet is not incoming.

    (1-5/5)