On 26/06/2006, at 10:11 PM, Norman Rasmussen wrote: > On 6/26/06, Stian B. Barmen <[EMAIL PROTECTED]> wrote: >> Both transports have the same priority, but different resource names. >> Seems the one (darkstar) always is above the other >> (gajim_kontoret) in >> pri. If one of these two goes away and the other is online then the >> transport should be available in my humble opinion. > > RFC3921, Section 11.1.4.1: > > For message stanzas, the server SHOULD deliver the stanza to > the highest-priority available resource (if the resource did > not provide a value for the <priority/> element, the server > SHOULD consider it to have provided a value of zero). If > two > or more available resources have the same priority, the > server MAY use some other rule (e.g., most recent connect > time, most recent activity time, or highest availability as > determined by some hierarchy of <show/> values) to choose > between them or MAY deliver the message to all such > resources. > > (FYI: Google ignore the SHOULD, and always deliver (undirected) > stanza's to all connected resources.) > > What's the logic in the transport at the moment with multiple > resources? I assume it takes the highest resource's priority for the > legacy status. The question is: what does it do with multiple clients > with the same priority (like google talk for example)? > > Surely it should remain available if _any_ of the highest priority > clients are available. If they're all away, then maybe use the > oldest? > > FYI: The irc and yahoo transports use: highest, then oldest (i.e. > connected the longest) - and ignore the status entirely. > > -- > - Norman Rasmussen > - Email: [EMAIL PROTECTED] > - Home page: http://norman.rasmussen.co.za/
Currently when there are two resources with the same priority, the chosen one is undefined. That's because the resources are stored in a hashtable. It mentioned an order of <show/>. Is this specified anywhere? It wouldn't be too hard to sort based on this. --- James
