powered by Jive Software

Presence Changes (Removal of AVAILABLE_TYPE and SHOW_NORMAL)

I’m new to XIFF and have realized that some changes have been made to the Presence class from the time that the few online samples I have found were written till now.

I see that the static properties AVAILABLE_TYPE and SHOW_NORMAL have been removed.

After some digging I see that the presence type now defaults to available, but I’m not seeing that the show value defaults to normal, just null.

Does null for the show value mean what normal meant in the previous version?

Also, since the presence type defaults to available, it might make sense to add the type back in as a static property and default the value in the constructor to “available” rather than null… that would be less confusing for new developers and would make more sense when you are changing the type through the setter later to use AVAILABLE_TYPE rather than null.

Anyway, great job with this, but wow… documentation sure would be nice

I’ve been off the project for a while, but let me look into this. I think it should be AVAILABLE_TYPE. Not sure why they changed it.

At the specs, http://xmpp.org/rfcs/rfc3921.html, only following states are listed:

  • unavailable – Signals that the entity is no longer available for communication.
  • subscribe – The sender wishes to subscribe to the recipient’s presence.
  • subscribed – The sender has allowed the recipient to receive their presence.
  • unsubscribe – The sender is unsubscribing from another entity’s presence.
  • unsubscribed – The subscription request has been denied or a previously-granted subscription has been cancelled.
  • probe – A request for an entity’s current presence; SHOULD be generated only by a server on behalf of a user.
  • error – An error has occurred regarding processing or delivery of a previously-sent presence stanza.

And as in for “show” attribute:

  • away – The entity or resource is temporarily away.
  • chat – The entity or resource is actively interested in chatting.
  • dnd – The entity or resource is busy (dnd = “Do Not Disturb”).
  • xa – The entity or resource is away for an extended period (xa = “eXtended Away”).

Perhaps in order to follow the standard, some options were removed.