powered by Jive Software

Wrong priority for Presence stanza

Currently if presence stanza doesn’t contain then smack when parsing priority field will set it to Integer.MIN_VALUE.

According to https://tools.ietf.org/html/rfc6121#section-4.7.2.3 :
If no priority is provided, the processing server or client MUST consider the priority to be zero (“0”).

Solution will be: if there is no priority - set it to 0.

Integer.MIN_VALUE is used as marker that the parsed presence did not had a priority explicitly set. The issue is that Presence.getPriority() will also return it when invoked. The fix is to make getPriority() return if the priority field is set to MIN_VALUE.

Created SMACK-787 to track this. Thanks for reporting.