Proper way to see if a subscription request is inbound or outbound?

I’m new to Smack, and I’m probably missing something obvious and will embarrass myself, but here we go.

I’m not able to determine if a subscription Stanza is inbound or outbound through methods in RosterEntry & RosterPacket.ItemType.

When listening to incoming Presences with SubscriptionMode.manual set, it works as expected when I send/receive subscription requests. However, I don’t find a way to hand that type of subscription over to the Roster when creating an entry for it (to a sort of “pending” list).

When calling RosterEntry#getType, it always returns “none.” The method’s documentation says I can get more info from “#getStatus” in this case, which does not seem to exist. I’ve tried the RosterEntry#isSubscriptionPending method, which only tells me if the subscription hasn’t yet been accepted, but not whether it’s being sent from or to the user.

I even dug through the classes to see where you initialise the class RosterEntry, to find out how you set the variable isSubscriptionPending, but couldn’t find any instances.

I’ve tried using RosterEntry#getJid, but this will always return the other entity’s name, whether it’s inbound or outbound.

Hope this makes sense.

Android Smack Version 4.4.7.

This topic was automatically closed 62 days after the last reply. New replies are no longer allowed.