# HG changeset patch # User Mikael Berthe # Date 1222880999 -7200 # Node ID 5ef122b2bb757a394a0cf78c1ae8f7d40d75335d # Parent 33f8f795abd2440e65ed5ec149cadc85484071c0 Use the status string of the most likely resource in the chat status bar T. Glaser reported that mcabber can display the status string of a resource with a low priority in the chat status bar. A string which doesn't match the displayed status itself... diff -r 33f8f795abd2 -r 5ef122b2bb75 mcabber/src/screen.c --- a/mcabber/src/screen.c Tue Sep 30 19:50:46 2008 +0200 +++ b/mcabber/src/screen.c Wed Oct 01 19:09:59 2008 +0200 @@ -1722,13 +1722,16 @@ // No status message for MUC rooms if (!ismuc) { - GSList *resources, *p_res; + GSList *resources, *p_res, *p_next_res; resources = buddy_getresources(BUDDATA(current_buddy)); - msg = buddy_getstatusmsg(BUDDATA(current_buddy), - resources ? resources->data : ""); - // Free the resources list data - for (p_res = resources ; p_res ; p_res = g_slist_next(p_res)) + + for (p_res = resources ; p_res ; p_res = p_next_res) { + p_next_res = g_slist_next(p_res); + // Store the status message of the latest resource (highest priority) + if (!p_next_res) + msg = buddy_getstatusmsg(BUDDATA(current_buddy), p_res->data); g_free(p_res->data); + } g_slist_free(resources); } else { msg = buddy_gettopic(BUDDATA(current_buddy));