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

When unblocking all contacts response should not contain jids #920

Merged
merged 3 commits into from
Aug 17, 2016

Conversation

bartekgorny
Copy link
Collaborator

This PR addresses the Trello card: "Blocking Command: Bad push received when unblock all"

As stated in XEP-0191, point 3.5, when a user sends an "unblock" stanza without specifying jids to unblock, the server should unblock all contacts and reply with an empty result (no jid list). This PR fixes this.

@michalwski
Copy link
Contributor

This PR addresses the Trello card: "Blocking Command: Bad push received when unblock all"

Could you please create issue here from the card and reference to it? Or just put the examples from the card in this PR.

@michalwski
Copy link
Contributor

Also dialyzer has some suggestions regarding types.

@@ -529,10 +534,10 @@ get_blocklist_items(Items) ->
user_blocks(Blocker, Blockees) when is_list(Blockees) ->
BlockeeJIDs = [ escalus_utils:jid_to_lower(escalus_client:short_jid(B)) || B <- Blockees ],
AddStanza = block_users_stanza(BlockeeJIDs),
ct:pal("add stanza ~p", [AddStanza]),
%% ct:pal("add stanza ~p", [AddStanza]),
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's remove these commented ct:pal calls.

@bartekgorny
Copy link
Collaborator Author

bartekgorny commented Aug 17, 2016

According to http://xmpp.org/extensions/xep-0191.html#unblockall

When I unblock all sending:

<iq id='6w6t1-62' type='set'><unblock xmlns='urn:xmpp:blocking'/></iq>

I should receive a push like this:

<iq from='gardano@erlang-solutions.com' to='gardano@erlang-solutions.com/9bb69f6dacb33248' id='push' type='set'>
 <unblock xmlns='urn:xmpp:blocking'/>
</iq>

But I receive this push:

<iq from='gardano@erlang-solutions.com' to='gardano@erlang-solutions.com/9bb69f6dacb33248' id='push' type='set'>
  <unblock xmlns='urn:xmpp:blocking'>
    <item jid='griveroa-inaka@erlang-solutions.com'/>
    <item jid='ramabit@erlang-solutions.com'/>
  </unblock>
</iq>

Where griveroa-inaka@erlang-solutions.com and ramabit@erlang-solutions.com are the JIDs unblocked

@Dzol Dzol merged commit 15d5b07 into master Aug 17, 2016
@michalwski michalwski mentioned this pull request Aug 29, 2016
@michalwski michalwski deleted the blocking-push-fix branch September 27, 2016 06:36
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