On Wednesday 08 April 2009 08:36:50 Robin Redeker wrote: > I'm also wondering about the general semantics of _available_ presence from > a bare JID, like discussed in another branch of this thread. > > Imagine these presence stanzas are received by a client for contact a...@b: > > <presence from="a...@b/X" to="m...@jid/myres"/> > > <presence from="a...@b/Y" to="m...@jid/myres"> > <priority>10</priority> > <show>xa</show> > </presence> > > <presence from="a...@b" to="m...@jid/myres"> > <show>away</show> > </presence> > > What should I display? Is the last presence from 'the "empty" resource'? > Empty resources make no sense, as any resource's name must not be empty > anyways (see BNF in RFC 3920). But whats the alternative interpretation of > presence from a bare JID? Does it shadow any other presence? Is it > guaranteed that a client will not receive presence for a bare JID and full > JID from the same contact?
I don't think this was ever fully specified, but we have a decade of history where regular Jabber contacts have been using resources and transport contacts have not, and so clients have had to deal with the discrepancy. Since about 2002, Psi has supported multiple resources, and presence from a JID without a resource is treated as if there is a resource whose value is empty. In the Psi UI, you would see the resources for a...@b as "X", "Y", and "[blank]". You might be able to get away with an empty resource overshadowing all non-empty ones, and any non-empty one overshadowing an empty one, whichever is received most recently, under the assumption that the two approaches would never be mixed. However, I feel being able to support empty and non-empty side-by-side for the same bare JID is the safest approach in a client. For better or worse, I think empty resources are a de facto standard we're stuck with. -Justin
