tags:

views:

443

answers:

2

Here's what the server is sending me (openfire) when I manually delete a contact from the roster on the server:

'<iq type="set" id="183-87" to="[email protected]/hydra"><query xmlns="jabber:iq:roster"><item jid="[email protected]" name="baz" ask="unsubscribe" subscription="none"><group>Buddies</group></item></query></iq>'
'<iq type="set" id="187-88" to="[email protected]/hydra"><query xmlns="jabber:iq:roster"><item jid="[email protected]" name="baz" subscription="none"><group>Buddies</group></item></query></iq>'
'<presence type="unsubscribed" to="[email protected]" from="[email protected]"/>'

If I respond with a 'unsubscribe' presence stanza (which I think is correct according to RFC 3921), the server keeps spamming me with more 'unsubscribed' presences.

Either way, the next time my client logs in, nothing has changed in the roster. Am I doing something wrong?

+1  A: 

I'm too rusty to be able to give you a direct answer, but since it's been a few hours with no answers let me just make a suggestion...

Load up pidgin or some other client that can log the xmlstream, send the unsubscribe from that client, and then copy the code you see in the log.

That will either help you get the correct stanzas or it will identify an incompatibility in openfire (unlikely, but who knows).

Van Gale
+2  A: 

It depends which client you're talking about - whether it's the subscriber or the subscribee.

.

If the client is the subscriber, then nothing:

According to section 9.4, if the subscriber sends an unsubscribe request, or something else causes the client to be unsubscribed, the server must acknowledge the request/report the state change with an unsubscribed response. That's the end of the interaction.

If the subscriber sends another unsubscribe request each time it's informed that it receives a unsubscribed status from the server telling it that a previous subscription has been removed, then it will never end.

.

If the client is the subscribed node, then it may be sent an unsubscribe to confirm that removing the subscription is allowed, but whether that still stands when you're changing the roster outside of the normal mechanism I'm not sure.

My reading of the table in 9.4 is for the messages between subscribee and server during unsubscription is:

subscriber            server             subscribee
    | -- unsubscribe --> |                    |
    |                    | -- unsubscribe --> |
    |                    | <- unsubscribed -- | (optional)
    |                    | -- unsubscribed -> |
    | <- unsubscribed -- |                    |

My reading of section 8.6, roster removal is this:

subscriber            server             subscribee
    | ----- remove ----> |                    |
    |                    | -- unsubscribe --> |
    |                    | -- unsubscribed -> |
    |                    | -- unavailable --> |
    | <- unsubscribed -- |                    |
    | <-- unavailable -- |                    |

With no acknowledgement required by either client.

Pete Kirkham