Using XML

To set user status you need to set HTTP header Content-Type to application/xml

<command>
    <available>true</available>
    <priority>-1</priority>
    <show>xa</show>
    <status>On the phone</status>
</command>

where:

  • available - may be:

    • true - user is available/connected (default)
    • false - user is unavailable/disconnected
  • priority - an integer of presence priority. (It should be always set as a negative value to make sure that messages are not dropped) (default: -1)
  • show - may be one of presence/show element values (optional)

    • chat
    • away
    • xa
    • dnd
  • status - message which should be sent as a presence status message (optional)

As a result server will return following XML:

<status>
  <user>test@domain.com/tigase-external</user>
  <available>true</available>
  <priority>priority</priority>
  <show>xa</show>
  <status>On the phone</status>
  <success>true</success>
</status>

This will confirm that user test@domain.com with resource tigase-external has it presence changed (look for success element value).