# HG changeset patch # User Paul Aurich # Date 1227978343 0 # Node ID df9f962aa907e43e15dd7d3c55ba2d15de0989ec # Parent 0b2a1b6f74646aea148f84e596d5ab2d91d90e6d This technically doesn't matter due to behavior elsewhere in the prpl, but rearrange resource priority so that Extended Away and DND presences are preferred over Unavailable and Unavailable is preferred over unknown presence. committer: John Bailey diff -r 0b2a1b6f7464 -r df9f962aa907 libpurple/protocols/jabber/buddy.c --- a/libpurple/protocols/jabber/buddy.c Sat Nov 29 16:50:34 2008 +0000 +++ b/libpurple/protocols/jabber/buddy.c Sat Nov 29 17:05:43 2008 +0000 @@ -115,14 +115,18 @@ break; case JABBER_BUDDY_STATE_AWAY: case JABBER_BUDDY_STATE_DND: - case JABBER_BUDDY_STATE_UNAVAILABLE: - /* This resource is away/dnd/unavailable. Prefer to one which is extended away or unknown. */ - if ((jbr->state == JABBER_BUDDY_STATE_XA) || + /* This resource is away/dnd. Prefer to one which is extended away, unavailable, or unknown. */ + if ((jbr->state == JABBER_BUDDY_STATE_XA) || (jbr->state == JABBER_BUDDY_STATE_UNAVAILABLE) || (jbr->state == JABBER_BUDDY_STATE_UNKNOWN) || (jbr->state == JABBER_BUDDY_STATE_ERROR)) jbr = l->data; break; case JABBER_BUDDY_STATE_XA: - /* This resource is extended away. That's better than unknown. */ + /* This resource is extended away. That's better than unavailable or unknown. */ + if ((jbr->state == JABBER_BUDDY_STATE_UNAVAILABLE) || (jbr->state == JABBER_BUDDY_STATE_UNKNOWN) || (jbr->state == JABBER_BUDDY_STATE_ERROR)) + jbr = l->data; + break; + case JABBER_BUDDY_STATE_UNAVAILABLE: + /* This resource is unavailable. That's better than unknown. */ if ((jbr->state == JABBER_BUDDY_STATE_UNKNOWN) || (jbr->state == JABBER_BUDDY_STATE_ERROR)) jbr = l->data; break;