powered by Jive Software

Subscription being automatically accepted?

I’‘ve been running two instances of my custom Smack client, with each one logged in as a separate user (User A and User B). I then get User A to add User B to his roster. Smack will add the User B entry to User A’‘s roster and will also send a subscription request to User B. It seems that the Smack library on User B’'s side automatically accepts the subscription request before I have a chance to create a dialog asking the user if they would like to accept the subscription request.

If this is indeed currently the behaviour, I think it would be better to not automatically accept the subscription request, and to leave the option that it may be rejected.

Please let me know what you think.

Thanks,

Aman

Aman,

Hmm… I’‘m not even sure what the current behavior is, but yeah, you might be right that it automatically accepts all subscription requests. For 3.1, I think I’'m going to allow the following options:

  1. Mode to accept all incoming requests.

  2. Mode to reject all incoming requets.

  3. Mode to manually process each request along with a listener so that you know when each request comes in. This mode would use a queue, probably.

That sound like an ok solution? If you have API ideas for the above, please let me know. I want to get 3.1 out pretty soon though.

Regards,

Matt

Currently, I’'m using Smack at the packet level. When a presence subscription request arrives, Smack automatically responds to it but it also gets passed to my packet listener (registered with Presence.class). So what ends up happening is that the packet listener pops up a dialog asking the user for authorization, when in reality Smack has already authorized the request.

All I would require is an option to turn the automatic subscription off, but still have the packet forwarded to the packet listener.

Thanks,

Aman

Currently Smack does accept all requests in Roster.PresencePacketListener.ProcessPacket().

I think having a listener and queue for subscriptions would be a great luxury.

Take care,

John

Hey guys,

I implemented the feature and it will appear in the next daily build. There is the now a subscription mode that can be set using the roster object. The three modes are:

SUBCRIPTION_ACCEPT_ALL – Automatically accept all subscription requests. This is the default mode and is suitable for simple client. More complex client will likely wish to handle subscription requests manually.

SUBCRIPTION_REJECT_ALL – Automatically reject all subscription requests.

SUBSCRIPTION_MANUAL – Subscription requests are ignored, which means they must be manually processed by registering a listener for presence packets and then looking for any presence requests that have the type Presence.Type.SUBSCRIBE.

Regards,

Matt