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...
--- 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));