Subscribe / Unsubscribe via Gateway

Quick question on subscribe/unsubscribe (aka buddy invites). I just implemented invitation and response logic in my client (using Smack) that works great for other XMPP contacts (both inviter and invitee). It also works great when the remote system (e.g. MSN) initiates a subscribe or unsubscribe.

Unfortunately, something in the plumbing seems to be eating subscribes and unsubscribes initiated by my code when the target is a remote system like MSN or Yahoo.

Is there something special that needs to be configured or coded to make those invitations work?



What do you mean? Your code does a subscribe (effectively adding a new person to your roster) and?

I actually don’t listen for subscribe/unsubscribe events. I watch the roster itself and see the person get removed from the roster. I immediately return a success upon receiving those events.

What I’m paying attention to is:

Section 7.4

(and assorted friends of that)

Am I following what you are doing correctly?

Hi Jade,

I was following section 6 of the same document you referenced. In the case of an XMPP buddy invite, I simply send a presence type=subscribe event. If the invitee accepts, then I see a Roster. entriesAdded event come back to me, which I assume means the buddy has been added to my roster. The inverse happens when I send a presence type=unsubscribe… I see a Roster.entriesRemoved event.

When I do the same thing- send a presence type=subscribe or unsubscribe to a Yahoo or MSN contact via the gateway- nothing happens (as noted below).

I read section 7 and have to admit I’m a little confused as to what I should be doing… if I add a roster item, is a subscribe message automatically sent? Or do I need to do both? Or was I doing it correctly already?

Thanks for the quick reply! The new gateway is working great and opening up all kinds of possibilities. Thanks for all yor hard work on it!