Opened 5 years ago

Last modified 3 years ago

#16414 new defect

Unable to unblock a user with XMPP

Reported by: ehlebracht Owned by: deryni
Milestone: Component: XMPP
Version: 2.10.10 Keywords: block unblock xmpp
Cc:

Description

We are using Pidgin 2.10.x as a XMPP-IM on ejabberd-2.1.13. Our users are able to block buddies by using the buddy-list. Blocking a user with Pidgin creates an entry "privacy" in the ejabberd database with a section "Blocked contacts".

Once a user is blocked by Pidgin the users are unable to unblock their buddies. After restarting Pidgin all blocked buddies stay blocked. Sending an "unblock" by using the buddy-list does not have any effect to the ejabberd database.

Change History (3)

comment:1 Changed 3 years ago by dx

  • Component changed from unclassified to XMPP
  • Owner changed from EionRobb to deryni

comment:2 Changed 3 years ago by sudoman

I too am having this issue with Pidgin 2.11.0 and ejabberd 2.1.11 and 14.07.

As for a work around, go to "Tools -> Plugins" menu option in the Pidgin main window. Scroll to the bottom and enable "XMPP Console". Then close that window and go to "Tools -> XMPP Console -> XMPP Console". Then type paste in the following code:

<iq type='get' id='blocklist1'>
  <blocklist xmlns='urn:xmpp:blocking'/>
</iq>

This shows the identifiers of the people you have blocked. any numbers at the end of the identifier is the resource id. The easiest option may be to unblock everyone and then re-block people you want blocked using the interface (if you aren't currently blocking many people):

<iq type='set' id='unblock2'>
  <unblock xmlns='urn:xmpp:blocking'/>
</iq>

To remove a single block, look for the xmpp/jabber id of the user you want to unblock in the output from the first command. copy that id along with the resource id containing numbers and letters. in other words, get everything between the relevant quotation marks. Then replace the user id in the following command and submit that to the server:

<iq type='set' id='unblock1'>
  <unblock xmlns='urn:xmpp:blocking'>
    <item jid='romeo@montague.net/1234567890'/>
  </unblock>
</iq>

comment:3 Changed 3 years ago by sudoman

Pidgin is able to unblock a user with its user interface if Pidgin does not specify the resource id in the block command. If one has a conversation with a non-buddy before blocking them (or perhaps merely receives a message) then the resource id is included in the blocked id. In this case pidgin fails to remove the block. This is the normal use case, which does not work.

If one blocks a user that has sent a message, the unblock command does not appear in the pidgin menu for that conversation.

If one blocks a buddy or types in the id of a user manually, then the resource id is not included in the blocked id, and the user can be unblocked again with the interface.

If one uses an xml query to get the list of blocked users and manually sends the command to the server to unblock a user, including the resource id, then the user is successfully unblocked.

Test case showing failure to unblock: Talk to myself without my id set as a buddy, then block:

<iq type='set' id='purpled16203ce'>
	<block xmlns='urn:xmpp:blocking'>
		<item jid='user@example.com/26161429451480953025915356'/>
	</block>
</iq>
<iq from='user@example.com' to='user@example.com/26161429451480953025915356' id='push4180013374' type='set'>
	<query xmlns='jabber:iq:privacy'>
		<list name='Blocked contacts'/>
	</query>
</iq>
<iq id='push4180013374' to='user@example.com' type='error'>
	<query xmlns='jabber:iq:privacy'>
		<list name='Blocked contacts'/>
	</query>
	<error type='cancel' code='501'>
		<feature-not-implemented xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
	</error>
</iq>
<iq from='user@example.com' to='user@example.com/26161429451480953025915356' id='push' type='set'>
	<block xmlns='urn:xmpp:blocking'>
		<item jid='user@example.com/26161429451480953025915356'/>
	</block>
</iq>
<iq type='result' id='push'/>
<iq from='user@example.com' to='user@example.com/26161429451480953025915356' id='purpled16203ce' type='result'/>

Restart pidgin, start convo, attempt to unblock, send xml query to see block list:

<iq type='set' id='purple801cee3b'>
	<unblock xmlns='urn:xmpp:blocking'>
		<item jid='user@example.com'/>
	</unblock>
</iq>
<iq from='user@example.com' to='user@example.com/21017744501480954943927273' id='push1218407149' type='set'>
	<query xmlns='jabber:iq:privacy'>
		<list name='Blocked contacts'/>
	</query>
</iq>
<iq id='push1218407149' to='user@example.com' type='error'>
	<query xmlns='jabber:iq:privacy'>
		<list name='Blocked contacts'/>
	</query>
	<error type='cancel' code='501'>
		<feature-not-implemented xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>
	</error>
</iq>
<iq from='user@example.com' to='user@example.com/21017744501480954943927273' id='push' type='set'>
	<unblock xmlns='urn:xmpp:blocking'>
		<item jid='user@example.com'/>
	</unblock>
</iq>
<iq type='result' id='push'/>
<iq from='user@example.com' to='user@example.com/21017744501480954943927273' id='purple801cee3b' type='result'/>
<iq type='get' id='blocklist1'>
  	<blocklist xmlns='urn:xmpp:blocking'/>

</iq>
<iq from='user@example.com' to='user@example.com/21017744501480954943927273' id='blocklist1' type='result'>
	<blocklist xmlns='urn:xmpp:blocking'>
		<item jid='user@example.com/26161429451480953025915356'/>
	</blocklist>
</iq>

Unblocking also fails without restarting Pidgin after blocking a user.

Perhaps pidgin should not include resource ids when blocking users. To retroactively allow fixing old stuck blocks, perhaps a future version of pidgin should query the server for a list blocked users, compare the user name and domain name and unblock all matches, by unblocking with all found resource ids.

Note: See TracTickets for help on using tickets.
All information, including names and email addresses, entered onto this website or sent to mailing lists affiliated with this website will be public. Do not post confidential information, especially passwords!