Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make privacy list message blocking incoming only #1084

Merged
merged 1 commit into from
Nov 24, 2016

Conversation

bernardd
Copy link
Contributor

XEP-0016 s2.9 describes the <message> blocking system only in terms of
incoming messages, however the existing implementation also blocks
matching outgoing messages. This change alters the behaviour so that
only incoming messages that match message privacy list entries are
blocked.

The reasoning for this is twofold:

  • First, it brings the behaviour in to line with that described in the XEP, and
  • Second, the previous behaviour precluded any kind of privacy list based asymmetric messaging (eg a follower/followed relationship where messages can only be sent in one direction).

@@ -513,8 +513,8 @@ allow_subscription_both_message(Config) ->
escalus_client:send(Alice, escalus_stanza:chat_to(bob, <<"Hi, Bob XYZ!">>)),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to Elvis:

Line 513 is too long: escalus_client:send(Alice, escalus_stanza:chat_to(bob, <<"Hi, Bob XYZ!">>)),.

@@ -394,12 +394,12 @@ block_jid_message(Config) ->
timer:sleep(?SLEEP_TIME),
escalus_assert:has_no_stanzas(Alice),

%% now Alice try to send a msg to Bob, whom she had blocked, and gets error
%% Blocking only applies to incoming messages, so Alice can still send
%% Bob a message
%% and Bob gets nothing
escalus_client:send(Alice, escalus_stanza:chat_to(Bob, <<"Hi, Bobbb!">>)),

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to Elvis:

Line 400 is too long: escalus_client:send(Alice, escalus_stanza:chat_to(Bob, <<"Hi, Bobbb!">>)),.

@bernardd bernardd force-pushed the privacy-message-incoming-only branch from a9c2c98 to ad4ce15 Compare November 21, 2016 22:49
client_gets_blocking_error(C) ->
Stanza = escalus_client:wait_for_stanza(C),
escalus:assert(fun is_xep191_not_available/1, [], Stanza).

client_gets_block_iq(C) ->
escalus:assert(fun is_xep191_push/2, [<<"block">>], escalus:wait_for_stanza(C)).

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to Elvis:

Line 606 is too long: escalus:assert(fun is_xep191_push/2, [<<"block">>], escalus:wait_for_stanza(C))..

XEP-0016 2.9 describes the <message> blocking system only in terms of
incoming messages, however the existing implementation also blocks
matching outgoing messages. This change alters the behaviour so that
only incoming messages that match `message` privacy list entries are
blocked.
@bernardd bernardd force-pushed the privacy-message-incoming-only branch from 25cd17f to 7330993 Compare November 22, 2016 00:21
@michalwski michalwski merged commit ec9c857 into esl:master Nov 24, 2016
@michalwski
Copy link
Contributor

Thanks a lot @bernardd for your contribution!

This was referenced Jan 20, 2017
@toland toland deleted the privacy-message-incoming-only branch January 30, 2018 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants